main_2020_edit.js 2.5 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955
  1. window.common = null;
  2. window.MathLight = null;
  3. window.math = null
  4. g_playAudio = null
  5. g_tourAudio = new Audio
  6. g_tourAudio.loop = !1
  7. g_tourAudio.crossOrigin = "anonymous"
  8. g_tourAudio.addEventListener("ended", function() {
  9. var e = document.createEvent("MouseEvent");
  10. e.initEvent("tourAudioEnded", !0, !0),
  11. window.dispatchEvent(e)
  12. })
  13. g_tourAudio.oncanplaythrough = function() {
  14. g_tourAudio.play();
  15. /* if(g_bgAudio && !g_bgAudio.paused){
  16. manage.switchBgmState(false);
  17. g_bgAudio.pauseByTour = true
  18. } */
  19. g_playAudio = g_tourAudio;
  20. }
  21. var dealMap = (map)=>{//使不resize when image is not power of two
  22. map.wrapS = map.wrapT = THREE.ClampToEdgeWrapping;
  23. map.wrapS = map.wrapT = THREE.NearestFilter
  24. map.minFilter = THREE.LinearFilter;
  25. map.magFilter = THREE.LinearFilter;
  26. map.generateMipmaps = true;
  27. }
  28. var sortByScore = function(list, request, rank) {
  29. var i = common.filterAll(list, request);
  30. return 0 === i.length ? null : i = i.map(function(e) {
  31. return {
  32. item: e,
  33. score: rank.reduce(function(t, i) {
  34. return t + i(e);
  35. }, 0)
  36. };
  37. }).sort(function(e, t) {
  38. return t.score - e.score;
  39. });
  40. };
  41. var getTransformSid = function(){
  42. var name
  43. if(player.mode == 'panorama'){
  44. name = player.currentPano ? player.currentPano.id : 'outside'
  45. }else{
  46. name = 'outside'
  47. }
  48. return name
  49. }
  50. var convertTool = {
  51. getPos2d : function(point, camera, dom){//获取一个三维坐标对应屏幕中的二维坐标
  52. var camera = camera || player.camera;
  53. var dom = dom || player.domElement;
  54. 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);
  55. var x,y;
  56. x = (pos.x + 1) / 2 * dom.clientWidth;
  57. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  58. var inSight = x <= dom.clientWidth && x >= 0 //是否在屏幕中
  59. && y <= dom.clientHeight && y >= 0
  60. return {
  61. pos: new THREE.Vector2(x,y), // 屏幕像素坐标
  62. vector: pos, //(范围 -1 ~ 1)
  63. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  64. inSight : inSight //在屏幕范围内可见
  65. };
  66. },
  67. ifShelter: function(pos3d){//检测某点在视线中是否被mesh遮挡
  68. var ori = player.position
  69. var dir = pos3d.clone().sub(ori).normalize()
  70. var ray = new THREE.Raycaster(ori, dir) //由外向里 因为模型从内侧是可见的所以从外侧
  71. /* if(config.isEdit && publicObjectSet.editor.mainDesign.editing){
  72. var o = ray.intersectObjects(publicObjectSet.editor.mainDesign.wallMeshes);
  73. }else{ */
  74. var o = ray.intersectObjects(player.model.colliders);
  75. //}
  76. var len = pos3d.distanceTo(ori);
  77. if (o && o.length) {
  78. for(var i=0;i<o.length;i++){
  79. if(o[i].distance < len){ return true; }//有遮挡
  80. }
  81. }
  82. },
  83. /*
  84. 拖拽时,获取鼠标在拖拽面上的位置(需要借助另一个intersectPlane面来计算,即和相机方向一样的面,可保证铺满屏幕)
  85. 但是不一定能获取到,比如鼠标射线不朝向拖拽面时,即使获取也会是一个意外的反方向的交点。
  86. */
  87. getPosAtPlane : function(pos, info/* , mouse, camera */){ //pos:与intersectPlane的交点 见笔记
  88. var A = pos;
  89. var player = player;
  90. var mouse = player.mouse;
  91. var O = new THREE.Vector3(mouse.x, mouse.y, -1).unproject(player.camera);
  92. if(info.y != void 0){//地面线的
  93. var y = info.y;
  94. if(player.mode == "floorplan"/* || Math.abs(O.x-pos.x)<0.0001 && Math.abs(O.z-pos.z)<0.0001) */){
  95. //intersectPlane和地面平行,无交点
  96. var x = pos.x, z = pos.z;
  97. }else{
  98. if(y<player.camera.position.y && O.y <= A.y /* || y>player.camera.position.y && O.y >= A.y */)return null; //鼠标射线向上。因为相机一定位于地面以上(地面不会抬高到相机上吧?),所以无交点。
  99. if(O.y == A.y){console.log('一样??');return;}
  100. if(A.y == y){console.log('一样2??');return;}
  101. var r = (O.y-y)/(A.y-y);
  102. var x = (r*A.x-O.x)/(r-1);
  103. var z = (r*A.z-O.z)/(r-1);
  104. }
  105. }else{//垂直的也有越过消失点以后反向变化的情况,但使用时影响不大
  106. var N = info.normalVec;
  107. var P = info.pullPos;
  108. if(N.y != 0 ){console.log('N.y != 0');return;} //仅仅支持垂直于地面的的墙壁,目前都是
  109. if(O.z==A.z){console.log('O.z==A.z?');return;}
  110. if(N.z!=0 && N.x != 0){//直接用这个通用的也可以,支持斜线的墙
  111. //console.log('N.z==0 && N.x == 0?');
  112. var c = ( N.x*(A.x-O.x) + N.y*(A.y-O.y) + N.z*(A.z-O.z));
  113. if(c == 0){console.log("分母为0?? return;");return;}
  114. var t = -((N.x*O.x + N.y*O.y + N.z*O.z) - (P.x*N.x + P.y*N.y + P.z*N.z) ) / c
  115. var x = t * (A.x - O.x) + O.x;
  116. var y = t * (A.y - O.y) + O.y;
  117. var z = t * (A.z - O.z) + O.z;
  118. /*原理: 已知空间直线L:(x-a)/m=(x-b)/n=(z-c)/p和空间平面π:Ax+By+Cz+D=0;
  119. 求直线L与平面π的交点的坐标。
  120. 把直线方程改写成参数形式:设(x-a)/m=(x-b)/n=(z-c)/p=t;
  121. 则x=mt+a;y=nt+b;z=pt+c;代入平面π的方程得:
  122. A(mt+a)+B(nt+b)+C(pt+c)+D=0
  123. 由此解得t=-(Aa+Bb+Cc+D)/(Am+Bn+Cp)
  124. 再代入参数方程即得交点的坐标(x,y,z). */
  125. }else if(N.x ==0 ){ //z与pullPos相等
  126. var z = P.z;
  127. if(O.y == A.y){console.log('一样??');return;}
  128. if(A.y == y){console.log('一样2??');return;}
  129. if(A.z == z){console.log('一样3??');return;}
  130. var r = (O.z-z)/(A.z-z);
  131. var x = (r*A.x-O.x)/(r-1);
  132. var y = (r*A.y-O.y)/(r-1);
  133. }else if(N.z == 0){//x与pullPos相等
  134. var x = P.x;
  135. if(O.y == A.y){console.log('一样??');return;}
  136. if(A.y == y){console.log('一样2??');return;}
  137. if(A.x == x){console.log('一样3??');return;}
  138. var r = (O.x-x)/(A.x-x);
  139. var y = (r*A.y-O.y)/(r-1);
  140. var z = (r*A.z-O.z)/(r-1);
  141. }
  142. }
  143. return new THREE.Vector3(x,y,z);
  144. },
  145. getMouseIntersect : function(camera, meshes, mouse){//获取鼠标和meshes交点
  146. var raycaster = new THREE.Raycaster;
  147. camera.updateMatrixWorld();
  148. var origin = new THREE.Vector3(mouse.x,mouse.y,-1).unproject(camera)
  149. , end = new THREE.Vector3(mouse.x,mouse.y,1).unproject(camera);
  150. var dir = end.sub(origin).normalize()
  151. raycaster.set(origin, dir);
  152. var n = raycaster.intersectObjects(meshes);
  153. if (0 === n.length)
  154. return null;
  155. return n[0];
  156. },
  157. ifIntersectChunks : function(A,B,options={}){//获取某个线段/射线和meshes的交点
  158. var dir = B.clone().sub(A).normalize();
  159. var len = options.InfinityLen ? Infinity : A.distanceTo(B) + (options.extLen||0);
  160. var ray = new THREE.Raycaster(A.clone(), dir, 0, len);
  161. var o = ray.intersectObjects(options.model || player.model.colliders);
  162. if (o && o.length)return o;
  163. if(options.throughWidth){ //允许最小宽度,防止穿过极小的缝隙导致撞墙感
  164. var normal = math.getNormal({points:[{x:A.x, y:A.z},{x:B.x, y:B.z}]});//线段法线
  165. normal.multiplyScalar(options.throughWidth)
  166. var normalVec3 = new THREE.Vector3(normal.x, 0, normal.y);
  167. var A2 = A.clone().add(normalVec3)
  168. ray.set(A2, dir);
  169. var o2 = ray.intersectObjects(options.model || player.model.colliders);
  170. ray.set(A.clone().add(normalVec3.negate()), dir);
  171. if (o2 && o2.length)return o2;
  172. var o3 = ray.intersectObjects(options.model || player.model.colliders);
  173. if (o3 && o3.length)return o3;
  174. }
  175. return null;
  176. },
  177. getPosAtSphere : function(pos3d, toPanoPos){
  178. var dir = pos3d.clone().sub(toPanoPos);
  179. dir.normalize();//然后计算在球中
  180. dir.multiplyScalar(Constants.skyRadius);
  181. dir.add(toPanoPos);
  182. return dir;
  183. }
  184. }
  185. var dom = {
  186. getOffset: function(e, t, i) {
  187. for (left = "left" == e ? t.offsetLeft : t.offsetTop,
  188. i = i || $("body")[0]; (t = t.offsetParent) && t != i; )
  189. left += "left" == e ? t.offsetLeft : t.offsetTop;
  190. return left
  191. }
  192. };
  193. if (function() {
  194. "use strict";
  195. function o(e, t) {
  196. return typeof e === t
  197. }
  198. function a(e, t) {
  199. return e instanceof t
  200. }
  201. function s(e) {
  202. return e && e.nodeType
  203. }
  204. function l(e) {
  205. return s(e) ? e : a(e, y) ? e[0] : void 0
  206. }
  207. function e(e, i, n) {
  208. return y.each(e, function(e, t) {
  209. n = i.call(t, n, e, t)
  210. }),
  211. n
  212. }
  213. function t(e, t, i) {
  214. var n, r, o;
  215. if (e === t)
  216. return !0;
  217. if (!e || !t || e.constructor !== t.constructor)
  218. return !1;
  219. for (n = 0,
  220. r = i.length; n < r; n += 1) {
  221. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  222. return !1;
  223. if (e[o] !== t[o])
  224. return !1
  225. }
  226. return !0
  227. }
  228. function c(e, t, i, n) {
  229. this.left = w(e),
  230. this.top = w(t),
  231. this.width = w(i),
  232. this.height = w(n),
  233. this.right = this.left + this.width,
  234. this.bottom = this.top + this.height
  235. }
  236. function h(e, t, i, n) {
  237. this.visible = e || 0,
  238. this.viewport = t || 0,
  239. this.possible = i || 0,
  240. this.rects = n && I({}, n) || null
  241. }
  242. function r(e, t) {
  243. this.els = e,
  244. this.viewport = t
  245. }
  246. function n(e, t) {
  247. return e.val - t.val
  248. }
  249. function u(e, t) {
  250. return t.val - e.val
  251. }
  252. function d(e) {
  253. var t = c.ofContent(e, !0)
  254. , i = c.ofViewport(e, !0)
  255. , n = t.width - i.width
  256. , r = t.height - i.height;
  257. this.content = t,
  258. this.viewport = i,
  259. this.width = n <= 0 ? null : i.left / n,
  260. this.height = r <= 0 ? null : i.top / r,
  261. this.left = i.left,
  262. this.top = i.top,
  263. this.right = t.right - i.right,
  264. this.bottom = t.bottom - i.bottom
  265. }
  266. function p(e) {
  267. this.el = e || window
  268. }
  269. function f(e, t) {
  270. this.context = e,
  271. this.viewport = t,
  272. this.init()
  273. }
  274. function g(e, t, i, n) {
  275. this.context = new r(e,t),
  276. this.property = i,
  277. this.descending = n,
  278. this.init()
  279. }
  280. function m(e) {
  281. e && e !== window && e !== document ? (this.context = e,
  282. this.$autoTarget = y(e)) : this.context = window,
  283. this.init()
  284. }
  285. var i, v, y = jQuery, A = y(window), C = y(document), I = y.extend, E = y.isFunction, _ = Math.max, b = Math.min, w = Math.round, T = (i = {},
  286. v = 1,
  287. function(e) {
  288. return e ? (i[e] || (i[e] = v,
  289. v += 1),
  290. i[e]) : 0
  291. }
  292. );
  293. I(c.prototype, {
  294. equals: function(e) {
  295. return t(this, e, ["left", "top", "width", "height"])
  296. },
  297. area: function() {
  298. return this.width * this.height
  299. },
  300. relativeTo: function(e) {
  301. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  302. },
  303. intersection: function(e) {
  304. if (!a(e, c))
  305. return null;
  306. var t = _(this.left, e.left)
  307. , i = b(this.right, e.right)
  308. , n = _(this.top, e.top)
  309. , r = i - t
  310. , o = b(this.bottom, e.bottom) - n;
  311. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  312. },
  313. envelope: function(e) {
  314. if (!a(e, c))
  315. return this;
  316. var t = b(this.left, e.left)
  317. , i = _(this.right, e.right)
  318. , n = b(this.top, e.top);
  319. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  320. }
  321. }),
  322. I(c, {
  323. ofContent: function(e, t) {
  324. return e && e !== document && e !== window ? t ? new c(0,0,e.scrollWidth,e.scrollHeight) : new c(e.offsetLeft - e.scrollLeft,e.offsetTop - e.scrollTop,e.scrollWidth,e.scrollHeight) : new c(0,0,C.width(),C.height())
  325. },
  326. ofViewport: function(e, t) {
  327. return e && e !== document && e !== window ? t ? new c(e.scrollLeft,e.scrollTop,e.clientWidth,e.clientHeight) : new c(e.offsetLeft,e.offsetTop,e.clientWidth,e.clientHeight) : new c(A.scrollLeft(),A.scrollTop(),A.width(),A.height())
  328. },
  329. ofElement: function(e) {
  330. var t = y(e);
  331. if (!t.is(":visible"))
  332. return null;
  333. var i = t.offset();
  334. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  335. }
  336. }),
  337. I(h.prototype, {
  338. equals: function(e) {
  339. return this.fracsEqual(e) && this.rectsEqual(e)
  340. },
  341. fracsEqual: function(e) {
  342. return t(this, e, ["visible", "viewport", "possible"])
  343. },
  344. rectsEqual: function(e) {
  345. return t(this.rects, e.rects, ["document", "element", "viewport"])
  346. }
  347. }),
  348. I(h, {
  349. of: function(e, t) {
  350. var i, n, r;
  351. return e = s(e) && c.ofElement(e) || e,
  352. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  353. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  354. r = b(e.width, t.width) * b(e.height, t.height),
  355. new h(n / e.area(),n / t.area(),n / r,{
  356. document: i,
  357. element: i.relativeTo(e),
  358. viewport: i.relativeTo(t)
  359. })) : new h
  360. }
  361. });
  362. var x = ["width", "height", "left", "right", "top", "bottom"]
  363. , S = ["possible", "visible", "viewport"];
  364. I(r.prototype, {
  365. sorted: function(t, e) {
  366. var i = this.viewport;
  367. return y.map(this.els, function(e) {
  368. return {
  369. el: e,
  370. val: function(e, t, i) {
  371. var n;
  372. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  373. n ? n[i] : 0
  374. }(e, i, t)
  375. }
  376. }).sort(e ? u : n)
  377. },
  378. best: function(e, t) {
  379. return this.els.length ? this.sorted(e, t)[0] : null
  380. }
  381. }),
  382. I(d.prototype, {
  383. equals: function(e) {
  384. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  385. }
  386. }),
  387. I(p.prototype, {
  388. equals: function(e) {
  389. return t(this, e, ["el"])
  390. },
  391. scrollState: function() {
  392. return new d(this.el)
  393. },
  394. scrollTo: function(e, t, i) {
  395. var n = y(this.el === window ? "html,body" : this.el);
  396. e = e || 0,
  397. t = t || 0,
  398. i = isNaN(i) ? 1e3 : i,
  399. n.stop(!0).animate({
  400. scrollLeft: e,
  401. scrollTop: t
  402. }, i)
  403. },
  404. scroll: function(e, t, i) {
  405. var n = this.el === window ? A : y(this.el);
  406. e = e || 0,
  407. t = t || 0,
  408. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  409. },
  410. scrollToRect: function(e, t, i, n) {
  411. t = t || 0,
  412. i = i || 0,
  413. this.scrollTo(e.left - t, e.top - i, n)
  414. },
  415. scrollToElement: function(e, t, i, n) {
  416. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  417. this.scrollToRect(r, t, i, n)
  418. }
  419. });
  420. var M = {
  421. init: function() {
  422. this.callbacks = y.Callbacks("memory unique"),
  423. this.currVal = null,
  424. this.prevVal = null,
  425. this.checkProxy = y.proxy(this.check, this),
  426. this.autoCheck()
  427. },
  428. bind: function(e) {
  429. this.callbacks.add(e)
  430. },
  431. unbind: function(e) {
  432. e ? this.callbacks.remove(e) : this.callbacks.empty()
  433. },
  434. trigger: function() {
  435. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  436. },
  437. check: function(e) {
  438. var t = this.updatedValue(e);
  439. return void 0 !== t && (this.prevVal = this.currVal,
  440. this.currVal = t,
  441. this.trigger(),
  442. !0)
  443. },
  444. $autoTarget: A,
  445. autoEvents: "load resize scroll",
  446. autoCheck: function(e) {
  447. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  448. }
  449. };
  450. I(f.prototype, M, {
  451. updatedValue: function() {
  452. var e = h.of(this.context, this.viewport);
  453. return this.currVal && this.currVal.equals(e) ? void 0 : e
  454. }
  455. }),
  456. I(g.prototype, M, {
  457. updatedValue: function() {
  458. var e = this.context.best(this.property, this.descending);
  459. return e && (e = 0 < e.val ? e.el : null,
  460. this.currVal !== e) ? e : void 0
  461. }
  462. }),
  463. I(m.prototype, M, {
  464. updatedValue: function() {
  465. var e = new d(this.context);
  466. return this.currVal && this.currVal.equals(e) ? void 0 : e
  467. }
  468. });
  469. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  470. function H(e, t, i, n) {
  471. return i = N(i) ? i.apply(e, t) : i,
  472. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  473. }
  474. R = U,
  475. P = {
  476. statics: {
  477. version: "0.15.0",
  478. Rect: c,
  479. Fractions: h,
  480. Group: r,
  481. ScrollState: d,
  482. Viewport: p,
  483. FracsCallbacks: f,
  484. GroupCallbacks: g,
  485. ScrollStateCallbacks: m,
  486. fracs: function(e, t) {
  487. return h.of(e, t)
  488. }
  489. },
  490. methods: {
  491. content: function(e) {
  492. return this.length ? c.ofContent(this[0], e) : null
  493. },
  494. envelope: function() {
  495. return e(this, function(e) {
  496. var t = c.ofElement(this);
  497. return e ? e.envelope(t) : t
  498. })
  499. },
  500. fracs: function(e, i, n) {
  501. o(e, "string") || (n = i,
  502. i = e,
  503. e = null),
  504. E(i) || (n = i,
  505. i = null),
  506. n = l(n);
  507. var r = U + ".fracs." + T(n);
  508. return "unbind" === e ? this.each(function() {
  509. var e = y(this).data(r);
  510. e && e.unbind(i)
  511. }) : "check" === e ? this.each(function() {
  512. var e = y(this).data(r);
  513. e && e.check()
  514. }) : E(i) ? this.each(function() {
  515. var e = y(this)
  516. , t = e.data(r);
  517. t || (t = new f(this,n),
  518. e.data(r, t)),
  519. t.bind(i)
  520. }) : this.length ? h.of(this[0], n) : null
  521. },
  522. intersection: function() {
  523. return e(this, function(e) {
  524. var t = c.ofElement(this);
  525. return e ? e.intersection(t) : t
  526. })
  527. },
  528. max: function(e, t, i) {
  529. return E(t) || (i = t,
  530. t = null),
  531. i = l(i),
  532. t ? (new g(this,i,e,!0).bind(t),
  533. this) : this.pushStack(new r(this,i).best(e, !0).el)
  534. },
  535. min: function(e, t, i) {
  536. return E(t) || (i = t,
  537. t = null),
  538. i = l(i),
  539. t ? (new g(this,i,e).bind(t),
  540. this) : this.pushStack(new r(this,i).best(e).el)
  541. },
  542. rect: function() {
  543. return this.length ? c.ofElement(this[0]) : null
  544. },
  545. scrollState: function(e, i) {
  546. var n = U + ".scrollState";
  547. return o(e, "string") || (i = e,
  548. e = null),
  549. "unbind" === e ? this.each(function() {
  550. var e = y(this).data(n);
  551. e && e.unbind(i)
  552. }) : "check" === e ? this.each(function() {
  553. var e = y(this).data(n);
  554. e && e.check()
  555. }) : E(i) ? this.each(function() {
  556. var e = y(this)
  557. , t = e.data(n);
  558. t || (t = new m(this),
  559. e.data(n, t)),
  560. t.bind(i)
  561. }) : this.length ? new d(this[0]) : null
  562. },
  563. scroll: function(e, t, i) {
  564. return this.each(function() {
  565. new p(this).scroll(e, t, i)
  566. })
  567. },
  568. scrollTo: function(e, t, i, n) {
  569. return y.isNumeric(e) && (n = i,
  570. i = t,
  571. t = e,
  572. e = null),
  573. e = l(e),
  574. this.each(function() {
  575. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  576. })
  577. },
  578. scrollToThis: function(e, t, i, n) {
  579. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  580. this
  581. },
  582. softLink: function(t, i, n, r) {
  583. return r = new p(l(r)),
  584. this.filter("a[href^=#]").each(function() {
  585. var e = y(this);
  586. e.on("click", function() {
  587. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  588. })
  589. })
  590. },
  591. sort: function(e, t, i) {
  592. return o(t, "boolean") || (i = t,
  593. t = null),
  594. i = l(i),
  595. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  596. return e.el
  597. }))
  598. },
  599. viewport: function(e) {
  600. return this.length ? c.ofViewport(this[0], e) : null
  601. }
  602. },
  603. defaultStatic: "fracs",
  604. defaultMethod: "fracs"
  605. },
  606. O = [].slice,
  607. L = jQuery,
  608. D = L.extend,
  609. N = L.isFunction,
  610. F = D({}, P),
  611. B = function() {
  612. return H(this, O.call(arguments), F.defaultStatic, B)
  613. }
  614. ,
  615. V = function(e) {
  616. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  617. }
  618. ,
  619. (k = function(e) {
  620. e && (D(B, e.statics),
  621. D(V, e.methods)),
  622. B.modplug = k
  623. }
  624. ).prev = {
  625. statics: L[R],
  626. methods: L.fn[R]
  627. },
  628. k(P),
  629. L[R] = B,
  630. L.fn[R] = V
  631. }(),
  632. "undefined" == typeof jQuery)
  633. throw new Error("Bootstrap's JavaScript requires jQuery");
  634. !function(m) {
  635. "use strict";
  636. function r(e, t) {
  637. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  638. this.init("tooltip", e, t)
  639. }
  640. r.VERSION = "3.2.0",
  641. r.DEFAULTS = {
  642. animation: !0,
  643. placement: "top",
  644. selector: !1,
  645. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  646. trigger: "hover focus",
  647. title: "",
  648. delay: 0,
  649. html: !1,
  650. container: !1,
  651. viewport: {
  652. selector: "body",
  653. padding: 0
  654. }
  655. },
  656. r.prototype.init = function(e, t, i) {
  657. this.enabled = !0,
  658. this.type = e,
  659. this.$element = m(t),
  660. this.options = this.getOptions(i),
  661. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  662. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  663. var o = n[r];
  664. if ("click" == o)
  665. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  666. else if ("manual" != o) {
  667. var a = "hover" == o ? "mouseenter" : "focusin"
  668. , s = "hover" == o ? "mouseleave" : "focusout";
  669. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  670. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  671. }
  672. }
  673. this.options.selector ? this._options = m.extend({}, this.options, {
  674. trigger: "manual",
  675. selector: ""
  676. }) : this.fixTitle()
  677. }
  678. ,
  679. r.prototype.getDefaults = function() {
  680. return r.DEFAULTS
  681. }
  682. ,
  683. r.prototype.getOptions = function(e) {
  684. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  685. show: e.delay,
  686. hide: e.delay
  687. }),
  688. e
  689. }
  690. ,
  691. r.prototype.getDelegateOptions = function() {
  692. var i = {}
  693. , n = this.getDefaults();
  694. return this._options && m.each(this._options, function(e, t) {
  695. n[e] != t && (i[e] = t)
  696. }),
  697. i
  698. }
  699. ,
  700. r.prototype.enter = function(e) {
  701. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  702. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  703. m(e.currentTarget).data("bs." + this.type, t)),
  704. clearTimeout(t.timeout),
  705. t.hoverState = "in",
  706. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  707. }
  708. ,
  709. r.prototype.leave = function(e) {
  710. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  711. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  712. m(e.currentTarget).data("bs." + this.type, t)),
  713. clearTimeout(t.timeout),
  714. t.hoverState = "out",
  715. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  716. "out" == t.hoverState && t.hide()
  717. }, t.options.delay.hide)) : t.hide()
  718. }
  719. ,
  720. r.prototype.show = function() {
  721. var e = m.Event("show.bs." + this.type);
  722. if (this.hasContent() && this.enabled) {
  723. this.$element.trigger(e);
  724. var t = m.contains(document.documentElement, this.$element[0]);
  725. if (e.isDefaultPrevented() || !t)
  726. return;
  727. var i = this
  728. , n = this.tip()
  729. , r = this.getUID(this.type);
  730. this.setContent(),
  731. n.attr("id", r),
  732. this.$element.attr("aria-describedby", r),
  733. this.options.animation && n.addClass("fade");
  734. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  735. , a = /\s?auto?\s?/i
  736. , s = a.test(o);
  737. s && (o = o.replace(a, "") || "top"),
  738. n.detach().css({
  739. top: 0,
  740. left: 0,
  741. display: "block"
  742. }).addClass(o).data("bs." + this.type, this),
  743. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  744. var l = this.getPosition()
  745. , c = n[0].offsetWidth
  746. , h = n[0].offsetHeight;
  747. if (s) {
  748. var u = o
  749. , d = this.$element.parent()
  750. , p = this.getPosition(d);
  751. o = "bottom" == o && l.top + l.height + h - p.scroll > p.height ? "top" : "top" == o && l.top - p.scroll - h < 0 ? "bottom" : "right" == o && l.right + c > p.width ? "left" : "left" == o && l.left - c < p.left ? "right" : o,
  752. n.removeClass(u).addClass(o)
  753. }
  754. var f = this.getCalculatedOffset(o, l, c, h);
  755. this.applyPlacement(f, o);
  756. var g = function() {
  757. i.$element.trigger("shown.bs." + i.type),
  758. i.hoverState = null
  759. };
  760. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  761. }
  762. }
  763. ,
  764. r.prototype.applyPlacement = function(e, t) {
  765. var i = this.tip()
  766. , n = i[0].offsetWidth
  767. , r = i[0].offsetHeight
  768. , o = parseInt(i.css("margin-top"), 10)
  769. , a = parseInt(i.css("margin-left"), 10);
  770. isNaN(o) && (o = 0),
  771. isNaN(a) && (a = 0),
  772. e.top = e.top + o,
  773. e.left = e.left + a,
  774. m.offset.setOffset(i[0], m.extend({
  775. using: function(e) {
  776. i.css({
  777. top: Math.round(e.top),
  778. left: Math.round(e.left)
  779. })
  780. }
  781. }, e), 0),
  782. i.addClass("in");
  783. var s = i[0].offsetWidth
  784. , l = i[0].offsetHeight;
  785. "top" == t && l != r && (e.top = e.top + r - l);
  786. var c = this.getViewportAdjustedDelta(t, e, s, l);
  787. c.left ? e.left += c.left : e.top += c.top;
  788. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  789. , u = c.left ? "left" : "top"
  790. , d = c.left ? "offsetWidth" : "offsetHeight";
  791. i.offset(e),
  792. this.replaceArrow(h, i[0][d], u)
  793. }
  794. ,
  795. r.prototype.replaceArrow = function(e, t, i) {
  796. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  797. }
  798. ,
  799. r.prototype.setContent = function() {
  800. var e = this.tip()
  801. , t = this.getTitle();
  802. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  803. e.removeClass("fade in top bottom left right")
  804. }
  805. ,
  806. r.prototype.hide = function() {
  807. function e() {
  808. "in" != t.hoverState && i.detach(),
  809. t.$element.trigger("hidden.bs." + t.type)
  810. }
  811. var t = this
  812. , i = this.tip()
  813. , n = m.Event("hide.bs." + this.type);
  814. if (this.$element.removeAttr("aria-describedby"),
  815. this.$element.trigger(n),
  816. !n.isDefaultPrevented())
  817. return i.removeClass("in"),
  818. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  819. this.hoverState = null,
  820. this
  821. }
  822. ,
  823. r.prototype.fixTitle = function() {
  824. var e = this.$element;
  825. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  826. }
  827. ,
  828. r.prototype.hasContent = function() {
  829. return this.getTitle()
  830. }
  831. ,
  832. r.prototype.getPosition = function(e) {
  833. var t = (e = e || this.$element)[0]
  834. , i = "BODY" == t.tagName;
  835. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  836. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  837. width: i ? m(window).width() : e.outerWidth(),
  838. height: i ? m(window).height() : e.outerHeight()
  839. }, i ? {
  840. top: 0,
  841. left: 0
  842. } : e.offset())
  843. }
  844. ,
  845. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  846. return "bottom" == e ? {
  847. top: t.top + t.height,
  848. left: t.left + t.width / 2 - i / 2
  849. } : "top" == e ? {
  850. top: t.top - n,
  851. left: t.left + t.width / 2 - i / 2
  852. } : "left" == e ? {
  853. top: t.top + t.height / 2 - n / 2,
  854. left: t.left - i
  855. } : {
  856. top: t.top + t.height / 2 - n / 2,
  857. left: t.left + t.width
  858. }
  859. }
  860. ,
  861. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  862. var r = {
  863. top: 0,
  864. left: 0
  865. };
  866. if (!this.$viewport)
  867. return r;
  868. var o = this.options.viewport && this.options.viewport.padding || 0
  869. , a = this.getPosition(this.$viewport);
  870. if (/right|left/.test(e)) {
  871. var s = t.top - o - a.scroll
  872. , l = t.top + o - a.scroll + n;
  873. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  874. } else {
  875. var c = t.left - o
  876. , h = t.left + o + i;
  877. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  878. }
  879. return r
  880. }
  881. ,
  882. r.prototype.getTitle = function() {
  883. var e = this.$element
  884. , t = this.options;
  885. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  886. }
  887. ,
  888. r.prototype.getUID = function(e) {
  889. for (; e += ~~(1e6 * Math.random()),
  890. document.getElementById(e); )
  891. ;
  892. return e
  893. }
  894. ,
  895. r.prototype.tip = function() {
  896. return this.$tip = this.$tip || m(this.options.template)
  897. }
  898. ,
  899. r.prototype.arrow = function() {
  900. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  901. }
  902. ,
  903. r.prototype.validate = function() {
  904. this.$element[0].parentNode || (this.hide(),
  905. this.$element = null,
  906. this.options = null)
  907. }
  908. ,
  909. r.prototype.enable = function() {
  910. this.enabled = !0
  911. }
  912. ,
  913. r.prototype.disable = function() {
  914. this.enabled = !1
  915. }
  916. ,
  917. r.prototype.toggleEnabled = function() {
  918. this.enabled = !this.enabled
  919. }
  920. ,
  921. r.prototype.toggle = function(e) {
  922. var t = this;
  923. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  924. m(e.currentTarget).data("bs." + this.type, t))),
  925. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  926. }
  927. ,
  928. r.prototype.destroy = function() {
  929. clearTimeout(this.timeout),
  930. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  931. }
  932. ;
  933. var e = m.fn.tooltip;
  934. m.fn.tooltip = function(n) {
  935. return this.each(function() {
  936. var e = m(this)
  937. , t = e.data("bs.tooltip")
  938. , i = "object" == typeof n && n;
  939. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  940. "string" == typeof n && t[n]())
  941. })
  942. }
  943. ,
  944. m.fn.tooltip.Constructor = r,
  945. m.fn.tooltip.noConflict = function() {
  946. return m.fn.tooltip = e,
  947. this
  948. }
  949. }(jQuery),
  950. function(e, t, i) {
  951. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  952. }(0, this, function() {
  953. "use strict";
  954. function Keen() {
  955. return _init.apply(this, arguments)
  956. }
  957. function _init(e) {
  958. if (_isUndefined(e))
  959. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  960. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  961. throw new Error("Please provide a projectId");
  962. this.configure(e)
  963. }
  964. function _extend(e) {
  965. for (var t = 1; t < arguments.length; t++)
  966. for (var i in arguments[t])
  967. e[i] = arguments[t][i];
  968. return e
  969. }
  970. function _isUndefined(e) {
  971. return void 0 === e
  972. }
  973. function _type(e) {
  974. var t = e && e.constructor ? e.constructor.toString() : void 0;
  975. return t ? t.match(/function (.*)\(/)[1] : "Null"
  976. }
  977. function _each(e, t, i) {
  978. var n;
  979. if (!e)
  980. return 0;
  981. if (i = i || e,
  982. "array" === _type(e)) {
  983. for (n = 0; n < e.length; n++)
  984. if (!1 === t.call(i, e[n], n, e))
  985. return 0
  986. } else
  987. for (n in e)
  988. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  989. return 0;
  990. return 1
  991. }
  992. function _parse_params(e) {
  993. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  994. return decodeURIComponent(e.replace(n, " "))
  995. }, a = e.split("?")[1]; t = r.exec(a); )
  996. i[o(t[1])] = o(t[2]);
  997. return i
  998. }
  999. function _set_protocol(e) {
  1000. switch (e) {
  1001. case "http":
  1002. return "http";
  1003. case "auto":
  1004. return location.protocol.replace(/:/g, "");
  1005. case "https":
  1006. case void 0:
  1007. default:
  1008. return "https"
  1009. }
  1010. }
  1011. function _set_request_type(e) {
  1012. var t = e || "jsonp"
  1013. , i = !1;
  1014. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  1015. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  1016. }
  1017. function _build_url(e) {
  1018. return this.client.endpoint + "/projects/" + this.client.projectId + e
  1019. }
  1020. function _uploadEvent(e, t, i, n, r) {
  1021. var o = _build_url.apply(this, ["/events/" + e])
  1022. , a = {};
  1023. for (var s in i = !1 !== i,
  1024. this.client.globalProperties && (a = this.client.globalProperties(e)),
  1025. t)
  1026. t.hasOwnProperty(s) && (a[s] = t[s]);
  1027. switch (this.client.requestType) {
  1028. case "xhr":
  1029. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  1030. break;
  1031. case "jsonp":
  1032. var l = JSON.stringify(a)
  1033. , c = Keen.Base64.encode(l);
  1034. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  1035. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  1036. break;
  1037. case "beacon":
  1038. l = JSON.stringify(a),
  1039. c = Keen.Base64.encode(l);
  1040. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  1041. o += "&c=clv1",
  1042. _request.beacon.apply(this, [o, null, n, r])
  1043. }
  1044. }
  1045. Keen.prototype.configure = function(e) {
  1046. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  1047. e.protocol = _set_protocol(e.protocol),
  1048. e.requestType = _set_request_type(e.requestType),
  1049. this.client = {
  1050. projectId: e.projectId,
  1051. writeKey: e.writeKey,
  1052. readKey: e.readKey,
  1053. globalProperties: null,
  1054. endpoint: e.protocol + "://" + e.host,
  1055. requestType: e.requestType
  1056. },
  1057. Keen.trigger("client", this, e),
  1058. this.trigger("ready"),
  1059. this
  1060. }
  1061. ;
  1062. var _request = {
  1063. xhr: function(e, t, i, n, r, o, a, s) {
  1064. if (!r)
  1065. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1066. var l = new XMLHttpRequest;
  1067. if (l.onreadystatechange = function() {
  1068. if (4 == l.readyState)
  1069. if (200 <= l.status && l.status < 300) {
  1070. var e;
  1071. try {
  1072. e = JSON.parse(l.responseText)
  1073. } catch (e) {
  1074. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  1075. s && s(l, e)
  1076. }
  1077. a && e && a(e)
  1078. } else
  1079. Keen.log("HTTP request failed."),
  1080. s && s(l, null)
  1081. }
  1082. ,
  1083. l.open(e, t, o),
  1084. r && l.setRequestHeader("Authorization", r),
  1085. n && l.setRequestHeader("Content-Type", "application/json"),
  1086. i)
  1087. for (var c in i)
  1088. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  1089. var h = n ? JSON.stringify(n) : null;
  1090. l.send(h)
  1091. },
  1092. jsonp: function(e, t, i, n) {
  1093. if (!t)
  1094. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1095. if (t && e.indexOf("api_key") < 0) {
  1096. var r = 0 < e.indexOf("?") ? "&" : "?";
  1097. e = e + r + "api_key=" + t
  1098. }
  1099. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  1100. o += "a";
  1101. var a = !1;
  1102. window[o] = function(e) {
  1103. a = !0,
  1104. i && e && i(e),
  1105. window[o] = void 0
  1106. }
  1107. ,
  1108. e = e + "&jsonp=" + o;
  1109. var s = document.createElement("script");
  1110. s.id = "keen-jsonp",
  1111. s.src = e,
  1112. document.getElementsByTagName("head")[0].appendChild(s),
  1113. s.onreadystatechange = function() {
  1114. !1 === a && "loaded" === this.readyState && (a = !0,
  1115. n && n())
  1116. }
  1117. ,
  1118. s.onerror = function() {
  1119. !1 === a && (a = !0,
  1120. n && n())
  1121. }
  1122. },
  1123. beacon: function(e, t, i, n) {
  1124. if (t && e.indexOf("api_key") < 0) {
  1125. var r = 0 < e.indexOf("?") ? "&" : "?";
  1126. e = e + r + "api_key=" + t
  1127. }
  1128. var o = document.createElement("img");
  1129. o.onload = function() {
  1130. if (!0,
  1131. "naturalHeight"in this) {
  1132. if (this.naturalHeight + this.naturalWidth === 0)
  1133. return void this.onerror()
  1134. } else if (this.width + this.height === 0)
  1135. return void this.onerror();
  1136. i && i({
  1137. created: !0
  1138. })
  1139. }
  1140. ,
  1141. o.onerror = function() {
  1142. !0,
  1143. n && n()
  1144. }
  1145. ,
  1146. o.src = e
  1147. }
  1148. }
  1149. , Events = Keen.Events = {
  1150. on: function(e, t) {
  1151. return this.listeners || (this.listeners = {}),
  1152. (this.listeners[e] || (this.listeners[e] = [])).push({
  1153. callback: t
  1154. }),
  1155. this
  1156. },
  1157. off: function(e, t) {
  1158. if (!e && !t)
  1159. return this.listeners = void 0,
  1160. delete this.listeners,
  1161. this;
  1162. for (var i = this.listeners[e] || [], n = i.length; n--; )
  1163. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  1164. t && 0 != i.length || (this.listeners[e] = void 0,
  1165. delete this.listeners[e]);
  1166. return this
  1167. },
  1168. trigger: function(e) {
  1169. if (!this.listeners)
  1170. return this;
  1171. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  1172. i[n].callback.apply(this, t);
  1173. return this
  1174. }
  1175. };
  1176. _extend(Keen.prototype, Events),
  1177. _extend(Keen, Events),
  1178. Keen.loaded = !0,
  1179. Keen.utils = {
  1180. each: _each,
  1181. extend: _extend,
  1182. parseParams: _parse_params
  1183. },
  1184. Keen.ready = function(e) {
  1185. Keen.loaded ? e() : Keen.on("ready", e)
  1186. }
  1187. ,
  1188. Keen.log = function(e) {
  1189. "object" == typeof console && console.log("[Keen IO]", e)
  1190. }
  1191. ;
  1192. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1193. Keen.prototype.addEvent = function() {
  1194. _uploadEvent.apply(this, arguments)
  1195. }
  1196. ,
  1197. Keen.prototype.addEventSync = function(e, t, i, n) {
  1198. _uploadEvent.apply(this, [e, t, !1, i, n])
  1199. }
  1200. ,
  1201. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1202. var o = e
  1203. , a = o.metaKey
  1204. , s = o.target
  1205. , l = !1
  1206. , c = function() {};
  1207. return void 0 === n && (n = 500),
  1208. "A" === s.nodeName ? c = function() {
  1209. a || l || (l = !0,
  1210. window.location = s.href)
  1211. }
  1212. : "FORM" === s.nodeName && (c = function() {
  1213. l || (l = !0,
  1214. s.submit())
  1215. }
  1216. ),
  1217. r && (c = function() {
  1218. l || (l = !0,
  1219. r())
  1220. }
  1221. ),
  1222. _uploadEvent.call(this, t, i, c, c),
  1223. setTimeout(function() {
  1224. c()
  1225. }, n),
  1226. !!a && void 0
  1227. }
  1228. ,
  1229. Keen.prototype.setGlobalProperties = function(e) {
  1230. if (!this.client)
  1231. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1232. if (!e || "function" != typeof e)
  1233. throw new Error("Invalid value for global properties: " + e);
  1234. this.client.globalProperties = e
  1235. }
  1236. ,
  1237. Keen.Base64 = {
  1238. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1239. encode: function(e) {
  1240. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1241. for (e = this.utf8.encode(e); c < e.length; )
  1242. t = e.charCodeAt(c++),
  1243. i = e.charCodeAt(c++),
  1244. n = e.charCodeAt(c++),
  1245. r = t >> 2,
  1246. o = (3 & t) << 4 | i >> 4,
  1247. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1248. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1249. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1250. return l
  1251. },
  1252. decode: function(e) {
  1253. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1254. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1255. t = c.indexOf(e.charAt(l++)),
  1256. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1257. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1258. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1259. return this.utf8.decode(s)
  1260. },
  1261. utf8: {
  1262. encode: function(e) {
  1263. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1264. i += (t = e.charCodeAt(n++)) < 128 ? r(t) : 127 < t && t < 2048 ? r(t >> 6 | 192) + r(63 & t | 128) : r(t >> 12 | 224) + r(t >> 6 & 63 | 128) + r(63 & t | 128);
  1265. return i
  1266. },
  1267. decode: function(e) {
  1268. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1269. i += (t = e.charCodeAt(n)) < 128 ? [r(t), n++][0] : 191 < t && t < 224 ? [r((31 & t) << 6 | 63 & e.charCodeAt(n + 1)), n += 2][0] : [r((15 & t) << 12 | (63 & e.charCodeAt(n + 1)) << 6 | 63 & (c3 = e.charCodeAt(n + 2))), n += 3][0];
  1270. return i
  1271. }
  1272. }
  1273. },
  1274. "object" != typeof JSON && (JSON = {}),
  1275. function() {
  1276. function f(e) {
  1277. return e < 10 ? "0" + e : e
  1278. }
  1279. function quote(e) {
  1280. return escapable.lastIndex = 0,
  1281. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1282. var t = meta[e];
  1283. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1284. }) + '"' : '"' + e + '"'
  1285. }
  1286. function str(e, t) {
  1287. var i, n, r, o, a, s = gap, l = t[e];
  1288. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1289. "function" == typeof rep && (l = rep.call(t, e, l)),
  1290. typeof l) {
  1291. case "string":
  1292. return quote(l);
  1293. case "number":
  1294. return isFinite(l) ? String(l) : "null";
  1295. case "boolean":
  1296. case "null":
  1297. return String(l);
  1298. case "object":
  1299. if (!l)
  1300. return "null";
  1301. if (gap += indent,
  1302. a = [],
  1303. "[object Array]" === Object.prototype.toString.apply(l)) {
  1304. for (o = l.length,
  1305. i = 0; i < o; i += 1)
  1306. a[i] = str(i, l) || "null";
  1307. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1308. gap = s,
  1309. r
  1310. }
  1311. if (rep && "object" == typeof rep)
  1312. for (o = rep.length,
  1313. i = 0; i < o; i += 1)
  1314. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1315. else
  1316. for (n in l)
  1317. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1318. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1319. gap = s,
  1320. r
  1321. }
  1322. }
  1323. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1324. 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
  1325. }
  1326. ,
  1327. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1328. return this.valueOf()
  1329. }
  1330. );
  1331. 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 = {
  1332. "\b": "\\b",
  1333. "\t": "\\t",
  1334. "\n": "\\n",
  1335. "\f": "\\f",
  1336. "\r": "\\r",
  1337. '"': '\\"',
  1338. "\\": "\\\\"
  1339. }, rep;
  1340. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1341. var n;
  1342. if (indent = gap = "",
  1343. "number" == typeof i)
  1344. for (n = 0; n < i; n += 1)
  1345. indent += " ";
  1346. else
  1347. "string" == typeof i && (indent = i);
  1348. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1349. throw new Error("JSON.stringify");
  1350. return str("", {
  1351. "": e
  1352. })
  1353. }
  1354. ),
  1355. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1356. function walk(e, t) {
  1357. var i, n, r = e[t];
  1358. if (r && "object" == typeof r)
  1359. for (i in r)
  1360. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1361. return reviver.call(e, t, r)
  1362. }
  1363. var j;
  1364. if (text = String(text),
  1365. cx.lastIndex = 0,
  1366. cx.test(text) && (text = text.replace(cx, function(e) {
  1367. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1368. })),
  1369. /^[\],:{}\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, "")))
  1370. return j = eval("(" + text + ")"),
  1371. "function" == typeof reviver ? walk({
  1372. "": j
  1373. }, "") : j;
  1374. throw new SyntaxError("JSON.parse")
  1375. }
  1376. )
  1377. }(),
  1378. Hh = Keen.utils,
  1379. Ih = function(i) {
  1380. function e(e) {
  1381. for (u = 1; e = n.shift(); )
  1382. e()
  1383. }
  1384. var t, n = [], r = document, o = r.documentElement, a = o.doScroll, s = "DOMContentLoaded", l = "addEventListener", c = "onreadystatechange", h = "readyState", u = (a ? /^loaded|^c/ : /^loaded|c/).test(r[h]);
  1385. return r[l] && r[l](s, t = function() {
  1386. r.removeEventListener(s, t, !1),
  1387. e()
  1388. }
  1389. , !1),
  1390. a && r.attachEvent(c, t = function() {
  1391. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1392. e())
  1393. }
  1394. ),
  1395. i = a ? function(t) {
  1396. self != top ? u ? t() : n.push(t) : function() {
  1397. try {
  1398. o.doScroll("left")
  1399. } catch (e) {
  1400. return setTimeout(function() {
  1401. i(t)
  1402. }, 50)
  1403. }
  1404. t()
  1405. }()
  1406. }
  1407. : function(e) {
  1408. u ? e() : n.push(e)
  1409. }
  1410. }
  1411. ,
  1412. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1413. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1414. if (loaded && cached) {
  1415. for (var instance in clients = cached.clients || {},
  1416. ready = cached.ready || [],
  1417. clients)
  1418. if (clients.hasOwnProperty(instance)) {
  1419. var client = clients[instance];
  1420. for (var method in Keen.prototype)
  1421. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1422. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1423. ,
  1424. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1425. ,
  1426. client._config && (client.configure.call(client, client._config),
  1427. delete client._config),
  1428. client._setGlobalProperties) {
  1429. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1430. client.setGlobalProperties.apply(client, globals[i]);
  1431. delete client._setGlobalProperties
  1432. }
  1433. if (client._addEvent) {
  1434. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1435. client.addEvent.apply(client, queue[i]);
  1436. delete client._addEvent
  1437. }
  1438. var callback = client._on || [];
  1439. if (client._on) {
  1440. for (var i = 0; i < callback.length; i++)
  1441. client.on.apply(client, callback[i]);
  1442. client.trigger("ready"),
  1443. delete client._on
  1444. }
  1445. }
  1446. for (var i = 0; i < ready.length; i++) {
  1447. var callback = ready[i];
  1448. Keen.on("ready", function() {
  1449. callback()
  1450. })
  1451. }
  1452. }
  1453. return Keen.loaded && setTimeout(function() {
  1454. Keen.utils.domready(function() {
  1455. Keen.trigger("ready")
  1456. })
  1457. }, 0),
  1458. Keen
  1459. }),
  1460. function() {
  1461. var i = window.analytics = window.analytics || [];
  1462. if (!i.initialize) {
  1463. if (i.invoked)
  1464. return window.console && console.error && console.error("Segment snippet included twice.");
  1465. i.invoked = !0,
  1466. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1467. i.factory = function(t) {
  1468. return function() {
  1469. var e = Array.prototype.slice.call(arguments);
  1470. return e.unshift(t),
  1471. i.push(e),
  1472. i
  1473. }
  1474. }
  1475. ;
  1476. for (var e = 0; e < i.methods.length; e++) {
  1477. var t = i.methods[e];
  1478. i[t] = i.factory(t)
  1479. }
  1480. i.load = function(e) {
  1481. var t = document.createElement("script");
  1482. t.type = "text/javascript",
  1483. t.async = !0,
  1484. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1485. var i = document.getElementsByTagName("script")[0];
  1486. i.parentNode.insertBefore(t, i)
  1487. }
  1488. ,
  1489. i.SNIPPET_VERSION = "4.0.0"
  1490. }
  1491. }(),
  1492. function(i, u) {
  1493. "use strict";
  1494. var d = "function"
  1495. , p = "undefined"
  1496. , f = "object"
  1497. , e = "major"
  1498. , t = "model"
  1499. , n = "name"
  1500. , r = "type"
  1501. , o = "vendor"
  1502. , a = "version"
  1503. , s = "architecture"
  1504. , l = "console"
  1505. , c = "mobile"
  1506. , h = "tablet"
  1507. , g = {
  1508. has: function(e, t) {
  1509. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1510. },
  1511. lowerize: function(e) {
  1512. return e.toLowerCase()
  1513. }
  1514. }
  1515. , m = {
  1516. rgx: function() {
  1517. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1518. var c = l[s]
  1519. , h = l[s + 1];
  1520. if (typeof e == p)
  1521. for (n in e = {},
  1522. h)
  1523. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1524. for (t = i = 0; t < c.length; t++)
  1525. if (o = c[t].exec(this.getUA())) {
  1526. for (n = 0; n < h.length; n++)
  1527. a = o[++i],
  1528. typeof (r = h[n]) == f && 0 < r.length ? 2 == r.length ? typeof r[1] == d ? e[r[0]] = r[1].call(this, a) : e[r[0]] = r[1] : 3 == r.length ? typeof r[1] != d || r[1].exec && r[1].test ? e[r[0]] = a ? a.replace(r[1], r[2]) : u : e[r[0]] = a ? r[1].call(this, a, r[2]) : u : 4 == r.length && (e[r[0]] = a ? r[3].call(this, a.replace(r[1], r[2])) : u) : e[r] = a || u;
  1529. break
  1530. }
  1531. if (o)
  1532. break
  1533. }
  1534. return e
  1535. },
  1536. str: function(e, t) {
  1537. for (var i in t)
  1538. if (typeof t[i] == f && 0 < t[i].length) {
  1539. for (var n = 0; n < t[i].length; n++)
  1540. if (g.has(t[i][n], e))
  1541. return "?" === i ? u : i
  1542. } else if (g.has(t[i], e))
  1543. return "?" === i ? u : i;
  1544. return e
  1545. }
  1546. }
  1547. , v = {
  1548. browser: {
  1549. oldsafari: {
  1550. major: {
  1551. 1: ["/8", "/1", "/3"],
  1552. 2: "/4",
  1553. "?": "/"
  1554. },
  1555. version: {
  1556. "1.0": "/8",
  1557. 1.2: "/1",
  1558. 1.3: "/3",
  1559. "2.0": "/412",
  1560. "2.0.2": "/416",
  1561. "2.0.3": "/417",
  1562. "2.0.4": "/419",
  1563. "?": "/"
  1564. }
  1565. }
  1566. },
  1567. device: {
  1568. sprint: {
  1569. model: {
  1570. "Evo Shift 4G": "7373KT"
  1571. },
  1572. vendor: {
  1573. HTC: "APA",
  1574. Sprint: "Sprint"
  1575. }
  1576. }
  1577. },
  1578. os: {
  1579. windows: {
  1580. version: {
  1581. ME: "4.90",
  1582. "NT 3.11": "NT3.51",
  1583. "NT 4.0": "NT4.0",
  1584. 2e3: "NT 5.0",
  1585. XP: ["NT 5.1", "NT 5.2"],
  1586. Vista: "NT 6.0",
  1587. 7: "NT 6.1",
  1588. 8: "NT 6.2",
  1589. 8.1: "NT 6.3",
  1590. RT: "ARM"
  1591. }
  1592. }
  1593. }
  1594. }
  1595. , y = {
  1596. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [n, a, e], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[n, "Opera"], a, e], [/(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], [n, a, e], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[n, "IE"], a, e], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[n, "Yandex"], a, e], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[n, /_/g, " "], a, e], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [n, a, e], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[n, "Dolphin"], a, e], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[n, "Chrome"], a, e], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [a, e, [n, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [a, e, n], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [n, [e, m.str, v.browser.oldsafari.major], [a, m.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [n, a, e], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[n, "Netscape"], a, e], [/(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], [n, a, e], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [n, a, e], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [n, a], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(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], [n, a, e], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(flrp)\/((\d+)[\w\.-]+)/i], [[n, "Flip Player"], a, e], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [n], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [n, a, e], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [n, a, e], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[n, /_/g, " "], a, e], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [n, a], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [n, a, e], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [n], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [n, a, e], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [n, a, e], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [n, a, e], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [n], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(smp)((\d+)[\d\.]+)/i], [n, a, e], [/(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], [n, a, e], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[n, /-/g, " "], a, e], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [a, e, [n, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [n, a, e], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[n, "rad.io"], a, e]],
  1597. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[s, "amd64"]], [/(ia32(?=;))/i], [[s, g.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[s, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[s, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[s, /ower/, "", g.lowerize]], [/(sun4\w)[;\)]/i], [[s, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [s, g.lowerize]],
  1598. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [t, o, [r, h]], [/applecoremedia\/[\w\.]+ \((ipad)/], [t, [o, "Apple"], [r, h]], [/(apple\s{0,1}tv)/i], [[t, "Apple TV"], [o, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [o, t, [r, h]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [t, o, [r, c]], [/\((ip[honed|\s\w*]+);/i], [t, [o, "Apple"], [r, c]], [/(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], [o, t, [r, c]], [/\((bb10);\s(\w+)/i], [[o, "BlackBerry"], t, [r, c]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[o, "Asus"], t, [r, h]], [/(sony)\s(tablet\s[ps])/i], [o, t, [r, h]], [/(nintendo)\s([wids3u]+)/i], [o, t, [r, l]], [/((playstation)\s[3portablevi]+)/i], [[o, "Sony"], t, [r, l]], [/(sprint\s(\w+))/i], [[o, m.str, v.device.sprint.vendor], [t, m.str, v.device.sprint.model], [r, c]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [o, [t, /_/g, " "], [r, c]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[o, "Motorola"], t, [r, c]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[o, "Motorola"], t, [r, h]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[o, "Samsung"], t, [r, h]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[o, "Samsung"], t, [r, c]], [/(sie)-(\w+)*/i], [[o, "Siemens"], t, [r, c]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[o, "Nokia"], t, [r, c]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[o, "Acer"], t, [r, h]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[o, "LG"], t, [r, h]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[o, "LG"], t, [r, c]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[o, "Lenovo"], t, [r, h]], [/(lg) netcast\.tv/i], [o, [r, "smarttv"]], [/(mobile|tablet);.+rv\:.+gecko\//i], [r, o, t]],
  1599. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [n, a], [/rv\:([\w\.]+).*(gecko)/i], [a, n]],
  1600. os: [[/microsoft\s(windows)\s(vista|xp)/i], [n, a], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [n, [a, m.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[n, "Windows"], [a, m.str, v.os.windows.version]], [/\((bb)(10);/i], [[n, "BlackBerry"], a], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [n, a], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[n, "Symbian"], a], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[n, "Firefox OS"], a], [/(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], [n, a], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[n, "Chromium OS"], a], [/(sunos)\s?([\w\.]+\d)*/i], [[n, "Solaris"], a], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [n, a], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[n, "iOS"], [a, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [n, [a, /_/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], [n, a]]
  1601. }
  1602. , A = function(e) {
  1603. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1604. return this instanceof A ? (this.getBrowser = function() {
  1605. return m.rgx.apply(this, y.browser)
  1606. }
  1607. ,
  1608. this.getCPU = function() {
  1609. return m.rgx.apply(this, y.cpu)
  1610. }
  1611. ,
  1612. this.getDevice = function() {
  1613. return m.rgx.apply(this, y.device)
  1614. }
  1615. ,
  1616. this.getEngine = function() {
  1617. return m.rgx.apply(this, y.engine)
  1618. }
  1619. ,
  1620. this.getOS = function() {
  1621. return m.rgx.apply(this, y.os)
  1622. }
  1623. ,
  1624. this.getResult = function() {
  1625. return {
  1626. ua: this.getUA(),
  1627. browser: this.getBrowser(),
  1628. engine: this.getEngine(),
  1629. os: this.getOS(),
  1630. device: this.getDevice(),
  1631. cpu: this.getCPU()
  1632. }
  1633. }
  1634. ,
  1635. this.getUA = function() {
  1636. return t
  1637. }
  1638. ,
  1639. this.setUA = function(e) {
  1640. return t = e,
  1641. this
  1642. }
  1643. ,
  1644. void this.setUA(t)) : new A(e).getResult()
  1645. };
  1646. if (typeof exports != p)
  1647. typeof module != p && module.exports && (exports = module.exports = A),
  1648. exports.UAParser = A;
  1649. else if (i.UAParser = A,
  1650. typeof define == d && define.amd && define(function() {
  1651. return A
  1652. }),
  1653. typeof i.jQuery != p) {
  1654. var C = i.jQuery
  1655. , I = new A;
  1656. C.ua = I.getResult(),
  1657. C.ua.get = function() {
  1658. return I.getUA()
  1659. }
  1660. ,
  1661. C.ua.set = function(e) {
  1662. I.setUA(e);
  1663. var t = I.getResult();
  1664. for (var i in t)
  1665. C.ua[i] = t[i]
  1666. }
  1667. }
  1668. }(this),
  1669. window.Modernizr = function(e, t) {
  1670. function i(e, t) {
  1671. return typeof e === t
  1672. }
  1673. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1674. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1675. return t in e && i(e.constructor.prototype[t], "undefined")
  1676. }
  1677. : function(e, t) {
  1678. return p.call(e, t)
  1679. }
  1680. ,
  1681. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1682. var r = this;
  1683. if ("function" != typeof r)
  1684. throw new TypeError;
  1685. var o = d.call(arguments, 1)
  1686. , a = function() {
  1687. if (this instanceof a) {
  1688. function e() {}
  1689. e.prototype = r.prototype;
  1690. var t = new e
  1691. , i = r.apply(t, o.concat(d.call(arguments)));
  1692. return Object(i) === i ? i : t
  1693. }
  1694. return r.apply(n, o.concat(d.call(arguments)))
  1695. };
  1696. return a
  1697. }
  1698. ),
  1699. h.webgl = function() {
  1700. return !!e.WebGLRenderingContext
  1701. }
  1702. ,
  1703. h)
  1704. r(h, f) && (n = f.toLowerCase(),
  1705. a[n] = h[f](),
  1706. u.push((a[n] ? "" : "no-") + n));
  1707. return a.addTest = function(e, t) {
  1708. if ("object" == typeof e)
  1709. for (var i in e)
  1710. r(e, i) && a.addTest(i, e[i]);
  1711. else {
  1712. if (e = e.toLowerCase(),
  1713. void 0 !== a[e])
  1714. return a;
  1715. t = "function" == typeof t ? t() : t,
  1716. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1717. a[e] = t
  1718. }
  1719. return a
  1720. }
  1721. ,
  1722. o = "",
  1723. c.cssText = o,
  1724. l = null,
  1725. a._version = "2.8.2",
  1726. a
  1727. }(this, this.document),
  1728. function(xe, e, Se) {
  1729. "use strict";
  1730. function Me(s, e, n) {
  1731. function a(e) {
  1732. var t = Q.length;
  1733. if (G.old = xe.extend({}, G),
  1734. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1735. Y = W[F.horizontal ? "width" : "height"](),
  1736. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1737. Q.length = 0,
  1738. G.start = 0,
  1739. G.end = nt(z - H, 0),
  1740. le) {
  1741. $.length,
  1742. J = U.children(F.itemSelector),
  1743. $.length = 0;
  1744. var h, u = Ne(U, F.horizontal ? "paddingLeft" : "paddingTop"), d = Ne(U, F.horizontal ? "paddingRight" : "paddingBottom"), i = "border-box" === xe(J).css("boxSizing"), p = "none" !== J.css("float"), f = 0, g = J.length - 1;
  1745. z = 0,
  1746. J.each(function(e, t) {
  1747. var i = xe(t)
  1748. , n = t.getBoundingClientRect()
  1749. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1750. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1751. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1752. , s = r + o + a
  1753. , l = !o || !a
  1754. , c = {};
  1755. c.el = t,
  1756. c.size = l ? r : s,
  1757. c.half = c.size / 2,
  1758. c.start = z + (l ? o : 0),
  1759. c.center = c.start - it(H / 2 - c.size / 2),
  1760. c.end = c.start - H + c.size,
  1761. e || (z += u),
  1762. z += s,
  1763. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1764. e === g && (c.end += d,
  1765. z += d,
  1766. f = l ? a : 0),
  1767. $.push(c),
  1768. h = c
  1769. }),
  1770. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1771. z -= f,
  1772. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1773. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1774. }
  1775. if (G.center = it(G.end / 2 + G.start / 2),
  1776. v(),
  1777. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1778. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1779. X.end = Y - q,
  1780. _e || c()),
  1781. !V && 0 < H) {
  1782. var n = G.start
  1783. , r = "";
  1784. if (le)
  1785. xe.each($, function(e, t) {
  1786. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1787. Q.push(n),
  1788. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1789. });
  1790. else
  1791. for (; n - H < G.end; )
  1792. Q.push(n),
  1793. n += H;
  1794. if (Z[0] && t !== Q.length) {
  1795. for (var o = 0; o < Q.length; o++)
  1796. r += F.pageBuilder.call(B, o);
  1797. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1798. }
  1799. }
  1800. if (ee.slideeSize = z,
  1801. ee.frameSize = H,
  1802. ee.sbSize = Y,
  1803. ee.handleSize = q,
  1804. le) {
  1805. e && null != F.startAt && (m(F.startAt),
  1806. B[se ? "toCenter" : "toStart"](F.startAt));
  1807. var a = $[ee.activeItem];
  1808. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1809. } else
  1810. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1811. L("load")
  1812. }
  1813. function l(e, t, i) {
  1814. if (le && Ie.released && !i) {
  1815. var n = d(e)
  1816. , r = e > G.start && e < G.end;
  1817. se ? (r && (e = $[n.centerItem].center),
  1818. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1819. }
  1820. Ie.init && Ie.slidee && F.elasticBounds ? e > G.end ? e = G.end + (e - G.end) / 6 : e < G.start && (e = G.start + (e - G.start) / 6) : e = Fe(e, G.start, G.end),
  1821. Ae.start = +new Date,
  1822. Ae.time = 0,
  1823. Ae.from = G.cur,
  1824. Ae.to = e,
  1825. Ae.delta = e - G.cur,
  1826. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1827. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1828. Ie.tweese = 0,
  1829. e !== G.dest && (G.dest = e,
  1830. L("change"),
  1831. _e || o()),
  1832. g(),
  1833. v(),
  1834. p(),
  1835. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1836. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1837. L("activePage", ye.page))
  1838. }
  1839. function o() {
  1840. if (B.initialized) {
  1841. if (!_e)
  1842. return _e = Ge(o),
  1843. void (Ie.released && L("moveStart"));
  1844. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1845. $e(Ae.tweeseDelta) < .1 ? G.cur = Ae.to : G.cur += Ae.tweeseDelta * (Ie.released ? F.swingSpeed : F.syncSpeed)) : (Ae.time = rt(+new Date - Ae.start, F.speed),
  1846. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1847. Ae.to === G.cur ? (G.cur = Ae.to,
  1848. Ie.tweese = _e = 0) : _e = Ge(o),
  1849. L("move"),
  1850. V || (Ve ? U[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + -G.cur + "px)" : U[0].style[F.horizontal ? "left" : "top"] = -it(G.cur) + "px"),
  1851. !_e && Ie.released && L("moveEnd"),
  1852. c()
  1853. }
  1854. }
  1855. function c() {
  1856. j.length && (X.cur = G.start === G.end ? 0 : ((Ie.init && !Ie.slidee ? G.dest : G.cur) - G.start) / (G.end - G.start) * X.end,
  1857. X.cur = Fe(it(X.cur), X.start, X.end),
  1858. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1859. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1860. }
  1861. function t() {
  1862. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1863. Te = Ie.init ? Ge(t) : 0,
  1864. Ce.now = +new Date,
  1865. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1866. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1867. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1868. Ce.lastTime = Ce.now
  1869. }
  1870. function i(e, t, i) {
  1871. if ("boolean" === Re(t) && (i = t,
  1872. t = Se),
  1873. t === Se)
  1874. l(G[e], i);
  1875. else {
  1876. if (se && "center" !== e)
  1877. return;
  1878. var n = B.getPos(t);
  1879. n && l(n[e], i, !se)
  1880. }
  1881. }
  1882. function h(e) {
  1883. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1884. }
  1885. function u(e) {
  1886. return h(De(e) && e < 0 ? e + $.length : e)
  1887. }
  1888. function m(e, t) {
  1889. var i = h(e);
  1890. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1891. J.eq(i).addClass(F.activeClass),
  1892. ye.active = ee.activeItem = i,
  1893. p(),
  1894. L("active", i)),
  1895. i)
  1896. }
  1897. function d(e) {
  1898. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1899. var t = {}
  1900. , i = ae ? 0 : H / 2;
  1901. if (!V)
  1902. for (var n = 0, r = Q.length; n < r; n++) {
  1903. if (e >= G.end || n === Q.length - 1) {
  1904. t.activePage = Q.length - 1;
  1905. break
  1906. }
  1907. if (e <= Q[n] + i) {
  1908. t.activePage = n;
  1909. break
  1910. }
  1911. }
  1912. if (le) {
  1913. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1914. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1915. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1916. l === c - 1 || e <= $[l].end + $[l].half) {
  1917. a = l;
  1918. break
  1919. }
  1920. t.firstItem = De(o) ? o : 0,
  1921. t.centerItem = De(s) ? s : t.firstItem,
  1922. t.lastItem = De(a) ? a : t.centerItem
  1923. }
  1924. return t
  1925. }
  1926. function v(e) {
  1927. xe.extend(ee, d(e))
  1928. }
  1929. function p() {
  1930. var e = G.dest <= G.start
  1931. , t = G.dest >= G.end
  1932. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1933. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1934. ge.is("button,input") && ge.prop("disabled", e),
  1935. me.is("button,input") && me.prop("disabled", t),
  1936. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1937. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1938. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1939. de.is("button,input") && de.prop("disabled", e),
  1940. ue.is("button,input") && ue.prop("disabled", t)),
  1941. le && null != ee.activeItem) {
  1942. var n = 0 === ee.activeItem
  1943. , r = ee.activeItem >= $.length - 1
  1944. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1945. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1946. pe.is("button,input") && pe.prop("disabled", n),
  1947. fe.is("button,input") && fe.prop("disabled", r),
  1948. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1949. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1950. }
  1951. }
  1952. function r(e, t, i) {
  1953. if (e = u(e),
  1954. t = u(t),
  1955. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1956. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1957. var n = e < t ? e : i ? t : t - 1
  1958. , r = t < e ? e : i ? t + 1 : t
  1959. , o = t < e;
  1960. null != ee.activeItem && (e === ee.activeItem ? ye.active = ee.activeItem = i ? o ? t + 1 : t : o ? t : t - 1 : ee.activeItem > n && ee.activeItem < r && (ye.active = ee.activeItem += o ? 1 : -1)),
  1961. a()
  1962. }
  1963. }
  1964. function f(e, t) {
  1965. for (var i = 0, n = ve[e].length; i < n; i++)
  1966. if (ve[e][i] === t)
  1967. return i;
  1968. return -1
  1969. }
  1970. function g() {
  1971. Ie.released && !B.isPaused && B.resume()
  1972. }
  1973. function y(e) {
  1974. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1975. }
  1976. function A() {
  1977. Ie.history[0] = Ie.history[1],
  1978. Ie.history[1] = Ie.history[2],
  1979. Ie.history[2] = Ie.history[3],
  1980. Ie.history[3] = Ie.delta
  1981. }
  1982. function C(e) {
  1983. Ie.released = 0,
  1984. Ie.source = e,
  1985. Ie.slidee = "slidee" === e
  1986. }
  1987. function I(e) {
  1988. var t = "touchstart" === e.type
  1989. , i = e.data.source
  1990. , n = "slidee" === i;
  1991. Ie.init || !t && b(e.target) || !("handle" !== i || F.dragHandle && X.start !== X.end) || n && !(t ? F.touchDragging : F.mouseDragging && e.which < 2) || (t || Pe(e),
  1992. C(i),
  1993. Ie.init = 0,
  1994. Ie.$source = xe(e.target),
  1995. Ie.touch = t,
  1996. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1997. Ie.initX = Ie.pointer.pageX,
  1998. Ie.initY = Ie.pointer.pageY,
  1999. Ie.initPos = n ? G.cur : X.cur,
  2000. Ie.start = +new Date,
  2001. Ie.time = 0,
  2002. Ie.path = 0,
  2003. Ie.delta = 0,
  2004. Ie.locked = 0,
  2005. Ie.history = [0, 0, 0, 0],
  2006. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  2007. We.on(t ? qe : Ye, E),
  2008. B.pause(1),
  2009. (n ? U : j).addClass(F.draggedClass),
  2010. L("moveStart"),
  2011. n && (be = setInterval(A, 10)))
  2012. }
  2013. function E(e) {
  2014. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  2015. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  2016. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  2017. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  2018. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  2019. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  2020. Ie.released || !(Ie.path < 1)) {
  2021. if (!Ie.init) {
  2022. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  2023. return _();
  2024. Ie.init = 1
  2025. }
  2026. Pe(e),
  2027. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  2028. Ie.$source.on(Ze, Oe)),
  2029. Ie.released && (_(),
  2030. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  2031. Ie.delta += Ie.swing,
  2032. Ie.tweese = 10 < $e(Ie.swing))),
  2033. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  2034. }
  2035. }
  2036. function _() {
  2037. clearInterval(be),
  2038. Ie.released = !0,
  2039. We.off(Ie.touch ? qe : Ye, E),
  2040. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  2041. setTimeout(function() {
  2042. Ie.$source.off(Ze, Oe)
  2043. }),
  2044. G.cur === G.dest && Ie.init && L("moveEnd"),
  2045. B.resume(1),
  2046. Ie.init = 0
  2047. }
  2048. function b(e) {
  2049. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  2050. }
  2051. function w() {
  2052. B.stop(),
  2053. We.off("mouseup", w)
  2054. }
  2055. function T(e) {
  2056. switch (Pe(e),
  2057. this) {
  2058. case ue[0]:
  2059. case de[0]:
  2060. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  2061. We.on("mouseup", w);
  2062. break;
  2063. case pe[0]:
  2064. B.prev();
  2065. break;
  2066. case fe[0]:
  2067. B.next();
  2068. break;
  2069. case ge[0]:
  2070. B.prevPage();
  2071. break;
  2072. case me[0]:
  2073. B.nextPage()
  2074. }
  2075. }
  2076. function x(e) {
  2077. e.originalEvent[He] = B;
  2078. var t = +new Date;
  2079. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  2080. ot = t;
  2081. else if (F.scrollBy && G.start !== G.end) {
  2082. var i = function(e) {
  2083. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  2084. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  2085. le ? (Ue = +new Date,
  2086. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  2087. Ee.last = Ue,
  2088. Ee.delta += Ee.curDelta,
  2089. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  2090. Ee.delta %= 1),
  2091. Ee.finalDelta) : Ee.curDelta
  2092. }(e.originalEvent);
  2093. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  2094. B.slideBy(F.scrollBy * i)
  2095. }
  2096. }
  2097. function S(e) {
  2098. F.clickBar && e.target === W[0] && (Pe(e),
  2099. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  2100. }
  2101. function M(e) {
  2102. if (F.keyboardNavBy)
  2103. switch (e.which) {
  2104. case F.horizontal ? 37 : 38:
  2105. Pe(e),
  2106. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  2107. break;
  2108. case F.horizontal ? 39 : 40:
  2109. Pe(e),
  2110. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  2111. }
  2112. }
  2113. function R(e) {
  2114. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  2115. }
  2116. function P() {
  2117. this.parentNode === Z[0] && B.activatePage(K.index(this))
  2118. }
  2119. function O(e) {
  2120. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  2121. }
  2122. function L(e, t) {
  2123. if (ve[e]) {
  2124. for (N = ve[e].length,
  2125. Je.length = 0,
  2126. D = 0; D < N; D++)
  2127. Je.push(ve[e][D]);
  2128. for (D = 0; D < N; D++)
  2129. Je[D].call(B, e, t)
  2130. }
  2131. }
  2132. var D, N, F = xe.extend({}, Me.defaults, e), B = this, V = De(s), k = xe(s), U = F.slidee ? xe(F.slidee).eq(0) : k.children().eq(0), H = 0, z = 0, G = {
  2133. start: 0,
  2134. center: 0,
  2135. end: 0,
  2136. cur: 0,
  2137. dest: 0
  2138. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  2139. start: 0,
  2140. end: 0,
  2141. cur: 0
  2142. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  2143. firstItem: 0,
  2144. lastItem: 0,
  2145. centerItem: 0,
  2146. activeItem: null,
  2147. activePage: 0
  2148. }, te = new Be(k[0]), ie = new Be(U[0]), ne = new Be(W[0]), re = new Be(j[0]), oe = "basic" === F.itemNav, ae = "forceCentered" === F.itemNav, se = "centered" === F.itemNav || ae, le = !V && (oe || se || ae), ce = F.scrollSource ? xe(F.scrollSource) : k, he = F.dragSource ? xe(F.dragSource) : k, ue = xe(F.forward), de = xe(F.backward), pe = xe(F.prev), fe = xe(F.next), ge = xe(F.prevPage), me = xe(F.nextPage), ve = {}, ye = {}, Ae = {}, Ce = {}, Ie = {
  2149. released: 1
  2150. }, Ee = {
  2151. last: 0,
  2152. delta: 0,
  2153. resetTime: 200
  2154. }, _e = 0, be = 0, we = 0, Te = 0;
  2155. V || (s = k[0]),
  2156. B.initialized = 0,
  2157. B.frame = s,
  2158. B.slidee = U[0],
  2159. B.pos = G,
  2160. B.rel = ee,
  2161. B.items = $,
  2162. B.pages = Q,
  2163. B.isPaused = 0,
  2164. B.options = F,
  2165. B.dragging = Ie,
  2166. B.reload = function() {
  2167. a()
  2168. }
  2169. ,
  2170. B.getPos = function(e) {
  2171. if (le) {
  2172. var t = h(e);
  2173. return -1 !== t && $[t]
  2174. }
  2175. var i = U.find(e).eq(0);
  2176. if (i[0]) {
  2177. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  2178. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  2179. return {
  2180. start: n,
  2181. center: n - H / 2 + r / 2,
  2182. end: n - H + r,
  2183. size: r
  2184. }
  2185. }
  2186. return !1
  2187. }
  2188. ,
  2189. B.moveBy = function(e) {
  2190. Ce.speed = e,
  2191. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2192. Ce.startPos = G.cur,
  2193. C("button"),
  2194. Ie.init = 1,
  2195. L("moveStart"),
  2196. ze(Te),
  2197. t())
  2198. }
  2199. ,
  2200. B.stop = function() {
  2201. "button" === Ie.source && (Ie.init = 0,
  2202. Ie.released = 1)
  2203. }
  2204. ,
  2205. B.prev = function() {
  2206. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2207. }
  2208. ,
  2209. B.next = function() {
  2210. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2211. }
  2212. ,
  2213. B.prevPage = function() {
  2214. B.activatePage(ee.activePage - 1)
  2215. }
  2216. ,
  2217. B.nextPage = function() {
  2218. B.activatePage(ee.activePage + 1)
  2219. }
  2220. ,
  2221. B.slideBy = function(e, t) {
  2222. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2223. }
  2224. ,
  2225. B.slideTo = function(e, t) {
  2226. l(e, t)
  2227. }
  2228. ,
  2229. B.toStart = function(e, t) {
  2230. i("start", e, t)
  2231. }
  2232. ,
  2233. B.toEnd = function(e, t) {
  2234. i("end", e, t)
  2235. }
  2236. ,
  2237. B.toCenter = function(e, t) {
  2238. i("center", e, t)
  2239. }
  2240. ,
  2241. B.getIndex = h,
  2242. B.activate = function(e, t) {
  2243. var i = m(e);
  2244. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2245. }
  2246. ,
  2247. B.activatePage = function(e, t) {
  2248. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2249. }
  2250. ,
  2251. B.resume = function(e) {
  2252. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2253. we ? we = clearTimeout(we) : L("resume"),
  2254. we = setTimeout(function() {
  2255. switch (L("cycle"),
  2256. F.cycleBy) {
  2257. case "items":
  2258. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2259. break;
  2260. case "pages":
  2261. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2262. }
  2263. }, F.cycleInterval))
  2264. }
  2265. ,
  2266. B.pause = function(e) {
  2267. e < B.isPaused || (B.isPaused = e || 100,
  2268. we && (we = clearTimeout(we),
  2269. L("pause")))
  2270. }
  2271. ,
  2272. B.toggle = function() {
  2273. B[we ? "pause" : "resume"]()
  2274. }
  2275. ,
  2276. B.set = function(e, t) {
  2277. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2278. }
  2279. ,
  2280. B.add = function(e, t) {
  2281. var i = xe(e);
  2282. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2283. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2284. a()
  2285. }
  2286. ,
  2287. B.remove = function(e) {
  2288. if (le) {
  2289. var t = u(e);
  2290. if (-1 < t) {
  2291. J.eq(t).remove();
  2292. var i = t === ee.activeItem;
  2293. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2294. a(),
  2295. i && (ye.active = null,
  2296. B.activate(ee.activeItem))
  2297. }
  2298. } else
  2299. xe(e).remove(),
  2300. a()
  2301. }
  2302. ,
  2303. B.moveAfter = function(e, t) {
  2304. r(e, t, 1)
  2305. }
  2306. ,
  2307. B.moveBefore = function(e, t) {
  2308. r(e, t)
  2309. }
  2310. ,
  2311. B.on = function(e, t) {
  2312. if ("object" === Re(e))
  2313. for (var i in e)
  2314. e.hasOwnProperty(i) && B.on(i, e[i]);
  2315. else if ("function" === Re(t))
  2316. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2317. ve[n[r]] = ve[n[r]] || [],
  2318. -1 === f(n[r], t) && ve[n[r]].push(t);
  2319. else if ("array" === Re(t))
  2320. for (var a = 0, s = t.length; a < s; a++)
  2321. B.on(e, t[a])
  2322. }
  2323. ,
  2324. B.one = function(t, i) {
  2325. B.on(t, function e() {
  2326. i.apply(B, arguments),
  2327. B.off(t, e)
  2328. })
  2329. }
  2330. ,
  2331. B.off = function(e, t) {
  2332. if (t instanceof Array)
  2333. for (var i = 0, n = t.length; i < n; i++)
  2334. B.off(e, t[i]);
  2335. else
  2336. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2337. if (ve[r[o]] = ve[r[o]] || [],
  2338. null == t)
  2339. ve[r[o]].length = 0;
  2340. else {
  2341. var s = f(r[o], t);
  2342. -1 !== s && ve[r[o]].splice(s, 1)
  2343. }
  2344. }
  2345. ,
  2346. B.destroy = function() {
  2347. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2348. We.off("keydown", M),
  2349. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2350. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2351. Z.empty(),
  2352. V || (k.off("." + He),
  2353. te.restore(),
  2354. ie.restore(),
  2355. ne.restore(),
  2356. re.restore(),
  2357. xe.removeData(s, He)),
  2358. $.length = Q.length = 0,
  2359. ye = {},
  2360. B.initialized = 0,
  2361. B
  2362. }
  2363. ,
  2364. B.init = function() {
  2365. if (!B.initialized) {
  2366. B.on(n);
  2367. var e = ["overflow", "position"]
  2368. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2369. te.save.apply(te, e),
  2370. ne.save.apply(ne, e),
  2371. ie.save.apply(ie, t),
  2372. re.save.apply(re, t);
  2373. var i = j;
  2374. return V || (i = i.add(U),
  2375. k.css("overflow", "hidden"),
  2376. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2377. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2378. i.css({
  2379. position: "absolute"
  2380. })),
  2381. F.forward && ue.on(Ke, T),
  2382. F.backward && de.on(Ke, T),
  2383. F.prev && pe.on(Ze, T),
  2384. F.next && fe.on(Ze, T),
  2385. F.prevPage && ge.on(Ze, T),
  2386. F.nextPage && me.on(Ze, T),
  2387. ce.on(Xe, x),
  2388. W[0] && W.on(Ze, S),
  2389. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2390. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2391. he.on(je, {
  2392. source: "slidee"
  2393. }, I),
  2394. j && j.on(je, {
  2395. source: "handle"
  2396. }, I),
  2397. We.on("keydown", M),
  2398. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2399. k.on("scroll." + He, Le)),
  2400. B.initialized = 1,
  2401. a(!0),
  2402. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2403. B
  2404. }
  2405. }
  2406. }
  2407. function Re(e) {
  2408. 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
  2409. }
  2410. function Pe(e, t) {
  2411. e.preventDefault(),
  2412. t && e.stopPropagation()
  2413. }
  2414. function Oe(e) {
  2415. Pe(e, 1),
  2416. xe(this).off(e.type, Oe)
  2417. }
  2418. function Le() {
  2419. this.scrollLeft = 0,
  2420. this.scrollTop = 0
  2421. }
  2422. function De(e) {
  2423. return !isNaN(parseFloat(e)) && isFinite(e)
  2424. }
  2425. function Ne(e, t) {
  2426. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2427. }
  2428. function Fe(e, t, i) {
  2429. return e < t ? t : i < e ? i : e
  2430. }
  2431. function Be(t) {
  2432. var i = {
  2433. style: {},
  2434. save: function() {
  2435. if (t && t.nodeType) {
  2436. for (var e = 0; e < arguments.length; e++)
  2437. i.style[arguments[e]] = t.style[arguments[e]];
  2438. return i
  2439. }
  2440. },
  2441. restore: function() {
  2442. if (t && t.nodeType) {
  2443. for (var e in i.style)
  2444. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2445. return i
  2446. }
  2447. }
  2448. };
  2449. return i
  2450. }
  2451. var Ve, ke, Ue, r, o, He = "sly", ze = e.cancelAnimationFrame || e.cancelRequestAnimationFrame, Ge = e.requestAnimationFrame, We = xe(document), je = "touchstart." + He + " mousedown." + He, Ye = "mousemove." + He + " mouseup." + He, qe = "touchmove." + He + " touchend." + He, Xe = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + He, Ze = "click." + He, Ke = "mousedown." + He, Qe = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], Je = [], $e = Math.abs, et = Math.sqrt, tt = Math.pow, it = Math.round, nt = Math.max, rt = Math.min, ot = 0;
  2452. function t(e) {
  2453. for (var t = 0, i = r.length; t < i; t++) {
  2454. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2455. if (null != o.style[n])
  2456. return n
  2457. }
  2458. }
  2459. We.on(Xe, function(e) {
  2460. var t = e.originalEvent[He]
  2461. , i = +new Date;
  2462. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2463. }),
  2464. function(t) {
  2465. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2466. var t = (new Date).getTime()
  2467. , i = Math.max(0, 16 - (t - r))
  2468. , n = setTimeout(e, i);
  2469. return r = t,
  2470. n
  2471. }
  2472. ;
  2473. var r = (new Date).getTime()
  2474. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2475. ze = function(e) {
  2476. i.call(t, e)
  2477. }
  2478. }(window),
  2479. r = ["", "webkit", "moz", "ms", "o"],
  2480. o = document.createElement("div"),
  2481. Ve = t("transform"),
  2482. ke = t("perspective") ? "translateZ(0) " : "",
  2483. e.Sly = Me,
  2484. xe.fn.sly = function(n, r) {
  2485. var o, a;
  2486. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2487. a = Array.prototype.slice.call(arguments, 1)),
  2488. n = {}),
  2489. this.each(function(e, t) {
  2490. var i = xe.data(t, He);
  2491. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2492. })
  2493. }
  2494. ,
  2495. Me.defaults = {
  2496. slidee: null,
  2497. horizontal: !1,
  2498. itemNav: null,
  2499. itemSelector: null,
  2500. smart: !1,
  2501. activateOn: null,
  2502. activateMiddle: !1,
  2503. scrollSource: null,
  2504. scrollBy: 0,
  2505. scrollHijack: 300,
  2506. scrollTrap: !1,
  2507. dragSource: null,
  2508. mouseDragging: !1,
  2509. touchDragging: !1,
  2510. releaseSwing: !1,
  2511. swingSpeed: .2,
  2512. elasticBounds: !1,
  2513. interactive: null,
  2514. scrollBar: null,
  2515. dragHandle: !1,
  2516. dynamicHandle: !1,
  2517. minHandleSize: 50,
  2518. clickBar: !1,
  2519. syncSpeed: .5,
  2520. pagesBar: null,
  2521. activatePageOn: null,
  2522. pageBuilder: function(e) {
  2523. return "<li>" + (e + 1) + "</li>"
  2524. },
  2525. forward: null,
  2526. backward: null,
  2527. prev: null,
  2528. next: null,
  2529. prevPage: null,
  2530. nextPage: null,
  2531. cycleBy: null,
  2532. cycleInterval: 5e3,
  2533. pauseOnHover: !1,
  2534. startPaused: !1,
  2535. moveBy: 300,
  2536. speed: 0,
  2537. easing: "swing",
  2538. startAt: null,
  2539. keyboardNavBy: null,
  2540. draggedClass: "dragged",
  2541. activeClass: "active",
  2542. disabledClass: "disabled"
  2543. }
  2544. }(jQuery, window),
  2545. function o(a, s, l) {
  2546. function c(i, e) {
  2547. if (!s[i]) {
  2548. if (!a[i]) {
  2549. var t = "function" == typeof require && require;
  2550. if (!e && t)
  2551. return t(i, !0);
  2552. if (h)
  2553. return h(i, !0);
  2554. var n = new Error("Cannot find module '" + i + "'");
  2555. throw n.code = "MODULE_NOT_FOUND",
  2556. n
  2557. }
  2558. var r = s[i] = {
  2559. exports: {}
  2560. };
  2561. a[i][0].call(r.exports, function(e) {
  2562. var t = a[i][1][e];
  2563. return c(t || e)
  2564. }, r, r.exports, o, a, s, l)
  2565. }
  2566. return s[i].exports
  2567. }
  2568. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2569. c(l[e]);
  2570. return c
  2571. }({
  2572. 1: [function(p, f, e) {
  2573. (function(e) {
  2574. "use strict";
  2575. function t(e) {
  2576. this.player = null,
  2577. this.director = null,
  2578. this.modelManager = null,
  2579. this.container = null,
  2580. this.tagManager = null,
  2581. this.fadeInSpeed = e,
  2582. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2583. }
  2584. var r = p("three")
  2585. , i = p("./util/logger")
  2586. , n = (p("./util/common"),
  2587. p("./enum/PlayerEvents"))
  2588. , o = p("./enum/DirectorEvents")
  2589. , a = p("./settings")
  2590. , s = p("./enum/Viewmode")
  2591. , l = (p("./enum/WarpStyle"),
  2592. p("./enum/BlackoutStyle"),
  2593. p("./enum/ModelManagerEvents"))
  2594. , c = p("./enum/tagEvents")
  2595. , h = p("./util/transitions")
  2596. , u = p("./util/lerp")
  2597. , d = new i(e);
  2598. t.prototype.init = function(e, t, i, n, r) {
  2599. (window.app = this).player = t,
  2600. this.director = e,
  2601. this.modelManager = i,
  2602. this.tagManager = n,
  2603. this.container = r,
  2604. this.updateModel(),
  2605. this.bindEvents()
  2606. }
  2607. ,
  2608. t.prototype.bindEvents = function() {
  2609. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2610. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2611. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2612. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2613. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2614. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2615. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2616. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2617. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2618. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2619. }
  2620. ,
  2621. t.prototype.updateModel = function() {
  2622. this.model = this.modelManager.getActiveModel()
  2623. }
  2624. ,
  2625. t.prototype.handleWarpStarted = function() {
  2626. this.hidePlayerReticule()
  2627. }
  2628. ,
  2629. t.prototype.ontagActivated = function() {
  2630. this.hidePlayerReticule()
  2631. }
  2632. ,
  2633. t.prototype.onNavigationTotag = function() {
  2634. this.hidePlayerReticule()
  2635. }
  2636. ,
  2637. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2638. var n = this.modelManager.getActiveModel()
  2639. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2640. n.fadePanoMarkers(r),
  2641. n.setMode(t)
  2642. }
  2643. ,
  2644. t.prototype.handlePlayerModeChanged = function(e, t) {
  2645. var i = this.modelManager.getActiveModel()
  2646. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2647. i.setSide(n),
  2648. i.setMode(t)
  2649. }
  2650. ,
  2651. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2652. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2653. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2654. }
  2655. ,
  2656. t.prototype.handleActionInterruption = function() {}
  2657. ,
  2658. t.prototype.handleStartInside = function(e) {
  2659. var t = a[this.player.mode]
  2660. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2661. this.fadeIn(this.fadeInSpeed),
  2662. this.model.alpha = 0,
  2663. this.model.skybox.material.uniforms.opacity.value = 1,
  2664. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2665. var n = this.player.reticule;
  2666. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2667. }
  2668. ,
  2669. t.prototype.handleStartOutside = function(e) {
  2670. this.fadeIn(e)
  2671. }
  2672. ,
  2673. t.prototype.fadeIn = function(e) {
  2674. null != e || (e = 2e3,
  2675. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2676. $(this.container).fadeIn(e)
  2677. }
  2678. ,
  2679. t.prototype.hidePlayerReticule = function() {
  2680. this.player.reticule.hide()
  2681. }
  2682. ,
  2683. f.exports = t
  2684. }
  2685. ).call(this, "/js/DisplayController.js")
  2686. }
  2687. , {
  2688. "./enum/BlackoutStyle": 18,
  2689. "./enum/DirectorEvents": 23,
  2690. "./enum/tagEvents": 32,
  2691. "./enum/ModelManagerEvents": 33,
  2692. "./enum/PlayerEvents": 40,
  2693. "./enum/Viewmode": 51,
  2694. "./enum/WarpStyle": 52,
  2695. "./settings": 166,
  2696. "./util/common": 185,
  2697. "./util/lerp": 188,
  2698. "./util/logger": 189,
  2699. "./util/transitions": 195,
  2700. three: 217
  2701. }],
  2702. 2: [function(e, t, i) {
  2703. "use strict";
  2704. function n() {
  2705. this.baseStartTime = performance.timing.navigationStart,
  2706. this.loadingStartTime = null,
  2707. this.waitingStartTime = null,
  2708. this.appReadyTime = null
  2709. }
  2710. n.prototype.setBaseStartTime = function(e) {
  2711. this.baseStartTime = e || Date.now()
  2712. }
  2713. ,
  2714. n.prototype.setWaitingStartTime = function(e) {
  2715. this.waitingStartTime = e || Date.now()
  2716. }
  2717. ,
  2718. n.prototype.setLoadingStartTime = function(e) {
  2719. this.loadingStartTime = e || Date.now()
  2720. }
  2721. ,
  2722. n.prototype.setAppReadyTime = function(e) {
  2723. this.appReadyTime = e || Date.now()
  2724. }
  2725. ,
  2726. n.prototype.calcFullLoadingTime = function() {
  2727. var e = this.appReadyTime - this.baseStartTime;
  2728. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2729. e
  2730. }
  2731. ,
  2732. t.exports = n
  2733. }
  2734. , {}],
  2735. 3: [function(i, n, e) {
  2736. (function(e) {
  2737. "use strict";
  2738. function a() {
  2739. return 100 * Math.random()
  2740. }
  2741. var t = i("./util/logger")
  2742. , s = i("./util/browser")
  2743. , l = new t(e)
  2744. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2745. initialized: !1,
  2746. init: function(e, t) {
  2747. if (t = t || {},
  2748. !this.initialized) {
  2749. for (var i in this.initialized = !0,
  2750. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2751. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2752. e) {
  2753. var n = i.match("^sc_tilegen_([0-9]+)$");
  2754. n && (c.tilegen = a() < parseInt(n[1]));
  2755. var r = i.match("^sc_imgopt_([0-9]+)$");
  2756. r && (c.imgopt = a() < parseInt(r[1]))
  2757. }
  2758. for (var o in t)
  2759. c[o] = t[o],
  2760. l.debug("A/B override:", o, c[o])
  2761. }
  2762. },
  2763. changeIfTileGenerating: function(e) {
  2764. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2765. e += ""),
  2766. e
  2767. },
  2768. changeIfImageOptimzing: function(e) {
  2769. if(e.includes("blob:http"))return e;//add
  2770. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2771. e += ""),
  2772. e
  2773. },
  2774. tilegen: !1,
  2775. imgopt: !1
  2776. };
  2777. n.exports = c
  2778. }
  2779. ).call(this, "/js/ab.js")
  2780. }
  2781. , {
  2782. "./util/browser": 182,
  2783. "./util/logger": 189
  2784. }],
  2785. 4: [function(u, d, e) {
  2786. (function(e) {
  2787. "use strict";
  2788. function r(n, e, t, i) {
  2789. function r(e) {
  2790. a[e.sid] = !0;
  2791. var t = e.billboard.media && e.billboard.media.type
  2792. , i = {
  2793. tag_id: e.sid,
  2794. tags_visited: Object.keys(a).length,
  2795. tag_count: Object.keys(n.tags).length,
  2796. tag_view_count: ++d,
  2797. has_media: !!t
  2798. };
  2799. t && (i.media_type = t),
  2800. g("tag_opened", i)
  2801. }
  2802. var o, a = {}, s = Date.now() - P, l = null;
  2803. i && (l = Date.now() - window.navigationStart);
  2804. try {
  2805. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2806. } catch (n) {
  2807. o = !1
  2808. }
  2809. var c, h = n.supportsVR;
  2810. h || (c = "VR disabled at the model/account level",
  2811. y.valueFromHash("vr") === w.NONE ? c = "VR disabled, using &vr=0" : y.detectAndroid() ? _.isDeviceSupported(b.Android) || (c = "VR disabled, unsupported Android version") : y.detectIOS() && (_.isDeviceSupported(b.IOS) || (c = "VR disabled, unsupported iOS version"))),
  2812. g("model_loaded", {
  2813. duration: s,
  2814. duration_from_navigation_start: l,
  2815. has_hlr: o,
  2816. has_vr: h,
  2817. vr_reason: c
  2818. });
  2819. var u = 0;
  2820. n.panos.forEach(function(e) {
  2821. e.on("enter", function() {
  2822. f("pano_viewed", {
  2823. pano_id: e.id,
  2824. pano_view_count: ++u,
  2825. alignment_type: e.alignmentType,
  2826. interaction_source: R,
  2827. navigation_source: v
  2828. })
  2829. })
  2830. });
  2831. var d = 0;
  2832. for (var p in n.tags)
  2833. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2834. e.on("tour_auto", function(e) {
  2835. v = "tour_" + e
  2836. }),
  2837. e.on("tour_manual", function(e) {
  2838. R = "gui-" + e,
  2839. v = "tour_manual"
  2840. }),
  2841. t.on(C.InteractionKey, function() {
  2842. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2843. }),
  2844. t.on(C.InteractionDirect, function() {
  2845. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2846. }),
  2847. function(t) {
  2848. I.on(T.OPENED, function() {
  2849. f("showcase_share_intent", {
  2850. pano_id: t.currentPano && t.currentPano.id
  2851. })
  2852. }),
  2853. I.on(T.LINK_CLICKED, function(e) {
  2854. f("showcase_share_action", {
  2855. channel: e.channel,
  2856. pano_id: t.currentPano && t.currentPano.id
  2857. })
  2858. }),
  2859. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2860. f("showcase_share_origin_link_clicked")
  2861. })
  2862. }(e),
  2863. function() {
  2864. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2865. gui_action: "click_vr_button"
  2866. })),
  2867. _.on(S.LAUNCH, function(e) {
  2868. f("showcase_gui", {
  2869. gui_action: "launch_vr",
  2870. vr_platform: e.vr_platform,
  2871. vr_app: e.vr_app
  2872. })
  2873. }),
  2874. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2875. gui_action: "vr_modal_prev"
  2876. })),
  2877. _.on(S.NEXT, function(e) {
  2878. f("showcase_gui", {
  2879. gui_action: e.nextAction
  2880. })
  2881. }),
  2882. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2883. gui_action: "vr_modal_close"
  2884. })),
  2885. _.on(S.falseICECHOSEN, function(e) {
  2886. f("showcase_gui", {
  2887. gui_action: e.name + " "
  2888. })
  2889. }),
  2890. _.on(S.STORE, function(e) {
  2891. f("showcase_gui", {
  2892. gui_action: "launch_store",
  2893. store: e
  2894. })
  2895. })
  2896. }()
  2897. }
  2898. function f(e, t) {
  2899. if (t = t || {},
  2900. i)
  2901. try {
  2902. window.analytics.track(e, s.extendObject(t, c), {
  2903. context: {
  2904. app: {
  2905. name: "showcase",
  2906. version: "2.25.6-0-gd87e5b1"
  2907. },
  2908. screen: {
  2909. width: window.screen.width,
  2910. height: window.screen.height,
  2911. density: window.devicePixelRatio
  2912. }
  2913. }
  2914. })
  2915. } catch (t) {
  2916. console.warn("Failed to send data to segment for " + e)
  2917. }
  2918. }
  2919. function g(e, t) {
  2920. f(e, t = t || {})
  2921. }
  2922. function m(e, t) {
  2923. R = e === C.InteractionGui ? "gui-" + t : e,
  2924. v = "self_guided"
  2925. }
  2926. var v, o, a = (u("three"),
  2927. u("./util/ajax"),
  2928. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2929. u("./enum/Viewmode")), C = u("./enum/ControlEvents"), I = u("./gui/sharing/modal"), E = u("./gui/title/titleBar"), _ = u("./gui/vr/vrModal"), b = u("./enum/VRPlatforms"), w = u("./enum/VROption"), T = u("./gui/sharing/ShareEvents"), x = u("./gui/title/TitleEvents"), S = u("./gui/vr/vrEvent"), M = u("./tag/Billboard/BillboardEvent"), l = new (u("./util/logger"))(e), R = (u("./enum/PlayerEvents"),
  2930. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2931. d.exports = {
  2932. report: function(e, t, i, n) {
  2933. !function(e, t) {
  2934. if (o)
  2935. try {
  2936. o.addEvent(e, s.extendObject({
  2937. host: window.location.host,
  2938. keen: {
  2939. addons: [{
  2940. name: "keen:ua_parser",
  2941. input: {
  2942. ua_string: "user_agent"
  2943. },
  2944. output: "parsed_user_agent"
  2945. }]
  2946. },
  2947. user_agent: "${keen.user_agent}",
  2948. referrer: {
  2949. url: s.normalizeUrl(document.referrer),
  2950. domain: s.domainFromUrl(document.referrer),
  2951. url_original: document.referrer
  2952. },
  2953. embedded: y.inIframe(),
  2954. is_mobile: y.isMobile(),
  2955. version: "2.25.6-0-gd87e5b1"
  2956. }, t))
  2957. } catch (e) {
  2958. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2959. }
  2960. }("Session starts", {
  2961. model: e,
  2962. status: t,
  2963. loadtime: Date.now() - (P || Date.now()),
  2964. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2965. autoplay: i,
  2966. quickstart: n,
  2967. ab_tilegen: a.tilegen,
  2968. ab_imgopt: a.imgopt
  2969. })
  2970. },
  2971. impression: function(e) {
  2972. g("impression", {
  2973. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2974. url_params: (void 0 !== e.immediate && e.immediate,
  2975. window.location.search.substr(1).split("&"))
  2976. })
  2977. },
  2978. initKeen: function(e) {
  2979. return e.token && e.appId ? void (o = new Keen({
  2980. projectId: e.appId,
  2981. writeKey: e.token,
  2982. readKey: "",
  2983. requestType: "xhr"
  2984. })) : void l.warn("no keen token/appId")
  2985. },
  2986. initSegment: function(e) {
  2987. return e.token ? (i = e.token,
  2988. window.analytics.load(e.token),
  2989. c = {
  2990. model_id: e.model,
  2991. start_source: e.startSource,
  2992. autoplay: e.autoplay,
  2993. quickstart: e.quickstart,
  2994. language_tag: t.languageTag,
  2995. is_mobile: y.isMobile(),
  2996. iframe: y.inIframe(),
  2997. aspect_ratio: y.aspectRatio(),
  2998. session_id: h,
  2999. window: {
  3000. width: $("#player").width(),
  3001. height: $("#player").height()
  3002. },
  3003. platform: {
  3004. browser: {
  3005. name: $.ua.browser.name,
  3006. major: $.ua.browser.major,
  3007. version: $.ua.browser.version
  3008. },
  3009. os: {
  3010. name: $.ua.os.name,
  3011. version: $.ua.os.version
  3012. },
  3013. device: {
  3014. vendor: $.ua.device.vendor,
  3015. model: $.ua.device.model,
  3016. type: $.ua.device.type
  3017. }
  3018. }
  3019. },
  3020. n = Math.random() < t.analytics.sessionTrackingRate,
  3021. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  3022. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  3023. },
  3024. sessionStart: function(e) {
  3025. l.debug("analytics user_session_start"),
  3026. f("session_started"),
  3027. P = Date.now(),
  3028. window.addEventListener("unload", function() {
  3029. !function(e, t) {
  3030. if (t = t || {},
  3031. navigator.sendBeacon && i)
  3032. try {
  3033. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  3034. event: e,
  3035. anonymousId: window.analytics.user().anonymousId(),
  3036. properties: s.extendObject(t, c),
  3037. writeKey: i,
  3038. sentAt: Date.now(),
  3039. type: "track",
  3040. context: {
  3041. userAgent: y.userAgent(),
  3042. library: {
  3043. name: "showcase-beacon",
  3044. version: "2.25.6-0-gd87e5b1"
  3045. },
  3046. app: {
  3047. name: "showcase",
  3048. version: "2.25.6-0-gd87e5b1"
  3049. }
  3050. }
  3051. }))
  3052. } catch (e) {
  3053. console.warn("Failed to send async segment request")
  3054. }
  3055. }("session_ended", {
  3056. duration: Date.now() - P
  3057. })
  3058. })
  3059. },
  3060. modelLoaded: function(e, t, i, n) {
  3061. r(e, t, i, n)
  3062. },
  3063. loadComplete: function(e) {
  3064. f("load_times", {
  3065. time_to_app_start: e
  3066. })
  3067. },
  3068. track: function(e, t) {
  3069. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  3070. f(e, t))
  3071. },
  3072. trackAlways: function(e, t) {
  3073. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  3074. f(e, t)
  3075. },
  3076. getSessionId: function() {
  3077. return h
  3078. },
  3079. updateInteraction: m
  3080. }
  3081. }
  3082. ).call(this, "/js/analytics.js")
  3083. }
  3084. , {
  3085. "./ab": 3,
  3086. "./enum/ControlEvents": 21,
  3087. "./enum/PlayerEvents": 40,
  3088. "./enum/VROption": 47,
  3089. "./enum/VRPlatforms": 49,
  3090. "./enum/Viewmode": 51,
  3091. "./gui/sharing/ShareEvents": 76,
  3092. "./gui/sharing/modal": 77,
  3093. "./gui/title/TitleEvents": 80,
  3094. "./gui/title/titleBar": 82,
  3095. "./gui/vr/vrEvent": 85,
  3096. "./gui/vr/vrModal": 87,
  3097. "./localization/localize": 108,
  3098. "./tag/Billboard/BillboardEvent": 120,
  3099. "./settings": 166,
  3100. "./util/ajax": 181,
  3101. "./util/browser": 182,
  3102. "./util/common": 185,
  3103. "./util/logger": 189,
  3104. three: 217
  3105. }],
  3106. 5: [function(e, t, i) {
  3107. "use strict";
  3108. function n() {
  3109. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  3110. this.controls = null
  3111. }
  3112. var r = e("three")
  3113. , o = e("../constants")
  3114. , a = e("../util/cameraLight");
  3115. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  3116. this.aspect = e,
  3117. this.updateProjectionMatrix()
  3118. }
  3119. ,
  3120. t.exports = n
  3121. }
  3122. , {
  3123. "../constants": 8,
  3124. "../util/cameraLight": 184,
  3125. three: 217
  3126. }],
  3127. 6: [function(e, t, i) {
  3128. "use strict";
  3129. function n() {
  3130. var e = $("#player").width() / $("#player").height();
  3131. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3132. this.controls = null,
  3133. this.updateAspect(e)
  3134. }
  3135. var r = e("three")
  3136. , o = e("../constants");
  3137. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  3138. this.aspect = e,
  3139. this.top = o.orthoBase / e,
  3140. this.bottom = -o.orthoBase / e,
  3141. this.updateProjectionMatrix()
  3142. }
  3143. ,
  3144. t.exports = n
  3145. }
  3146. , {
  3147. "../constants": 8,
  3148. three: 217
  3149. }],
  3150. 7: [function(e, t, i) {
  3151. "use strict";
  3152. function n() {
  3153. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3154. this.controls = null
  3155. }
  3156. var r = e("three")
  3157. , o = e("../settings")
  3158. , a = e("../util/cameraLight");
  3159. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  3160. this.aspect = e,
  3161. this.updateProjectionMatrix()
  3162. }
  3163. ,
  3164. t.exports = n
  3165. }
  3166. , {
  3167. "../settings": 166,
  3168. "../util/cameraLight": 184,
  3169. three: 217
  3170. }],
  3171. 8: [function(e, t, i) {
  3172. "use strict";
  3173. t.exports = {
  3174. signedUrlDefaultExpireTime: 24e4,
  3175. signedUrlCheckInterval: 1e4,
  3176. signedUrlRefreshBuffer: 15e3,
  3177. dollhouseFOV: 70,
  3178. dollhouseNear: .1,//1,
  3179. dollhouseFar: 5e3,
  3180. insideFOV: 70,
  3181. insideFOVMax: 120,
  3182. insideNear: .1,
  3183. insideFar: 5e3,
  3184. insideLookSpeed: .12,
  3185. insideLookLimitUp: 40,
  3186. insideLookLimitDown: -40,
  3187. orthoNear: 1,
  3188. orthoFar: 5e3,
  3189. orthoBase: 10,
  3190. narrowLandscapeHeight: 290,
  3191. reallyNarrowLandscapeHeight: 250,
  3192. visionTilingStartDate: new Date("8/26/2016"),
  3193. visionTilingStartVersion: "1.1.407.13667",
  3194. windowHeightHighQualityThreshold: 900,
  3195. tourStepDelayDefault: 3500,
  3196. tourStepDelaySlideShow: 5e3,
  3197. workshopApsect: 9 / 16,
  3198. highQualityMaxZoom: 2,
  3199. ultraHighQualityMaxZoom: 3
  3200. }
  3201. }
  3202. , {}],
  3203. 9: [function(e, t, i) {
  3204. "use strict";
  3205. function n() {
  3206. this.activeControl = null,
  3207. this.controls = {},
  3208. this.cameras = {}
  3209. }
  3210. var a = e("./PanoramaControls")
  3211. , s = e("./DollhouseControls")
  3212. , l = e("./FloorplanControls")
  3213. , c = e("../cameras/PanoramaCamera")
  3214. , h = e("../cameras/DollhouseCamera")
  3215. , u = e("../cameras/FloorplanCamera")
  3216. , r = e("events").EventEmitter
  3217. , d = e("../enum/ControlEvents")
  3218. , o = e("../enum/ModelManagerEvents")
  3219. , p = e("../enum/Viewmode")
  3220. , f = e("../settings");
  3221. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3222. this.setUpControls(),
  3223. this.bindEvents(e, t)
  3224. }
  3225. ,
  3226. n.prototype.activateControls = function(e) {
  3227. this.activeControl && (this.activeControl.reset(),
  3228. this.activeControl.enabled = !1),
  3229. this.controls[e] && (this.controls[e].enabled = !0),
  3230. this.activeControl = this.controls[e]
  3231. }
  3232. ,
  3233. n.prototype.setUpControls = function() {
  3234. var i = {}
  3235. , n = {}
  3236. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3237. , r = [c, h, u]
  3238. , o = [a, s, l];
  3239. e.forEach(function(e, t) {
  3240. i[e] = new r[t],
  3241. n[e] = new o[t](i[e]),
  3242. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3243. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3244. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3245. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3246. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3247. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3248. }
  3249. .bind(this)),
  3250. this.controls = n,
  3251. this.cameras = i
  3252. }
  3253. ,
  3254. n.prototype.bindEvents = function(e, t) {
  3255. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3256. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3257. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3258. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3259. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3260. passive: !1
  3261. }),
  3262. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3263. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3264. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3265. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3266. e.addEventListener("contextmenu", function(e) {
  3267. e.preventDefault()
  3268. }),
  3269. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3270. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3271. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3272. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3273. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3274. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3275. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3276. t.on(o.ActiveModelChanged, function(e) {
  3277. this.setModelForControls(e.model)
  3278. }
  3279. .bind(this))
  3280. }
  3281. ,
  3282. n.prototype.setModelForControls = function(e) {
  3283. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3284. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3285. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3286. this.controls[e].setBounds(t)
  3287. }
  3288. .bind(this))
  3289. }
  3290. ,
  3291. n.prototype.onMouseDown = function(e) {
  3292. e.preventDefault(),
  3293. this.activeControl && this.activeControl.onMouseDown(e)
  3294. }
  3295. ,
  3296. n.prototype.onMouseMove = function(e) {
  3297. e.preventDefault(),
  3298. this.activeControl && this.activeControl.onMouseMove(e)
  3299. }
  3300. ,
  3301. n.prototype.onMouseUp = function(e) {
  3302. e.preventDefault(),
  3303. this.activeControl && this.activeControl.onMouseUp(e)
  3304. }
  3305. ,
  3306. n.prototype.onMouseOver = function(e) {
  3307. e.preventDefault(),
  3308. this.activeControl && this.activeControl.onMouseOver(e)
  3309. }
  3310. ,
  3311. n.prototype.onMouseWheel = function(e) {
  3312. e.preventDefault(),
  3313. this.activeControl && this.activeControl.onMouseWheel(e)
  3314. }
  3315. ,
  3316. n.prototype.onTouchStart = function(e) {
  3317. e.preventDefault(),
  3318. this.activeControl && this.activeControl.onTouchStart(e),
  3319. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3320. $("#hotListContent ul .active").removeClass("active"),
  3321. $("#hotList")[0].classList.remove("active")
  3322. }
  3323. ,
  3324. n.prototype.onTouchMove = function(e) {
  3325. e.preventDefault(),
  3326. this.activeControl && this.activeControl.onTouchMove(e)
  3327. }
  3328. ,
  3329. n.prototype.onTouchEnd = function(e) {
  3330. e.preventDefault(),
  3331. this.activeControl && this.activeControl.onTouchEnd(e)
  3332. }
  3333. ,
  3334. n.prototype.onPointerDown = function(e) {
  3335. if (e.preventDefault(),
  3336. this.activeControl)
  3337. switch (e.pointerType) {
  3338. case "mouse":
  3339. this.activeControl.onMouseDown(e);
  3340. break;
  3341. default:
  3342. this.activeControl.onPointerDown(e)
  3343. }
  3344. }
  3345. ,
  3346. n.prototype.onPointerMove = function(e) {
  3347. if (e.preventDefault(),
  3348. this.activeControl)
  3349. switch (e.pointerType) {
  3350. case "mouse":
  3351. this.activeControl.onMouseMove(e);
  3352. break;
  3353. default:
  3354. this.activeControl.onPointerMove(e)
  3355. }
  3356. }
  3357. ,
  3358. n.prototype.onPointerUp = function(e) {
  3359. if (e.preventDefault(),
  3360. this.activeControl)
  3361. switch (e.pointerType) {
  3362. case "mouse":
  3363. this.activeControl.onMouseUp(e);
  3364. break;
  3365. default:
  3366. this.activeControl.onPointerUp(e)
  3367. }
  3368. }
  3369. ,
  3370. n.prototype.onPointerCancel = function(e) {
  3371. e.preventDefault(),
  3372. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3373. }
  3374. ,
  3375. n.prototype.onKeyDown = function(e) {
  3376. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3377. this.activeControl && this.activeControl.onKeyDown(e))
  3378. }
  3379. ,
  3380. n.prototype.onKeyUp = function(e) {
  3381. e.preventDefault(),
  3382. this.activeControl && this.activeControl.onKeyUp(e)
  3383. }
  3384. ,
  3385. t.exports = n
  3386. }
  3387. , {
  3388. "../cameras/DollhouseCamera": 5,
  3389. "../cameras/FloorplanCamera": 6,
  3390. "../cameras/PanoramaCamera": 7,
  3391. "../enum/ControlEvents": 21,
  3392. "../enum/ModelManagerEvents": 33,
  3393. "../enum/Viewmode": 51,
  3394. "../settings": 166,
  3395. "./DollhouseControls": 10,
  3396. "./FloorplanControls": 11,
  3397. "./PanoramaControls": 13,
  3398. events: 202
  3399. }],
  3400. 10: [function(e, t, i) {
  3401. "use strict";
  3402. function n(e) {
  3403. a.call(this, e),
  3404. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3405. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3406. this.minDistance = o.dollhouseDefault.minDistance,
  3407. this.maxDistance = o.dollhouseDefault.maxDistance,
  3408. this.adjustedMinDistance = this.minDistance,
  3409. this.adjustedMaxDistance = this.maxDistance
  3410. }
  3411. var r = e("three")
  3412. , o = e("../settings")
  3413. , a = e("./OutsideControls");
  3414. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3415. this.camera.updateMatrix();
  3416. var i = this.camera.position.clone().sub(this.target).length();
  3417. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3418. this.panLeft(2 * e * i / $("#player").height()),
  3419. this.panUp(-2 * t * i / $("#player").height())
  3420. }
  3421. ,
  3422. n.prototype.updateZoom = function() {
  3423. return this.offset.length() * this.scale
  3424. }
  3425. ,
  3426. n.prototype.setZoomBounds = function(e) {
  3427. var t = e.min.distanceTo(e.max);
  3428. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3429. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3430. this.minDistance = this.adjustedMinDistance,
  3431. this.maxDistance = this.adjustedMaxDistance
  3432. }
  3433. ,
  3434. n.prototype.resetRanges = function(e, t) {
  3435. e ? (this.minDistance = Math.min(e, this.minDistance),
  3436. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3437. this.maxDistance = this.adjustedMaxDistance),
  3438. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3439. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3440. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3441. }
  3442. ,
  3443. n.prototype.toJSON = function() {
  3444. return a.prototype.toJSON.call(this)
  3445. }
  3446. ,
  3447. t.exports = n
  3448. }
  3449. , {
  3450. "../settings": 166,
  3451. "./OutsideControls": 12,
  3452. three: 217
  3453. }],
  3454. 11: [function(e, t, i) {
  3455. "use strict";
  3456. function n(e) {
  3457. c.call(this, e),
  3458. this.minDistance = 15,
  3459. this.maxDistance = 50,
  3460. this.noRotateUpDown = !0,
  3461. this.minPolarAngle = 0,
  3462. this.maxPolarAngle = 0,
  3463. this.mouseActions[u.LEFT] = h.PAN,
  3464. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3465. this.mouseActions[u.RIGHT] = h.ROTATE,
  3466. this.touchActions[1] = h.PAN,
  3467. this.touchActions[2] = h.ROTATE_DOLLY,
  3468. this.absoluteScale = 1,
  3469. this.currentScale = 1
  3470. }
  3471. var r, o, a, s = e("three"), l = e("../settings"), c = e("./OutsideControls"), h = e("../enum/ControlActions"), u = e("../enum/MouseButton"), d = e("../util/math"), p = e("../util/browser");
  3472. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3473. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3474. this.currentScale = this.absoluteScale
  3475. }
  3476. ,
  3477. n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3478. var t = Math.max(modelSize.x, modelSize.z)
  3479. , i = Math.min(modelSize.x, modelSize.z)
  3480. , n = Math.max(t, i * this.camera.aspect)
  3481. , r = Math.max(i, t * this.camera.aspect);
  3482. var absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2
  3483. return absoluteScale
  3484. },
  3485. n.prototype.rotateToView = function(e, t) {
  3486. var i = 0;
  3487. p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2,
  3488. this.rotateLeft(i),
  3489. this.update(0)
  3490. }
  3491. ,
  3492. n.prototype.pan = function(e, t) {
  3493. this.camera.updateMatrix(),
  3494. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3495. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3496. }
  3497. ,
  3498. n.prototype.updateZoom = function() {
  3499. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3500. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3501. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3502. this.camera.left = -l.orthoBase * this.currentScale,
  3503. this.camera.right = l.orthoBase * this.currentScale,
  3504. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3505. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3506. this.camera.updateProjectionMatrix(),
  3507. this.offset.length()
  3508. }
  3509. ,
  3510. n.prototype.toJSON = (r = new s.Quaternion,
  3511. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3512. a = new s.Quaternion,
  3513. function() {
  3514. var e = c.prototype.toJSON.call(this);
  3515. return r.copy(e.camera_quaternion),
  3516. a.copy(o),
  3517. a.multiply(r),
  3518. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3519. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3520. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3521. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3522. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3523. e
  3524. }
  3525. ),
  3526. t.exports = n
  3527. }
  3528. , {
  3529. "../enum/ControlActions": 20,
  3530. "../enum/MouseButton": 34,
  3531. "../settings": 166,
  3532. "../util/browser": 182,
  3533. "../util/math": 190,
  3534. "./OutsideControls": 12,
  3535. three: 217
  3536. }],
  3537. 12: [function(e, t, i) {
  3538. "use strict";
  3539. function n(e) {
  3540. this.camera = e,
  3541. (this.camera.controls = this).enabled = !1,
  3542. this.target = new a.Vector3,
  3543. this.targetBounds = new a.Box3,
  3544. this.zoomSpeed = 2,//编辑时缩放快一些
  3545. this.minDistance = 0,
  3546. this.maxDistance = 1 / 0,
  3547. this.noRotateUpDown = !1,
  3548. this.rotateSpeed = 1,
  3549. this.keyboardZoomSpeed = 0,
  3550. this.keyPanSpeed = 7,
  3551. this.autoRotate = !1,
  3552. this.autoRotateSpeed = 2,
  3553. this.autoPan = !1,
  3554. this.autoPanPosition = new a.Vector3,
  3555. this.minPolarAngle = a.Math.degToRad(25),
  3556. this.maxPolarAngle = a.Math.degToRad(65),
  3557. this.rotationAcceleration = new a.Vector2,
  3558. this.rotationSpeed = new a.Vector2,
  3559. this.panAcceleration = new a.Vector2,
  3560. this.panSpeed = new a.Vector2,
  3561. this.rotateStart = new a.Vector2,
  3562. this.rotateEnd = new a.Vector2,
  3563. this.rotateDelta = new a.Vector2,
  3564. this.panStart = new a.Vector2,
  3565. this.panEnd = new a.Vector2,
  3566. this.panDelta = new a.Vector2,
  3567. this.panOffset = new a.Vector3,
  3568. this.offset = new a.Vector3,
  3569. this.dollyStart = new a.Vector2,
  3570. this.dollyEnd = new a.Vector2,
  3571. this.dollyDelta = new a.Vector2,
  3572. this.phiDelta = 0,
  3573. this.thetaDelta = 0,
  3574. this.scale = 1,
  3575. this.panVector = new a.Vector3,
  3576. this.lastPosition = new a.Vector3,
  3577. this.state = u.NONE,
  3578. this.mouseActions = {},
  3579. this.mouseActions[d.LEFT] = u.ROTATE,
  3580. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3581. this.mouseActions[d.RIGHT] = u.PAN,
  3582. this.touchActions = {},
  3583. this.touchActions[1] = u.ROTATE,
  3584. this.touchActions[2] = u.PAN_DOLLY,
  3585. this.lastMoveTime = 0,
  3586. this.pointersLimit = 2,
  3587. this.pointers = []
  3588. }
  3589. var r, o, a = e("three"), c = e("../settings"), h = e("../util/common"), s = e("../util/math"), l = e("../enum/Vectors"), u = e("../enum/ControlActions"), d = e("../enum/MouseButton"), p = e("../enum/Keys"), f = e("../enum/ControlEvents"), g = e("events").EventEmitter;
  3590. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3591. this.targetBounds = e
  3592. }
  3593. ,
  3594. n.prototype.isEngaged = function() {
  3595. return this.state !== u.NONE
  3596. }
  3597. ,
  3598. n.prototype.rotateLeft = function(e) {
  3599. void 0 === e && (e = this.getAutoRotationAngle()),
  3600. this.thetaDelta -= e
  3601. }
  3602. ,
  3603. n.prototype.rotateUp = function(e) {
  3604. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3605. this.phiDelta -= e)
  3606. }
  3607. ,
  3608. n.prototype.panLeft = function(e) {
  3609. var t = this.camera.matrix.elements;
  3610. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3611. this.panOffset.multiplyScalar(-e),
  3612. this.panVector.add(this.panOffset)
  3613. }
  3614. ,
  3615. n.prototype.panUp = function(e) {
  3616. var t = this.camera.matrix.elements;
  3617. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3618. this.panOffset.multiplyScalar(-e),
  3619. this.panVector.add(this.panOffset)
  3620. }
  3621. ,
  3622. n.prototype.startRotating = function(e, t) {
  3623. e && this.navRotationAcc("x", e),
  3624. t && this.navRotationAcc("y", t)
  3625. }
  3626. ,
  3627. n.prototype.stopRotating = function(e) {
  3628. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3629. this.navRotationAcc("x", 0),
  3630. this.navRotationAcc("y", 0)
  3631. }
  3632. ,
  3633. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3634. o = new a.Vector3,
  3635. function(e, t) {
  3636. r.copy(this.camera.position),
  3637. void 0 === e && null === e || r.setX(e),
  3638. void 0 === t && null === t || r.setZ(t);
  3639. var i = this.camera.position.distanceTo(this.target)
  3640. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3641. this.targetClamped = !1,
  3642. o.copy(r).addScaledVector(n, i),
  3643. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3644. r.copy(o).addScaledVector(n, -i),
  3645. this.targetClamped = !0),
  3646. this.autoPanPosition.x = r.x,
  3647. this.autoPanPosition.z = r.z,
  3648. this.autoPan && this.stopAutoPanning()
  3649. }
  3650. ),
  3651. n.prototype.stopAutoPanning = function() {
  3652. var e = this.autoPan;
  3653. this.autoPan = !1,
  3654. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3655. }
  3656. ,
  3657. n.prototype.dollyIn = function(e) {
  3658. void 0 === e && (e = this.getZoomScale()),
  3659. this.scale /= e
  3660. }
  3661. ,
  3662. n.prototype.dollyOut = function(e) {
  3663. void 0 === e && (e = this.getZoomScale()),
  3664. this.scale *= e
  3665. }
  3666. ,
  3667. n.prototype.updatePan = function(e) {
  3668. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3669. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3670. this.autoPan) {
  3671. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3672. t.setY(0).clampLength(0, 50 * e),
  3673. this.target.add(t),
  3674. this.camera.position.add(t),
  3675. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3676. this.stopAutoPanning())
  3677. }
  3678. }
  3679. ,
  3680. n.prototype.update = function(e) {
  3681. e = e || 1 / 60,
  3682. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3683. this.rotateLeft(-this.rotationSpeed.x),
  3684. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3685. this.updatePan(e);
  3686. var t = this.camera.position;
  3687. this.offset.copy(t).sub(this.target);
  3688. var i = Math.atan2(this.offset.x, this.offset.z)
  3689. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3690. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3691. i += this.thetaDelta,
  3692. n += this.phiDelta,
  3693. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3694. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3695. var r = this.updateZoom();
  3696. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3697. this.target.add(this.panVector),
  3698. this.targetBounds.clampPoint(this.target, this.target),
  3699. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3700. this.offset.y = r * Math.cos(n),
  3701. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3702. t.copy(this.target).add(this.offset),
  3703. this.camera.lookAt(this.target),
  3704. this.thetaDelta = 0,
  3705. this.phiDelta = 0,
  3706. this.scale = 1,
  3707. this.panVector.set(0, 0, 0),
  3708. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3709. }
  3710. ,
  3711. n.prototype.getAutoRotationAngle = function() {
  3712. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3713. }
  3714. ,
  3715. n.prototype.getZoomScale = function() {
  3716. return Math.pow(.95, this.zoomSpeed)
  3717. }
  3718. ,
  3719. n.prototype.onMouseDown = function(e) {
  3720. if (this.enabled) {
  3721. switch (e.preventDefault(),
  3722. this.stopAutoPanning(),
  3723. this.mouseDown = !0,
  3724. this.state = this.mouseActions[e.button],
  3725. this.state) {
  3726. case u.ROTATE:
  3727. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3728. this.rotationSpeed.set(0, 0);
  3729. break;
  3730. case u.DOLLY:
  3731. this.dollyStart.set(e.clientX, e.clientY);
  3732. break;
  3733. case u.PAN:
  3734. this.panStart.set(e.clientX, e.clientY)
  3735. }
  3736. this.emit(f.InputStart, "mouse")
  3737. }
  3738. }
  3739. ,
  3740. n.prototype.onMouseMove = function(e) {
  3741. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3742. switch (e.preventDefault(),
  3743. this.state) {
  3744. case u.ROTATE:
  3745. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3746. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3747. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3748. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3749. this.rotateStart.copy(this.rotateEnd);
  3750. break;
  3751. case u.DOLLY:
  3752. this.dollyEnd.set(e.clientX, e.clientY),
  3753. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3754. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3755. this.dollyStart.copy(this.dollyEnd);
  3756. break;
  3757. case u.PAN:
  3758. this.panEnd.set(e.clientX, e.clientY),
  3759. this.panDelta.subVectors(this.panEnd, this.panStart),
  3760. this.pan(this.panDelta.x, this.panDelta.y),
  3761. this.panStart.copy(this.panEnd)
  3762. }
  3763. this.emit(f.Move, "mouse"),
  3764. this.lastMoveTime = e.timeStamp,
  3765. this.update()
  3766. }
  3767. }
  3768. ,
  3769. n.prototype.onMouseUp = function(e) {
  3770. this.enabled && (this.mouseDown = !1,
  3771. this.state = u.NONE,
  3772. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3773. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3774. this.update(),
  3775. this.rotationAcceleration.set(0, 0),
  3776. this.rotateDelta.set(0, 0)))
  3777. }
  3778. ,
  3779. n.prototype.onMouseOver = function(e) {
  3780. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3781. }
  3782. ,
  3783. n.prototype.onMouseWheel = function(e) {
  3784. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3785. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3786. this.update())
  3787. }
  3788. ,
  3789. n.prototype.onKeyDown = function(e) {
  3790. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3791. this.handleKeyDown(e.which)))
  3792. }
  3793. ,
  3794. n.prototype.navRotationAcc = function(e, t) {
  3795. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3796. }
  3797. ,
  3798. n.prototype.navPanAcc = function(e, t) {
  3799. this.stopAutoPanning(),
  3800. this.panAcceleration[e] = t
  3801. }
  3802. ,
  3803. n.prototype.handleKeyDown = function(e) {
  3804. var t = !0;
  3805. switch (e) {
  3806. case p.UPARROW:
  3807. case p.I:
  3808. this.navRotationAcc("y", 1);
  3809. break;
  3810. case p.DOWNARROW:
  3811. case p.K:
  3812. this.navRotationAcc("y", -1);
  3813. break;
  3814. case p.LEFTARROW:
  3815. case p.J:
  3816. this.navRotationAcc("x", -1);
  3817. break;
  3818. case p.RIGHTARROW:
  3819. case p.L:
  3820. this.navRotationAcc("x", 1);
  3821. break;
  3822. case p.W:
  3823. this.navPanAcc("y", 1);
  3824. break;
  3825. case p.S:
  3826. this.navPanAcc("y", -1);
  3827. break;
  3828. case p.A:
  3829. this.navPanAcc("x", -1);
  3830. break;
  3831. case p.D:
  3832. this.navPanAcc("x", 1);
  3833. break;
  3834. default:
  3835. t = !1
  3836. }
  3837. t && this.emit(f.Move, "key")
  3838. }
  3839. ,
  3840. n.prototype.onKeyUp = function(e) {
  3841. this.enabled && (e.preventDefault(),
  3842. e.stopPropagation(),
  3843. this.handleKeyUp(e.which))
  3844. }
  3845. ,
  3846. n.prototype.handleKeyUp = function(e) {
  3847. switch (e) {
  3848. case p.I:
  3849. case p.K:
  3850. case p.UPARROW:
  3851. case p.DOWNARROW:
  3852. this.keyboardZoomSpeed = 0,
  3853. this.rotationAcceleration.y = 0;
  3854. break;
  3855. case p.J:
  3856. case p.L:
  3857. case p.LEFTARROW:
  3858. case p.RIGHTARROW:
  3859. this.rotationAcceleration.x = 0;
  3860. break;
  3861. case p.S:
  3862. case p.W:
  3863. this.panAcceleration.y = 0;
  3864. break;
  3865. case p.A:
  3866. case p.D:
  3867. this.panAcceleration.x = 0
  3868. }
  3869. }
  3870. ,
  3871. n.prototype.onTouchStart = function(i) {
  3872. if (this.enabled || this.state === u.NONE) {
  3873. i.preventDefault(),
  3874. i.stopPropagation(),
  3875. this.stopAutoPanning();
  3876. var e = function() {
  3877. if (2 === i.touches.length) {
  3878. var e = i.touches[0].pageX - i.touches[1].pageX
  3879. , t = i.touches[0].pageY - i.touches[1].pageY;
  3880. this.dollyStart.set(e, t)
  3881. }
  3882. }
  3883. .bind(this)
  3884. , t = function() {
  3885. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3886. }
  3887. .bind(this)
  3888. , n = function() {
  3889. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3890. }
  3891. .bind(this);
  3892. switch (this.state = this.touchActions[i.touches.length],
  3893. this.state) {
  3894. case u.PAN_DOLLY:
  3895. e();
  3896. case u.PAN:
  3897. t();
  3898. break;
  3899. case u.ROTATE_DOLLY:
  3900. e();
  3901. case u.ROTATE:
  3902. n()
  3903. }
  3904. this.rotationSpeed.set(0, 0),
  3905. this.emit(f.InputStart, "touch")
  3906. }
  3907. }
  3908. ,
  3909. n.prototype.onTouchMove = function(a) {
  3910. if (this.enabled && this.state !== u.NONE) {
  3911. a.preventDefault(),
  3912. a.stopPropagation();
  3913. var s = function() {
  3914. var e = a.touches[0].pageX - a.touches[1].pageX
  3915. , t = a.touches[0].pageY - a.touches[1].pageY;
  3916. this.dollyEnd.set(e, t);
  3917. var i = this.dollyStart.length() - this.dollyEnd.length();
  3918. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3919. this.dollyStart.copy(this.dollyEnd)
  3920. }
  3921. .bind(this)
  3922. , e = function() {
  3923. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3924. this.panDelta.subVectors(this.panEnd, this.panStart),
  3925. this.pan(this.panDelta.x, this.panDelta.y),
  3926. this.panStart.copy(this.panEnd),
  3927. this.rotateDelta.set(0, 0)
  3928. }
  3929. .bind(this)
  3930. , l = function() {
  3931. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3932. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3933. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3934. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3935. this.rotateStart.copy(this.rotateEnd)
  3936. }
  3937. .bind(this)
  3938. , t = function() {
  3939. if (2 === a.touches.length) {
  3940. var e = window.devicePixelRatio || 1
  3941. , t = a.touches[1].pageX - a.touches[0].pageX
  3942. , i = a.touches[1].pageY - a.touches[0].pageY
  3943. , n = Math.sqrt(t * t + i * i);
  3944. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3945. this.state = u.DOLLY,
  3946. s();
  3947. else {
  3948. var r = h.average(a.touches, "pageX")
  3949. , o = h.average(a.touches, "pageY");
  3950. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3951. this.rotateStart.set(r, o),
  3952. l())
  3953. }
  3954. }
  3955. }
  3956. .bind(this);
  3957. switch (this.state) {
  3958. case u.PAN_DOLLY:
  3959. s();
  3960. case u.PAN:
  3961. e();
  3962. break;
  3963. case u.ROTATE_DOLLY:
  3964. t();
  3965. break;
  3966. case u.DOLLY:
  3967. s();
  3968. break;
  3969. case u.ROTATE:
  3970. l();
  3971. break;
  3972. default:
  3973. this.state = u.NONE
  3974. }
  3975. this.lastMoveTime = a.timeStamp,
  3976. this.emit(f.Move, "touch")
  3977. }
  3978. }
  3979. ,
  3980. n.prototype.onTouchEnd = function(e) {
  3981. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3982. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3983. this.state = u.NONE,
  3984. this.update(),
  3985. this.rotationAcceleration.set(0, 0),
  3986. this.rotateDelta.set(0, 0))
  3987. }
  3988. ,
  3989. n.prototype.onPointerDown = function(e) {
  3990. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3991. id: e.pointerId,
  3992. pageX: e.pageX,
  3993. pageY: e.pageY
  3994. }),
  3995. e.touches = this.pointers,
  3996. this.onTouchStart(e)),
  3997. this.emit(f.InputStart, "pointer"))
  3998. }
  3999. ,
  4000. n.prototype.onPointerMove = function(t) {
  4001. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4002. t.pointerId === e.id && (e.pageX = t.pageX,
  4003. e.pageY = t.pageY)
  4004. }),
  4005. t.touches = this.pointers,
  4006. this.onTouchMove(t))
  4007. }
  4008. ,
  4009. n.prototype.onPointerUp = function(i) {
  4010. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4011. i.pointerId === e.id && this.pointers.splice(t, 1)
  4012. }
  4013. .bind(this)),
  4014. i.touches = this.pointers,
  4015. this.onTouchEnd(i))
  4016. }
  4017. ,
  4018. n.prototype.reset = function() {
  4019. this.state = u.NONE,
  4020. this.stopAutoPanning(),
  4021. this.rotationSpeed.set(0, 0),
  4022. this.rotationAcceleration.set(0, 0),
  4023. this.panSpeed.set(0, 0),
  4024. this.panAcceleration.set(0, 0)
  4025. }
  4026. ,
  4027. n.prototype.toJSON = function() {
  4028. return {
  4029. camera_position: {
  4030. x: s.toPrecision(this.camera.position.x, 4),
  4031. y: s.toPrecision(this.camera.position.y, 4),
  4032. z: s.toPrecision(this.camera.position.z, 4)
  4033. },
  4034. camera_quaternion: {
  4035. x: s.toPrecision(this.camera.quaternion.x, 4),
  4036. y: s.toPrecision(this.camera.quaternion.y, 4),
  4037. z: s.toPrecision(this.camera.quaternion.z, 4),
  4038. w: s.toPrecision(this.camera.quaternion.w, 4)
  4039. }
  4040. }
  4041. }
  4042. ,
  4043. t.exports = n
  4044. }
  4045. , {
  4046. "../enum/ControlActions": 20,
  4047. "../enum/ControlEvents": 21,
  4048. "../enum/Keys": 30,
  4049. "../enum/MouseButton": 34,
  4050. "../enum/Vectors": 50,
  4051. "../settings": 166,
  4052. "../util/common": 185,
  4053. "../util/math": 190,
  4054. events: 202,
  4055. three: 217
  4056. }],
  4057. 13: [function(u, d, e) {
  4058. (function(e) {
  4059. "use strict";
  4060. function t(e) {
  4061. this.camera = e,
  4062. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  4063. this.lookVector = new s.Vector3,
  4064. this.lookSpeed = .05,
  4065. this.rotationAcc = new s.Vector2,
  4066. this.rotationSpeed = new s.Vector2,
  4067. this.lat = 0,
  4068. this.lon = 0,
  4069. this.phi = 0,
  4070. this.theta = 0,
  4071. this.enabled = !1,
  4072. this.locked = !1,
  4073. this.pointer = new s.Vector2(0,0),
  4074. this.rotationHistory = [],
  4075. this.rotationDifference = new s.Vector2,
  4076. this.pointerDragOn = !1,
  4077. this.pointerDragStart = new s.Vector2(0,0),
  4078. this.pinchDistance = 0,
  4079. this.moveStart = new s.Vector2,
  4080. this.moveTolerance = .01,
  4081. this.pointersLimit = 2,
  4082. this.pointers = []
  4083. }
  4084. var s = u("three")
  4085. , i = u("../util/logger")
  4086. , n = u("../settings")
  4087. , r = u("../util/common")
  4088. , o = u("../util/math")
  4089. , a = (u("../enum/Vectors"),
  4090. u("../enum/MouseButton"))
  4091. , l = u("../enum/Keys")
  4092. , c = u("../enum/ControlEvents")
  4093. , h = u("events").EventEmitter;
  4094. new i(e),
  4095. (t.prototype = Object.create(h.prototype)).usable = function() {
  4096. return this.enabled && !this.locked
  4097. }
  4098. ,
  4099. t.prototype.lookAt = function(e) {
  4100. var t = this.camera.position.clone().sub(e)
  4101. , i = Math.atan(t.z / t.x);
  4102. i += t.x < 0 ? Math.PI : 0,
  4103. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  4104. this.lon = s.Math.radToDeg(i) + 180;
  4105. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4106. , r = Math.atan(t.y / n);
  4107. this.lat = -s.Math.radToDeg(r)
  4108. }
  4109. ,
  4110. t.prototype.startRotationFrom = function(e, t) {
  4111. o.convertScreenPositionToNDC(e, t, this.pointer),
  4112. this.pointerDragOn = !0,
  4113. this.pointerDragStart.copy(this.pointer),
  4114. this.moveStart.copy(this.pointer),
  4115. this.rotationHistory = [],
  4116. this.rotationSpeed.set(0, 0)
  4117. }
  4118. ,
  4119. t.prototype.onMouseOver = function(e) {
  4120. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4121. }
  4122. ,
  4123. t.prototype.onTouchStart = function(e) {
  4124. if (this.usable()) {
  4125. switch (e.preventDefault(),
  4126. e.stopPropagation(),
  4127. e.touches.length) {
  4128. case 1:
  4129. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4130. break;
  4131. case 2:
  4132. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4133. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4134. this.pinchDistance = Math.sqrt(t * t + i * i)
  4135. }
  4136. this.emit(c.InputStart, "touch")
  4137. }
  4138. }
  4139. ,
  4140. t.prototype.onPointerDown = function(e) {
  4141. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4142. id: e.pointerId,
  4143. clientX: e.clientX,
  4144. clientY: e.clientY
  4145. }),
  4146. e.touches = this.pointers,
  4147. this.onTouchStart(e),
  4148. this.emit(c.InputStart, "pointer"))
  4149. }
  4150. ,
  4151. t.prototype.onMouseDown = function(e) {
  4152. if (this.usable()) {
  4153. switch (e.preventDefault(),
  4154. e.stopPropagation(),
  4155. e.button) {
  4156. case a.LEFT:
  4157. this.startRotationFrom(e.clientX, e.clientY)
  4158. }
  4159. this.emit(c.InputStart, "mouse")
  4160. }
  4161. }
  4162. ,
  4163. t.prototype.updateRotation = function() {
  4164. if (this.usable() && this.pointerDragOn) {
  4165. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4166. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4167. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4168. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4169. , r = Math.atan2(e.y, i)
  4170. , o = Math.atan2(t.y, n);
  4171. this.rotationDifference.y = s.Math.radToDeg(r - o),
  4172. e.y = 0,
  4173. t.y = 0;
  4174. var a = Math.acos(e.dot(t) / e.length() / t.length());
  4175. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  4176. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4177. this.pointerDragStart.copy(this.pointer)
  4178. }
  4179. }
  4180. ,
  4181. t.prototype.onMouseMove = function(e) {
  4182. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4183. this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(c.Move, "mouse"))
  4184. }
  4185. ,
  4186. t.prototype.onTouchMove = function(e) {
  4187. if (this.usable())
  4188. switch (this.emit(c.Move, "touch"),
  4189. e.touches.length) {
  4190. case 1:
  4191. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4192. break;
  4193. case 2:
  4194. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4195. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4196. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4197. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4198. this.emit(c.Pinch, n),
  4199. this.pinchDistance -= n)
  4200. }
  4201. }
  4202. ,
  4203. t.prototype.onPointerMove = function(t) {
  4204. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4205. t.pointerId === e.id && (e.clientX = t.clientX,
  4206. e.clientY = t.clientY)
  4207. }),
  4208. t.touches = this.pointers,
  4209. this.onTouchMove(t))
  4210. }
  4211. ,
  4212. t.prototype.endRotation = function() {
  4213. this.pointerDragOn = !1;
  4214. var e = r.averageVectors(this.rotationHistory);
  4215. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4216. }
  4217. ,
  4218. t.prototype.onTouchEnd = function(e) {
  4219. this.usable() && (e.preventDefault(),
  4220. e.stopPropagation(),
  4221. this.endRotation())
  4222. }
  4223. ,
  4224. t.prototype.onMouseUp = function(e) {
  4225. this.usable() && (e.preventDefault(),
  4226. e.stopPropagation(),
  4227. this.endRotation())
  4228. }
  4229. ,
  4230. t.prototype.onPointerUp = function(i) {
  4231. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4232. i.pointerId === e.id && this.pointers.splice(t, 1)
  4233. }
  4234. .bind(this)),
  4235. i.touches = this.pointers,
  4236. this.onTouchEnd(i))
  4237. }
  4238. ,
  4239. t.prototype.update = function(e) {
  4240. for (this.lon,
  4241. this.lat,
  4242. this.updateRotation(),
  4243. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4244. this.rotationHistory.shift();
  4245. this.lon += this.rotationDifference.x,
  4246. this.lat += this.rotationDifference.y,
  4247. this.rotationDifference.set(0, 0),
  4248. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4249. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4250. this.lon += this.rotationSpeed.x * e,
  4251. this.lat += this.rotationSpeed.y * e
  4252. var insideLookLimitDown = n.insideLookLimitDown - n.insideFOV/2 + this.camera.fov / 2
  4253. var insideLookLimitUp = n.insideLookLimitUp + n.insideFOV/2 - this.camera.fov / 2
  4254. 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 );
  4255. //this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4256. this.phi = s.Math.degToRad(90 - this.lat),
  4257. this.theta = s.Math.degToRad(this.lon),
  4258. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4259. this.lookVector.y = Math.cos(this.phi),
  4260. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4261. this.target.copy(this.lookVector).add(this.camera.position),
  4262. this.camera.lookAt(this.target)
  4263. }
  4264. ,
  4265. t.prototype.onMouseWheel = function(e) {
  4266. if (this.usable()) {
  4267. var t = e.wheelDelta || -e.detail;
  4268. this.emit(c.InteractionDirect),
  4269. this.emit(c.Scroll, t)
  4270. }
  4271. }
  4272. ,
  4273. t.prototype.onKeyDown = function(e) {
  4274. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4275. this.handleKeyDown(e.which)))
  4276. }
  4277. ,
  4278. t.prototype.handleKeyDown = function(e) {
  4279. var t = function(e, t) {
  4280. this.rotationAcc[e] = t
  4281. }
  4282. .bind(this);
  4283. this.emit(c.InteractionKey);
  4284. var i = !0;
  4285. switch (e) {
  4286. case l.LEFTARROW:
  4287. case l.J:
  4288. t("x", -1);
  4289. break;
  4290. case l.RIGHTARROW:
  4291. case l.L:
  4292. t("x", 1);
  4293. break;
  4294. case l.I:
  4295. t("y", 1);
  4296. break;
  4297. case l.K:
  4298. t("y", -1);
  4299. break;
  4300. default:
  4301. i = !1
  4302. }
  4303. i && this.emit(c.Move, "key")
  4304. }
  4305. ,
  4306. t.prototype.onKeyUp = function(e) {
  4307. this.usable() && (e.preventDefault(),
  4308. e.stopPropagation(),
  4309. this.handleKeyUp(e.which))
  4310. }
  4311. ,
  4312. t.prototype.handleKeyUp = function(e) {
  4313. switch (e) {
  4314. case l.LEFTARROW:
  4315. case l.J:
  4316. case l.RIGHTARROW:
  4317. case l.L:
  4318. this.rotationAcc.x = 0;
  4319. break;
  4320. case l.I:
  4321. case l.K:
  4322. this.rotationAcc.y = 0
  4323. }
  4324. }
  4325. ,
  4326. t.prototype.startRotating = function(e, t) {
  4327. e && (this.rotationAcc.x = e),
  4328. t && (this.rotationAcc.y = t)
  4329. }
  4330. ,
  4331. t.prototype.stopRotating = function(e) {
  4332. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4333. this.rotationAcc.set(0, 0)
  4334. }
  4335. ,
  4336. t.prototype.reset = function() {
  4337. this.pointerDragOn = !1,
  4338. this.rotationAcc.set(0, 0),
  4339. this.rotationSpeed.set(0, 0),
  4340. this.pointers = []
  4341. }
  4342. ,
  4343. t.prototype.toJSON = function() {
  4344. return {
  4345. camera_position: {
  4346. x: o.toPrecision(this.camera.position.x, 4),
  4347. y: o.toPrecision(this.camera.position.y, 4),
  4348. z: o.toPrecision(this.camera.position.z, 4)
  4349. },
  4350. camera_quaternion: {
  4351. x: o.toPrecision(this.camera.quaternion.x, 4),
  4352. y: o.toPrecision(this.camera.quaternion.y, 4),
  4353. z: o.toPrecision(this.camera.quaternion.z, 4),
  4354. w: o.toPrecision(this.camera.quaternion.w, 4)
  4355. }
  4356. }
  4357. }
  4358. ,
  4359. t.prototype.setStateFromJSON = function(e) {
  4360. this.camera.position.copy(e.camera_position),
  4361. this.camera.quaternion.copy(e.camera_quaternion)
  4362. }
  4363. ,
  4364. d.exports = t
  4365. }
  4366. ).call(this, "/js/controls/PanoramaControls.js")
  4367. }
  4368. , {
  4369. "../enum/ControlEvents": 21,
  4370. "../enum/Keys": 30,
  4371. "../enum/MouseButton": 34,
  4372. "../enum/Vectors": 50,
  4373. "../settings": 166,
  4374. "../util/common": 185,
  4375. "../util/logger": 189,
  4376. "../util/math": 190,
  4377. events: 202,
  4378. three: 217
  4379. }],
  4380. 14: [function(t, i, e) {
  4381. (function(e) {
  4382. "use strict";
  4383. var c = t("three")
  4384. , h = t("../enum/Viewmode")
  4385. , u = new (t("../util/logger"))(e);
  4386. i.exports = {
  4387. serialize: function(e) {
  4388. return encodeURI(JSON.stringify(e))
  4389. },
  4390. deserialize: function(e) {
  4391. function t(e) {
  4392. return e.reduce(function(e, t) {
  4393. return e && "number" == typeof t && !isNaN(t)
  4394. }, !0)
  4395. }
  4396. try {
  4397. var i = JSON.parse(decodeURI(e))
  4398. , n = {
  4399. mode: h.fromInt(i.camera_mode),
  4400. panoId: i.scan_id,
  4401. position: (new c.Vector3).copy(i.camera_position),
  4402. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4403. zoom: i.ortho_zoom,
  4404. floorVisibility: i.floor_visibility
  4405. }
  4406. , r = n.position;
  4407. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4408. var o = n.quaternion;
  4409. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4410. n
  4411. } catch (i) {
  4412. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4413. try {
  4414. var a = e.split(",")
  4415. , s = {
  4416. x: parseFloat(a[2]),
  4417. y: parseFloat(a[3]),
  4418. z: parseFloat(a[4])
  4419. }
  4420. , l = {
  4421. x: parseFloat(a[5]),
  4422. y: parseFloat(a[6]),
  4423. z: parseFloat(a[7]),
  4424. w: parseFloat(a[8])
  4425. };
  4426. return t([s.x, s.y, s.z]) || (s.x = 0,
  4427. s.y = 0,
  4428. s.z = 0),
  4429. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4430. l.y = 0,
  4431. l.z = 0,
  4432. l.w = 1),
  4433. {
  4434. mode: h.fromInt(a[0]),
  4435. panoId: a[1],
  4436. position: (new c.Vector3).copy(s),
  4437. quaternion: (new c.Quaternion).copy(l)
  4438. }
  4439. } catch (t) {
  4440. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4441. }
  4442. }
  4443. return null
  4444. }
  4445. }
  4446. }
  4447. ).call(this, "/js/controls/serializer.js")
  4448. }
  4449. , {
  4450. "../enum/Viewmode": 51,
  4451. "../util/logger": 189,
  4452. three: 217
  4453. }],
  4454. 15: [function(C, I, e) {
  4455. (function(e) {
  4456. "use strict";
  4457. function t() {
  4458. this.endlessLoop = r.warp.loop,
  4459. this.clock = new i.Clock(!0),
  4460. this.model = null,
  4461. this.player = null,
  4462. this.currentItem = null,
  4463. this.destinationItem = null,
  4464. this.tourIsPlaying = !1,
  4465. this.transitionStage = v.None,
  4466. this.nextFunc = null,
  4467. this.onTheBus = !1,
  4468. this.tourInProgress = !1,
  4469. this.reachSource = null,
  4470. this.interrupted = !1,
  4471. this.nItems = 0,
  4472. this.walkingSectionPaused = !1
  4473. }
  4474. var i = C("three")
  4475. , n = C("./util/logger")
  4476. , r = C("./settings")
  4477. , o = C("./util/transitions")
  4478. , a = C("events").EventEmitter
  4479. , s = C("./enum/Viewmode")
  4480. , l = C("./analytics")
  4481. , c = C("./enum/WarpStyle")
  4482. , h = (o = C("./util/transitions"),
  4483. C("./model/ModelManager"),
  4484. C("./enum/ModelManagerEvents"))
  4485. , u = C("./enum/DirectorEvents")
  4486. , d = C("./enum/PlayerEvents")
  4487. , p = (C("./enum/ControlEvents"),
  4488. C("./enum/BlackoutStyle"))
  4489. , f = C("./enum/PathDiscardMode")
  4490. , g = C("./enum/PathDisplayMode")
  4491. , m = (C("./player"),
  4492. new n(e))
  4493. , v = Object.freeze({
  4494. None: 0,
  4495. Moving: 1,
  4496. Aiming: 2,
  4497. Interlude: 3
  4498. })
  4499. , y = Object.freeze({
  4500. Forward: 1,
  4501. NoChange: 0,
  4502. Backwards: -1
  4503. })
  4504. , A = o.getUniqueId();
  4505. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4506. this.player = e,
  4507. this.modelManager = t,
  4508. this.updateModel(),
  4509. this.resetAll(),
  4510. this.bindEvents()
  4511. }
  4512. ,
  4513. t.prototype.resetAll = function() {
  4514. if (this.currentItem = null,
  4515. this.destinationItem = null,
  4516. this.tourIsPlaying = !1,
  4517. this.bgmReplay(),
  4518. this.transitionStage = v.None,
  4519. this.nextFunc = null,
  4520. this.onTheBus = !1,
  4521. this.reachSource = null,
  4522. this.interrupted = !1,
  4523. this.model) {
  4524. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4525. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4526. } else
  4527. this.defaultWarpStyle = c.BLACK,
  4528. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4529. this.resetSpecialTransition()
  4530. }
  4531. ,
  4532. t.prototype.updateModel = function() {
  4533. this.model = this.modelManager.getActiveModel(),
  4534. this.nItems = this.model.heroLocations.length
  4535. }
  4536. ,
  4537. t.prototype.bindEvents = function() {
  4538. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4539. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4540. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4541. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4542. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4543. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4544. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4545. this.player.once(d.Move, function() {
  4546. o.cancelById(A)
  4547. })
  4548. }
  4549. ,
  4550. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4551. return e === c.WALK && (this.interrupt(p.NONE),
  4552. this.pauseWalkingSection(),
  4553. this.player.fastForwardActivePanoFlight(),
  4554. !0)
  4555. }
  4556. ,
  4557. t.prototype.handlePlayerMove = function(e) {
  4558. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4559. this.emit("update.controls")
  4560. }
  4561. ,
  4562. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4563. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4564. this.emit("update.controls"))
  4565. }
  4566. ,
  4567. t.prototype.handlePlayerModeChanged = function(e, t) {
  4568. this.intermediateState() || e === t || (this.onTheBus = !1,
  4569. this.emit("update.controls"))
  4570. }
  4571. ,
  4572. t.prototype.handlePlayerInputStart = function(e) {
  4573. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4574. }
  4575. ,
  4576. t.prototype.handlePlayerFlyingStarted = function() {
  4577. this.clearWalkingSectionPaused()
  4578. }
  4579. ,
  4580. t.prototype.describe = function() {
  4581. return {
  4582. nItems: this.nItems,
  4583. currentItem: this.currentItem,
  4584. destinationItem: this.destinationItem,
  4585. tourIsPlaying: this.tourIsPlaying,
  4586. onTheBus: this.onTheBus,
  4587. endlessLoop: this.endlessLoop,
  4588. viewMode: this.player.mode,
  4589. inTransition: this._inTransition(),
  4590. transitionStage: this.transitionStage,
  4591. tourInProgress: this.tourInProgress
  4592. }
  4593. }
  4594. ,
  4595. t.prototype._inTransition = function() {
  4596. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4597. }
  4598. ,
  4599. t.prototype.bounceable = function() {
  4600. var e = this.clock.getDelta();
  4601. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4602. }
  4603. ,
  4604. t.prototype.itemCompare = function(item1, item2, type){//add
  4605. if(type == 'equal'){//==
  4606. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4607. }else if(type == 'less'){//<
  4608. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4609. }
  4610. }
  4611. t.prototype.currentMoveDirection = function() {
  4612. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4613. 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
  4614. }
  4615. ,
  4616. t.prototype.clearPath = function() {
  4617. this._inTransition() || this.player.path.discardPathObject()
  4618. }
  4619. ,
  4620. t.prototype.allFloors = function() {
  4621. this.model.toggleAllFloors()
  4622. }
  4623. ,
  4624. t.prototype.actionComplete = function(e) {
  4625. if (this.interrupted = !1,
  4626. this.transitionStage = v.None,
  4627. this.resetSpecialTransition(),
  4628. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4629. this.tourIsPlaying || (this.player.disablePreRendering(),
  4630. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4631. this.emit("update.controls"),
  4632. this.nextFunc) {
  4633. var t = this.nextFunc;
  4634. this.nextFunc = null,
  4635. t()
  4636. }
  4637. }
  4638. ,
  4639. t.prototype.awaitCompletion = function(e, t) {
  4640. this.nextFunc = t,
  4641. e()
  4642. }
  4643. ,
  4644. t.prototype.updateSuccessFunction = function(e) {
  4645. this.nextFunc = e
  4646. }
  4647. ,
  4648. t.prototype.interrupt = function(e, t) {
  4649. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4650. this.tourIsPlaying = !1,
  4651. this.bgmReplay(),
  4652. this.interrupted = !0,
  4653. this.nextFunc = null,
  4654. this.emit(u.ActionInterrupted),
  4655. null != e || (e = p.BEGINNING),
  4656. this.player.interruptAndFastForward(e, t),
  4657. !0)
  4658. }
  4659. ,
  4660. t.prototype.wouldInterrupt = function() {
  4661. return this.transitionStage !== v.None
  4662. }
  4663. ,
  4664. t.prototype.intermediateState = function() {
  4665. return this.transitionStage !== v.None
  4666. }
  4667. ,
  4668. t.prototype.isInterrupted = function() {
  4669. return this.interrupted
  4670. }
  4671. ,
  4672. t.prototype.pauseWalkingSection = function() {
  4673. this.walkingSectionPaused = !0
  4674. }
  4675. ,
  4676. t.prototype.clearWalkingSectionPaused = function() {
  4677. this.walkingSectionPaused = !1
  4678. }
  4679. ,
  4680. t.prototype.autoTour = function() {
  4681. var i = Date.now();
  4682. this.model.auxDataPromise.then(function() {
  4683. i = Date.now() - i;
  4684. var e = r.warp.auto
  4685. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4686. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4687. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4688. done: function() {
  4689. this.playTour()
  4690. }
  4691. .bind(this),
  4692. name: "_atr",
  4693. id: A
  4694. })
  4695. }
  4696. .bind(this))
  4697. }
  4698. ,
  4699. t.prototype.atDestinationPano = function() {
  4700. if (!this.player.currentPano || null === this.destinationItem)
  4701. return !1;
  4702. var e = this.player.currentPano.id;
  4703. if (void 0 === e)
  4704. return !1;
  4705. var t = this.model.heroLocations;
  4706. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4707. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4708. return destination && destination.panoId == e
  4709. }
  4710. ,
  4711. t.prototype.redirectToItem = function(e, t) {
  4712. if (null != e)
  4713. if (this.wouldInterrupt())
  4714. if (this.player.mode !== s.TRANSITIONING) {
  4715. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4716. var i = function() {
  4717. o.setTimeout(function() {
  4718. this.setDestinationItem(e),
  4719. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4720. }
  4721. .bind(this), 0)
  4722. }
  4723. .bind(this);
  4724. this.interrupt(p.END, 0),
  4725. this.updateSuccessFunction(i)
  4726. } else
  4727. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4728. else
  4729. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4730. else
  4731. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4732. }
  4733. ,
  4734. t.prototype.useSpecialTransition = function(e) {
  4735. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4736. this.nextWarpStyle = c.BLACK
  4737. }
  4738. ,
  4739. t.prototype.resetSpecialTransition = function() {
  4740. this.nextWarpStyle = this.defaultWarpStyle
  4741. }
  4742. ,
  4743. t.prototype.arrivedAtDestination = function(e) {
  4744. if (this.player.flying || this.player.isWarping())
  4745. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4746. else {
  4747. this.transitionStage = v.Aiming;
  4748. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4749. this.player.model.fadePanoMarkers(0),
  4750. this.awaitCompletion(function() {
  4751. this.resetSpecialTransition(),
  4752. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4753. }
  4754. .bind(this), t)
  4755. }
  4756. }
  4757. ,
  4758. t.prototype.goToDestination = function(e, t, i, n) {
  4759. //音频
  4760. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4761. if(musicInfo && musicInfo.music){
  4762. var o1 = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4763. let audioSrc1 = g_tourAudio.src.split('/').pop();
  4764. let audioSrc2 = o1.split('/').pop();
  4765. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4766. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4767. g_tourAudio.currentTime = 0; g_tourAudio.play();
  4768. }else if(g_tourAudio.paused && g_tourAudio.currentTime < g_tourAudio.duration){//未播完
  4769. g_tourAudio.play()
  4770. }
  4771. }else{//很可能是该folder的起始
  4772. g_tourAudio.src = manage.dealURL(o1);
  4773. g_tourAudio.load()
  4774. }
  4775. if(g_bgAudio && !g_bgAudio.paused){
  4776. manage.switchBgmState(false);
  4777. g_bgAudio.pauseByTour = true
  4778. }
  4779. }
  4780. if (this.onTheBus = !0,
  4781. this.emit("update.controls"),
  4782. this.player.updateLastView(),
  4783. n || !this.atDestinationPano()){
  4784. if (this.player.flying || this.player.isWarping())
  4785. m.warn("Cannot go to new destination while player is flying or warping.");
  4786. else {
  4787. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4788. , s = null
  4789. , l = null;
  4790. if (a.isPano()) {
  4791. o1 = this.getMomentTour(this.destinationItem) //window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  4792. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o1, !0, i, this.actionComplete.bind(this)),
  4793. s = this.arrivedAtDestination.bind(this, !0)
  4794. //add
  4795. if(o1=='black' && a.zoom && a.zoom != this.player.zoomLevel){
  4796. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4797. }
  4798. } else{
  4799. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4800. s = this.arrivedAtDestination.bind(this, !1);
  4801. }
  4802. this.transitionStage = v.Moving,
  4803. this.model.fadePanoMarkers(0),
  4804. this.awaitCompletion(function() {
  4805. l()
  4806. }
  4807. .bind(this), s),
  4808. this.emit("update.controls")
  4809. }
  4810. }else{
  4811. //add 原地旋转时, 写到_warpCameraAim里,因那有时间
  4812. /* var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4813. if(a.zoom && a.zoom != this.player.zoomLevel){
  4814. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4815. } */
  4816. this.arrivedAtDestination(!0)
  4817. }
  4818. }
  4819. ,
  4820. t.prototype.tourInterlude = function() {
  4821. if (l.trackAlways("reach_highlight", {
  4822. reach_source: this.reachSource
  4823. }),
  4824. this.model.fadePanoMarkers(0),
  4825. this.emit("update.controls"),
  4826. this.tourIsPlaying)
  4827. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4828. this.stopTour(),
  4829. this.emit(u.TourEnd),
  4830. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4831. this.transitionStage = v.Interlude,
  4832. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4833. }
  4834. .bind(this), this.goNext.bind(this))
  4835. }
  4836. ,
  4837. t.prototype.playTour = function() {
  4838. if (!this.bounceable())
  4839. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4840. this.tourInProgress = !0,
  4841. this.reachSource = "play",
  4842. this.tourIsPlaying = !0,
  4843. this.wasZoomEnabled = this.player.zoomEnabled,
  4844. this.player.zoomEnabled = !1,
  4845. this.resetSpecialTransition(),
  4846. this.emit("update.controls"),
  4847. this.emit(u.TourStart),
  4848. this.player.enablePreRendering(),
  4849. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4850. this.goToDestination()) : this.goNext()))
  4851. }
  4852. ,
  4853. t.prototype.bgmReplay = function() {
  4854. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  4855. g_playAudio = g_bgAudio;
  4856. g_tourAudio && g_tourAudio.pause();
  4857. //window.tourAudio && window.tourAudio.pause();
  4858. manage.switchBgmState(true);
  4859. }
  4860. }
  4861. ,
  4862. t.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4863. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4864. this.tourIsPlaying = !1,
  4865. (!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4866. this.interrupt(),
  4867. this.clearWalkingSectionPaused(),
  4868. this.resetSpecialTransition(),
  4869. this.emit("update.controls"))
  4870. if(!isAutoStop && g_tourAudio && g_tourAudio.paused == false )
  4871. {
  4872. g_tourAudio.pause();
  4873. g_tourAudio.src = ""
  4874. }
  4875. }
  4876. ,
  4877. t.prototype.endTourProgress = function() {
  4878. this.tourInProgress = !1,
  4879. this.emit("update.controls"),
  4880. this.emit(u.TourEnd)
  4881. }
  4882. ,
  4883. t.prototype.goToHighlight = function(e) {
  4884. if (this.wouldInterrupt())
  4885. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4886. else {
  4887. if (m.debug("<tour.goto " + e + ">"),
  4888. this.isInterrupted())
  4889. return;
  4890. this.clearWalkingSectionPaused(),
  4891. this.setDestinationItem(e),
  4892. this.useSpecialTransition("Hilight"),
  4893. this.goToDestination(),
  4894. l.trackAlways("reach_highlight", {
  4895. reach_source: "thumb"
  4896. })
  4897. }
  4898. }
  4899. ,
  4900. t.prototype.prevHighlight = function() {
  4901. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4902. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4903. this.reachSource = "prev",
  4904. this.goPrev()))
  4905. }
  4906. ,
  4907. t.prototype.nextHighlight = function() {
  4908. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4909. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4910. this.reachSource = "next",
  4911. this.goNext()))
  4912. }
  4913. ,
  4914. t.prototype.changeMode = function(e) {
  4915. var t = $.Deferred()
  4916. , i = t.resolve.bind(t)
  4917. , n = t.reject.bind(t);
  4918. if (this.emit(u.StartModeChange),
  4919. !function() {
  4920. return this.clearWalkingSectionPaused(),
  4921. !!this.wouldInterrupt() && (this.interrupt(),
  4922. !0)
  4923. }
  4924. .bind(this)()) {
  4925. switch (e) {
  4926. case s.PANORAMA:
  4927. this.player.mode === s.PANORAMA ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n) : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  4928. break;
  4929. case s.DOLLHOUSE:
  4930. case s.FLOORPLAN:
  4931. this.player.flyToNewMode({
  4932. mode: e
  4933. }).done(i).fail(n);
  4934. break;
  4935. case s.OUTDOOR:
  4936. this.player.model.has360Views && (this.player.mode !== s.PANORAMA || this.player.mode === s.PANORAMA && this.player.currentPano.isAligned()) && this.player.goToLastView(!1).done(i).fail(n)
  4937. }
  4938. return t.promise()
  4939. }
  4940. }
  4941. ,
  4942. t.prototype.atEndOfTour = function(item) {
  4943. //return this.currentItem >= this.nItems - 1
  4944. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  4945. if(end){
  4946. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  4947. if(heroLocations){
  4948. end = this.currentItem[1] >= heroLocations.length - 1
  4949. }
  4950. }
  4951. return end;
  4952. }
  4953. ,
  4954. t.prototype.firstDestination = function() {
  4955. //return 0 < this.nItems ? 0 : null
  4956. return 0 < this.nItems ? [0,0]: null
  4957. }
  4958. ,
  4959. t.prototype.finalDestination = function() {
  4960. //return 0 < this.nItems ? this.nItems - 1 : null
  4961. return 0 < this.nItems ? [this.nItems - 1,0]: null
  4962. }
  4963. ,
  4964. t.prototype.goPrev = function() {
  4965. this.tourAdvance(-1)
  4966. }
  4967. ,
  4968. t.prototype.goNext = function() {
  4969. this.tourAdvance(1)
  4970. }
  4971. ,
  4972. t.prototype.setDestinationItem = function(e) {
  4973. this.destinationItem = e,
  4974. this.emit("update.controls")
  4975. }
  4976. ,
  4977. t.prototype.setCurrentItem = function(e) {
  4978. this.currentItem = e,
  4979. this.emit("update.controls")
  4980. }
  4981. ,
  4982. t.prototype.nextItem = function(currentItem) {
  4983. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4984. if(currentItem == void 0)return this.firstDestination()
  4985. var currentLocation = this.model.heroLocations[currentItem[0]];
  4986. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4987. var item;
  4988. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4989. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  4990. }else{
  4991. item = [currentItem[0] , currentItem[1]+1]
  4992. }
  4993. if(item[0] >= this.nItems ){
  4994. item = this.firstDestination()
  4995. }
  4996. return item;
  4997. //暂时不理会endlessLoop,默认为false
  4998. }
  4999. ,
  5000. t.prototype.prevItem = function(currentItem) {
  5001. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  5002. if(currentItem == void 0)return this.firstDestination()//finalDestination?
  5003. var item;
  5004. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  5005. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  5006. else{
  5007. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5008. if(this.currentItem[1] == 0){//子目录中第一个
  5009. return [currentItem[0] - 1, lastChildNum-1]
  5010. }else{
  5011. return [currentItem[0], currentItem[1]-1]
  5012. }
  5013. }
  5014. }
  5015. ,
  5016. t.prototype.tourAdvance = function(e) {//e是1或-1
  5017. m.debug("tourAdvance(" + e + ")")
  5018. if(null === this.currentItem || void 0 === this.currentItem){
  5019. this.setDestinationItem(this.firstDestination())
  5020. }else{
  5021. var item
  5022. if(e == 1){
  5023. item = this.nextItem(this.currentItem)
  5024. /* var currentLocation = this.model.heroLocations[this.currentItem[0]];
  5025. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  5026. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  5027. this.setDestinationItem([this.currentItem[0] + 1, 0]) //结果可能超出nItems
  5028. }else{
  5029. this.setDestinationItem([this.currentItem[0] , this.currentItem[1]+1])
  5030. } */
  5031. }else if(e == -1){
  5032. item = this.prevItem(this.currentItem)
  5033. /* var lastLocation = this.model.heroLocations[this.currentItem[0]-1];
  5034. if(!lastLocation) this.setDestinationItem([-1, 0]) //结果小于0
  5035. else{
  5036. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5037. if(this.currentItem[1] == 0){//子目录中第一个
  5038. this.setDestinationItem([this.currentItem[0] - 1, lastChildNum-1])
  5039. }else{
  5040. this.setDestinationItem([this.currentItem[0], this.currentItem[1]-1])
  5041. }
  5042. } */
  5043. }
  5044. //this.setDestinationItem(this.currentItem + e)
  5045. this.setDestinationItem(item)
  5046. }
  5047. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  5048. this.useSpecialTransition("reverse-looping to end")
  5049. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  5050. this.useSpecialTransition("looping back to start")
  5051. }
  5052. /* if(this.destinationItem[0] < 0 ){
  5053. this.setDestinationItem(this.finalDestination())
  5054. this.useSpecialTransition("reverse-looping to end")
  5055. }else{
  5056. this.destinationItem[0] >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  5057. this.useSpecialTransition("looping back to start"))
  5058. } */
  5059. /* var momentTour = this.getMomentTour(this.destinationItem);
  5060. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5061. var i = this.player.zoomLevel;
  5062. this.player.zoomEnabled = !0;
  5063. var t = function(e, t) {
  5064. this.player.zoomTo((1 - e) * i, !0)
  5065. }
  5066. .bind(this);
  5067. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  5068. } */
  5069. this.goToDestination()
  5070. }
  5071. ,
  5072. t.prototype.getMomentTour = function(destinationItem) {//add
  5073. var wholeMomentTour = window.MP_PREFETCHED_MODELDATA.momentTour || "walk"; //最外层
  5074. if(!destinationItem) return wholeMomentTour
  5075. else{
  5076. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  5077. if(currentLocation.momentTour)return currentLocation.momentTour;
  5078. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5079. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5080. }
  5081. }
  5082. ,
  5083. I.exports = t
  5084. }
  5085. ).call(this, "/js/director.js")
  5086. }
  5087. , {
  5088. "./analytics": 4,
  5089. "./enum/BlackoutStyle": 18,
  5090. "./enum/ControlEvents": 21,
  5091. "./enum/DirectorEvents": 23,
  5092. "./enum/ModelManagerEvents": 33,
  5093. "./enum/PathDiscardMode": 38,
  5094. "./enum/PathDisplayMode": 39,
  5095. "./enum/PlayerEvents": 40,
  5096. "./enum/Viewmode": 51,
  5097. "./enum/WarpStyle": 52,
  5098. "./model/ModelManager": 140,
  5099. "./player": 155,
  5100. "./settings": 166,
  5101. "./util/logger": 189,
  5102. "./util/transitions": 195,
  5103. events: 202,
  5104. three: 217
  5105. }],
  5106. 16: [function(e, t, i) {
  5107. "use strict";
  5108. var n = e("three")
  5109. , r = e("./enum/Viewmode")
  5110. , o = (e("./settings"),
  5111. e("./util/transitions"))
  5112. , a = e("./enum/PlayerEvents")
  5113. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5114. , l = new n.ShaderPass(n.VerticalBlurShader);
  5115. l.renderToScreen = !0;
  5116. var c = $("#player").width() / $("#player").height();
  5117. isNaN(c) && (c = 1);
  5118. var h = {
  5119. currentBlur: 0,
  5120. aspect: c,
  5121. blurStrength: 1,
  5122. hblurPass: s,
  5123. vblurPass: l,
  5124. bindEvents: function(e) {
  5125. e.on(a.ModeChanged, function(e, t) {
  5126. e === r.PANORAMA && (o.cancel(h.blur),
  5127. o.cancel(h.addBlur),
  5128. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5129. })
  5130. },
  5131. blur: function(e) {
  5132. var t = (h.currentBlur = e) * h.blurStrength;
  5133. l.uniforms.v.value = t / 512 * h.aspect,
  5134. s.uniforms.h.value = t / 512
  5135. },
  5136. addBlur: function(e) {
  5137. e = Math.max(e, h.currentBlur),
  5138. h.blur(e)
  5139. },
  5140. removeBlur: function(e) {
  5141. e = Math.min(1 - e, h.currentBlur),
  5142. h.blur(e)
  5143. }
  5144. };
  5145. h.blur(0),
  5146. t.exports = h
  5147. }
  5148. , {
  5149. "./enum/PlayerEvents": 40,
  5150. "./enum/Viewmode": 51,
  5151. "./settings": 166,
  5152. "./util/transitions": 195,
  5153. three: 217
  5154. }],
  5155. 17: [function(e, t, i) {
  5156. "use strict";
  5157. t.exports = {
  5158. UNKNOWN: 0,
  5159. ALIGNED: 1,
  5160. UNALIGNED: 2,
  5161. PLACED: 3
  5162. }
  5163. }
  5164. , {}],
  5165. 18: [function(e, t, i) {
  5166. "use strict";
  5167. t.exports = {
  5168. NONE: 0,
  5169. MIDDLE: 1,
  5170. END: 2,
  5171. BEGINNING: 3,
  5172. FADEIN: 4
  5173. }
  5174. }
  5175. , {}],
  5176. 19: [function(e, t, i) {
  5177. "use strict";
  5178. var r = e("three");
  5179. t.exports = {
  5180. newBlue: new r.Color(4967932),
  5181. altBlue: new r.Color(47355),
  5182. tagDefault: new r.Color(223357),
  5183. classicBlue: new r.Color(53759),
  5184. mpYellow: new r.Color(16502016),
  5185. mpOrange: new r.Color(16428055),
  5186. mpBlue: new r.Color(12096),
  5187. mpLtGrey: new r.Color(13751252),
  5188. mpDkGrey: new r.Color(10000019),
  5189. mpRed: new r.Color(12525854),
  5190. mpOrangeDesat: new r.Color(16764529),
  5191. mpBlueDesat: new r.Color(4034734),
  5192. mpRedDesat: new r.Color(14705505),
  5193. white: new r.Color(16777215),
  5194. black: new r.Color(0),
  5195. _desat: function(e, t) {
  5196. var i = t || .3
  5197. , n = (new r.Color).copy(e).getHSL();
  5198. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  5199. },
  5200. _darken: function(e, t) {
  5201. var i = t || .2
  5202. , n = e.getHSL();
  5203. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  5204. }
  5205. }
  5206. }
  5207. , {
  5208. three: 217
  5209. }],
  5210. 20: [function(e, t, i) {
  5211. "use strict";
  5212. t.exports = {
  5213. NONE: -1,
  5214. ROTATE: 0,
  5215. DOLLY: 1,
  5216. PAN: 2,
  5217. ROTATE_DOLLY: 3,
  5218. PAN_DOLLY: 4
  5219. }
  5220. }
  5221. , {}],
  5222. 21: [function(e, t, i) {
  5223. "use strict";
  5224. t.exports = {
  5225. Move: "move",
  5226. InteractionDirect: "interaction.direct",
  5227. InteractionKey: "interaction.key",
  5228. InteractionGui: "interaction.gui",
  5229. FlyInDirection: "fly.direction",
  5230. InputStart: "input.start",
  5231. Pinch: "input.pinch",
  5232. Scroll: "input.scroll",
  5233. AutoPanInterrupt: "autopan.interrupt",
  5234. AutoPanComplete: "autopan.complete",
  5235. AutoPanClamped: "autopan.clamped",
  5236. LongTap: "longtap"
  5237. }
  5238. }
  5239. , {}],
  5240. 22: [function(e, t, i) {
  5241. "use strict";
  5242. t.exports = Object.freeze({
  5243. FORWARD: "FORWARD",
  5244. LEFT: "LEFT",
  5245. RIGHT: "RIGHT",
  5246. BACK: "BACK",
  5247. UP: "UP",
  5248. DOWN: "DOWN"
  5249. })
  5250. }
  5251. , {}],
  5252. 23: [function(e, t, i) {
  5253. "use strict";
  5254. t.exports = {
  5255. ActionInterrupted: "action.interrupted",
  5256. TourStart: "tour.start",
  5257. TourEnd: "tour.end",
  5258. StartModeChange: "mode.startChange"
  5259. }
  5260. }
  5261. , {}],
  5262. 24: [function(e, t, i) {
  5263. "use strict";
  5264. t.exports = Object.freeze({
  5265. None: 0,
  5266. Queued: 1,
  5267. ForceQueued: 2,
  5268. Downloading: 3,
  5269. Downloaded: 4,
  5270. DownloadFailed: 5
  5271. })
  5272. }
  5273. , {}],
  5274. 25: [function(e, t, i) {
  5275. "use strict";
  5276. t.exports = {
  5277. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5278. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5279. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5280. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5281. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5282. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5283. }
  5284. }
  5285. , {}],
  5286. 26: [function(e, t, i) {
  5287. "use strict";
  5288. t.exports = {
  5289. Texture2D: 0,
  5290. TextureCube: 1
  5291. }
  5292. }
  5293. , {}],
  5294. 27: [function(e, t, i) {
  5295. "use strict";
  5296. t.exports = {
  5297. SMALL: "small",
  5298. LARGE: "large"
  5299. }
  5300. }
  5301. , {}],
  5302. 28: [function(e, t, i) {
  5303. "use strict";
  5304. var n = e("./Viewmode")
  5305. , r = {
  5306. LANDING: {},
  5307. NAVIGATION: "navigation",
  5308. MORE_HELP: "moreHelp",
  5309. TOUR_INTERACTION: {}
  5310. };
  5311. r.LANDING[n.PANORAMA] = "panorama.landing",
  5312. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5313. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5314. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5315. r.TOUR_INTERACTION.standard = "standard.tour",
  5316. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5317. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5318. t.exports = r
  5319. }
  5320. , {
  5321. "./Viewmode": 51
  5322. }],
  5323. 29: [function(e, t, i) {
  5324. "use strict";
  5325. var n = {
  5326. UP: 1,
  5327. DOWN: -1,
  5328. LEFT: "L",
  5329. RIGHT: "R",
  5330. FORWARD: "F",
  5331. BACK: "B",
  5332. reverse: {},
  5333. opposite: function(e) {
  5334. return this.reverse[e.toString()]
  5335. }
  5336. };
  5337. n.reverse[n.UP] = n.DOWN,
  5338. n.reverse[n.DOWN] = n.UP,
  5339. n.reverse[n.LEFT] = n.RIGHT,
  5340. n.reverse[n.RIGHT] = n.LEFT,
  5341. n.reverse[n.FORWARD] = n.BACK,
  5342. n.reverse[n.BACK] = n.FORWARD,
  5343. t.exports = n
  5344. }
  5345. , {}],
  5346. 30: [function(e, t, i) {
  5347. "use strict";
  5348. var n = {
  5349. ZERO: 48,
  5350. ONE: 49,
  5351. TWO: 50,
  5352. THREE: 51,
  5353. FOUR: 52,
  5354. FIVE: 53,
  5355. SIX: 54,
  5356. SEVEN: 55,
  5357. EIGHT: 56,
  5358. NINE: 57,
  5359. LEFTARROW: 37,
  5360. UPARROW: 38,
  5361. RIGHTARROW: 39,
  5362. DOWNARROW: 40,
  5363. A: 65,
  5364. B: 66,
  5365. C: 67,
  5366. D: 68,
  5367. E: 69,
  5368. F: 70,
  5369. G: 71,
  5370. H: 72,
  5371. I: 73,
  5372. J: 74,
  5373. K: 75,
  5374. L: 76,
  5375. M: 77,
  5376. N: 78,
  5377. O: 79,
  5378. P: 80,
  5379. Q: 81,
  5380. R: 82,
  5381. S: 83,
  5382. T: 84,
  5383. U: 85,
  5384. V: 86,
  5385. W: 87,
  5386. X: 88,
  5387. Y: 89,
  5388. Z: 90,
  5389. SPACE: 32,
  5390. RETURN: 13,
  5391. SEMICOLON: 186,
  5392. PLUSEQUALS: 187,
  5393. DASHUNDERSCORE: 189,
  5394. OPENBRACKET: 219
  5395. };
  5396. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5397. n.PLUSEQUALS = 61,
  5398. n.DASHUNDERSCORE = 173),
  5399. t.exports = n
  5400. }
  5401. , {
  5402. "../util/browser": 182
  5403. }],
  5404. 31: [function(e, t, i) {
  5405. "use strict";
  5406. t.exports = {
  5407. EN_US: "en-US",
  5408. ES_MX: "es-MX",
  5409. FR_FR: "fr-FR",
  5410. DE_DE: "de-DE",
  5411. RU_RU: "ru-RU",
  5412. CN_CN: "cn-CN",
  5413. JP_JP: "jp-JP"
  5414. }
  5415. }
  5416. , {}],
  5417. 32: [function(e, t, i) {
  5418. "use strict";
  5419. t.exports = {
  5420. TagActivated: "tag.activated",
  5421. TagDismissed: "tag.dismissed",
  5422. TagNavigation: "tag.navigation"
  5423. }
  5424. }
  5425. , {}],
  5426. 33: [function(e, t, i) {
  5427. "use strict";
  5428. t.exports = {
  5429. ModelAdded: "model-added",
  5430. ActiveModelChanged: "active-model-changed"
  5431. }
  5432. }
  5433. , {}],
  5434. 34: [function(e, t, i) {
  5435. "use strict";
  5436. t.exports = {
  5437. LEFT: 0,
  5438. MIDDLE: 1,
  5439. RIGHT: 2
  5440. }
  5441. }
  5442. , {}],
  5443. 35: [function(e, t, i) {
  5444. "use strict";
  5445. t.exports = {
  5446. PanoRenderComplete: "panorama.render.complete",
  5447. TileRenderFailure: "panorama.tile.render.failed",
  5448. TileRenderSuccess: "panorama.tile.render.success",
  5449. TileUploadAttempted: "panorama.tile.upload.attempted",
  5450. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5451. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5452. }
  5453. }
  5454. , {}],
  5455. 36: [function(e, t, i) {
  5456. "use strict";
  5457. t.exports = {
  5458. BASE: 1,
  5459. STANDARD: 2,
  5460. HIGH: 3,
  5461. ULTRAHIGH: 4
  5462. }
  5463. }
  5464. , {}],
  5465. 37: [function(e, t, i) {
  5466. "use strict";
  5467. t.exports = {
  5468. LoadComplete: "panorama.load.complete",
  5469. LoadFailed: "panorama.load.failed",
  5470. TileLoaded: "panorama.tile.loaded"
  5471. }
  5472. }
  5473. , {}],
  5474. 38: [function(e, t, i) {
  5475. "use strict";
  5476. t.exports = Object.freeze({
  5477. Standard: 0,
  5478. Slow: 1,
  5479. Retain: 2
  5480. })
  5481. }
  5482. , {}],
  5483. 39: [function(e, t, i) {
  5484. "use strict";
  5485. t.exports = Object.freeze({
  5486. Show: 0,
  5487. Hide: 1,
  5488. Retain: 2
  5489. })
  5490. }
  5491. , {}],
  5492. 40: [function(e, t, i) {
  5493. "use strict";
  5494. t.exports = {
  5495. Move: "move",
  5496. MoveComplete: "move.complete",
  5497. ModeChanged: "mode.changed",
  5498. ModeChanging: "mode.changing",
  5499. PanoChosen: "pano.chosen",
  5500. ClosestPanoChanging: "closest.pano.changing",
  5501. WarpStarted: "warp.started",
  5502. WarpInterrupted: "warp.interrupted",
  5503. WarpEnded: "warp.ended",
  5504. FlyinFinished: "flyin.finished",
  5505. FlyingStarted: "flying.started",
  5506. FlyingInterrupted: "flying.interrupted",
  5507. FlyingEnded: "flying.ended",
  5508. Ready: "ready",
  5509. StartInside: "start.inside",
  5510. StartOutside: "start.outside",
  5511. ViewChanged: "view.changed",
  5512. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5513. InputStart: "input.start"
  5514. }
  5515. }
  5516. , {}],
  5517. 41: [function(e, t, i) {
  5518. "use strict";
  5519. t.exports = Object.freeze({
  5520. DEFAULT: 0,
  5521. PANOMARKERS: 1,
  5522. RETICULE: 2,
  5523. TAG: 3
  5524. })
  5525. }
  5526. , {}],
  5527. 42: [function(e, t, i) {
  5528. "use strict";
  5529. t.exports = {
  5530. visibleFloor: 1,
  5531. ghostFloor: 3,
  5532. boundingSkybox: 1,
  5533. panoMarker: 2,
  5534. reticule: 3,
  5535. tagStem: 4,
  5536. tagDisc: 5,
  5537. ribbon: 100
  5538. }
  5539. }
  5540. , {}],
  5541. 43: [function(e, t, i) {
  5542. "use strict";
  5543. t.exports = {
  5544. ContextCreated: "scene-renderer-context-created",
  5545. AfterRender: "after-render",
  5546. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5547. }
  5548. }
  5549. , {}],
  5550. 44: [function(e, t, i) {
  5551. "use strict";
  5552. t.exports = {
  5553. IDLE: "idle",
  5554. BROWSE: "browse",
  5555. EXAMINE: "examine"
  5556. }
  5557. }
  5558. , {}],
  5559. 45: [function(e, t, i) {
  5560. "use strict";
  5561. t.exports = {
  5562. TileDownloadSuccess: "tiledownloader.download.success",
  5563. TileDownloadFailure: "tiledownloader.download.failure",
  5564. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5565. }
  5566. }
  5567. , {}],
  5568. 46: [function(e, t, i) {
  5569. "use strict";
  5570. t.exports = {
  5571. CardboardAndroid: "googlevr",
  5572. GearVR: "gearvr",
  5573. CardboardIOS: "googlevrios",
  5574. Cardboard: "googlevr"
  5575. }
  5576. }
  5577. , {}],
  5578. 47: [function(e, t, i) {
  5579. "use strict";
  5580. t.exports = {
  5581. NONE: 0,
  5582. CONTEXTUAL: 1,
  5583. ANDROID: 2
  5584. }
  5585. }
  5586. , {}],
  5587. 48: [function(e, t, i) {
  5588. "use strict";
  5589. var n = {
  5590. Title: 0,
  5591. Cardboard: 1
  5592. }
  5593. , r = {
  5594. Title: 0,
  5595. Cardboard: 1,
  5596. Gear: 2
  5597. };
  5598. [n, r].forEach(function(e) {
  5599. e.pageCount = Object.keys(e).length
  5600. }),
  5601. t.exports.ios = n,
  5602. t.exports.standard = r
  5603. }
  5604. , {}],
  5605. 49: [function(e, t, i) {
  5606. "use strict";
  5607. t.exports = {
  5608. Android: "android",
  5609. IOS: "ios",
  5610. Desktop: "desktop",
  5611. UnsupportedAndroid: "android-unsupported"
  5612. }
  5613. }
  5614. , {}],
  5615. 50: [function(e, t, i) {
  5616. "use strict";
  5617. var n = e("three");
  5618. t.exports = {
  5619. UP: new n.Vector3(0,1,0),
  5620. DOWN: new n.Vector3(0,-1,0),
  5621. LEFT: new n.Vector3(-1,0,0),
  5622. RIGHT: new n.Vector3(1,0,0),
  5623. FORWARD: new n.Vector3(0,0,-1),
  5624. BACK: new n.Vector3(0,0,1)
  5625. }
  5626. }
  5627. , {
  5628. three: 217
  5629. }],
  5630. 51: [function(e, t, i) {
  5631. "use strict";
  5632. var n = e("../exception/ViewmodeConvertException")
  5633. , r = e("./coreViewmodes")
  5634. , o = {
  5635. MESH: "mesh",
  5636. OUTDOOR: "outdoor",
  5637. TRANSITIONING: "transitioning",
  5638. toInt: function(e) {
  5639. switch (e) {
  5640. case this.PANORAMA:
  5641. return 1;
  5642. case this.DOLLHOUSE:
  5643. return 2;
  5644. case this.FLOORPLAN:
  5645. return 3;
  5646. case this.OUTDOOR:
  5647. return 4;
  5648. case this.TRANSITIONING:
  5649. return -1
  5650. }
  5651. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5652. },
  5653. fromInt: function(e) {
  5654. switch (e) {
  5655. case "1":
  5656. case 1:
  5657. return this.PANORAMA;
  5658. case "2":
  5659. case 2:
  5660. return this.DOLLHOUSE;
  5661. case "3":
  5662. case 3:
  5663. return this.FLOORPLAN;
  5664. case "4":
  5665. case 4:
  5666. return this.OUTDOOR
  5667. }
  5668. throw new n("No known conversion for int to viewmode for int: " + e)
  5669. },
  5670. convertWorkshopModeInt: function(e) {
  5671. switch (e) {
  5672. case "0":
  5673. case 0:
  5674. case void 0:
  5675. return this.PANORAMA;
  5676. case "1":
  5677. case 1:
  5678. return this.FLOORPLAN;
  5679. case "2":
  5680. case 2:
  5681. return this.DOLLHOUSE;
  5682. case "3":
  5683. case 3:
  5684. return this.MESH
  5685. }
  5686. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5687. }
  5688. };
  5689. e("../util/common").extendObject(o, r),
  5690. t.exports = o
  5691. }
  5692. , {
  5693. "../exception/ViewmodeConvertException": 58,
  5694. "../util/common": 185,
  5695. "./coreViewmodes": 54
  5696. }],
  5697. 52: [function(e, t, i) {
  5698. "use strict";
  5699. t.exports = {
  5700. BLACK: "black",
  5701. STD: "std",
  5702. WALK: "walk"
  5703. }
  5704. }
  5705. , {}],
  5706. 53: [function(e, t, i) {
  5707. "use strict";
  5708. t.exports = {
  5709. ZoomIn: "zoom.in",
  5710. ZoomOut: "zoom.out",
  5711. ZoomMax: "zoom.max",
  5712. ZoomMin: "zoom.min"
  5713. }
  5714. }
  5715. , {}],
  5716. 54: [function(e, t, i) {
  5717. "use strict";
  5718. t.exports = {
  5719. PANORAMA: "panorama",
  5720. DOLLHOUSE: "dollhouse",
  5721. FLOORPLAN: "floorplan"
  5722. }
  5723. }
  5724. , {}],
  5725. 55: [function(e, t, i) {
  5726. "use strict";
  5727. t.exports = function(e) {
  5728. this.message = e
  5729. }
  5730. }
  5731. , {}],
  5732. 56: [function(e, t, i) {
  5733. "use strict";
  5734. function n(e) {
  5735. r.call(this, e)
  5736. }
  5737. var r = e("./BasicException");
  5738. n.prototype = Object.create(r.prototype),
  5739. t.exports = n
  5740. }
  5741. , {
  5742. "./BasicException": 55
  5743. }],
  5744. 57: [function(e, t, i) {
  5745. "use strict";
  5746. function n(e) {
  5747. r.call(this, e)
  5748. }
  5749. var r = e("./BasicException");
  5750. n.prototype = Object.create(r.prototype),
  5751. t.exports = n
  5752. }
  5753. , {
  5754. "./BasicException": 55
  5755. }],
  5756. 58: [function(e, t, i) {
  5757. "use strict";
  5758. function n(e) {
  5759. r.call(this, e)
  5760. }
  5761. var r = e("./BasicException");
  5762. n.prototype = Object.create(r.prototype),
  5763. t.exports = n
  5764. }
  5765. , {
  5766. "./BasicException": 55
  5767. }],
  5768. 59: [function(a, s, e) {
  5769. (function(e) {
  5770. "use strict";
  5771. var i = a("./util/ajax")
  5772. , n = a("./util/showcase")
  5773. , t = a("./util/logger")
  5774. , r = new t(e)
  5775. , o = {};
  5776. s.exports = {
  5777. loadFeatureFlags: function(e) {
  5778. var t = $.Deferred();
  5779. return i.get(e.urlBase + "", {
  5780. responseType: "json",
  5781. prefetchFrom: "user",
  5782. auth: n.getAuthorizationHeader()
  5783. }).done(function(e) {
  5784. (o = function(e) {
  5785. var t = {};
  5786. if (e) {
  5787. var i = e.flags;
  5788. if (i)
  5789. for (var n in i)
  5790. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5791. return t
  5792. }
  5793. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5794. null
  5795. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5796. }).fail(function() {
  5797. r.debug("Retrieval of feature flags failed."),
  5798. t.reject("loading-failed")
  5799. }),
  5800. t.promise()
  5801. },
  5802. getFlags: function() {
  5803. return o
  5804. },
  5805. updateDependentSettings: function(e, t) {
  5806. (e = e || o).labels && (t.labels.enabled = !0),
  5807. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5808. e.showcase_sdk && (t.sdkInit = !0),
  5809. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5810. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5811. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5812. e.hide_sc_sharing && (t.share.enabled = !1)
  5813. }
  5814. }
  5815. }
  5816. ).call(this, "/js/featureflags.js")
  5817. }
  5818. , {
  5819. "./util/ajax": 181,
  5820. "./util/logger": 189,
  5821. "./util/showcase": 193
  5822. }],
  5823. 60: [function(e, t, i) {
  5824. "use strict";
  5825. var n = (e("../util/common"),
  5826. {
  5827. status: 0,
  5828. set: function(e) {
  5829. if (isNaN(e))
  5830. return !1;
  5831. var t = $(".progressbar");
  5832. e < 0 && (e = 0),
  5833. 100 < e && (e = 100);
  5834. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5835. , n = Math.round(e)
  5836. , r = parseInt(i) - 15;
  5837. t.find(".bar").css("width", i),
  5838. t.find(".label").css("left", r),
  5839. t.find(".perc").text(n + "%"),
  5840. this.status = e
  5841. },
  5842. done: function(e) {
  5843. return e || this.status ? (this.status = null,
  5844. this.set(100)) : this
  5845. }
  5846. });
  5847. t.exports.circleLoader = n
  5848. }
  5849. , {
  5850. "../util/common": 185
  5851. }],
  5852. 61: [function(e, t, i) {
  5853. "use strict";
  5854. t.exports = Object.freeze({
  5855. CLOSE: "modal.closer.close"
  5856. })
  5857. }
  5858. , {}],
  5859. 62: [function(e, t, i) {
  5860. "use strict";
  5861. function n(t, e) {
  5862. function i() {
  5863. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5864. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5865. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5866. c.classList.remove("closeByFooter")))
  5867. }
  5868. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5869. }
  5870. var r = e("../../settings")
  5871. , o = (e("../../tag/Media/MediaEvent"),
  5872. e("../../util/browser"))
  5873. , a = e("../../util/common")
  5874. , s = e("./ModalCloserEvent")
  5875. , l = e("events").EventEmitter
  5876. , c = document.getElementsByClassName("footer")[0]
  5877. , h = c.querySelectorAll(".close")[0]
  5878. , u = null
  5879. , d = null
  5880. , p = null
  5881. , f = (o.isMobile(),
  5882. {
  5883. open: function(e) {
  5884. e && (n(e),
  5885. u && h.removeEventListener("click", u, !0),
  5886. u = function(e, t) {
  5887. t && (t.stopPropagation(),
  5888. t.preventDefault()),
  5889. e && this.emit(s.CLOSE, e),
  5890. f.reset()
  5891. }
  5892. .bind(this, e.id),
  5893. h.addEventListener("click", u, !0),
  5894. d && window.removeEventListener("resize", d, !0),
  5895. d = n.bind(this, e),
  5896. window.addEventListener("resize", d, !0))
  5897. },
  5898. reset: function() {
  5899. c.classList.remove("closeByFooter"),
  5900. h.removeEventListener("click", u, !0),
  5901. window.removeEventListener("resize", d, !0),
  5902. u = d = p = null
  5903. }
  5904. });
  5905. a.extendObject(f, l.prototype),
  5906. t.exports = f
  5907. }
  5908. , {
  5909. "../../tag/Media/MediaEvent": 131,
  5910. "../../settings": 166,
  5911. "../../util/browser": 182,
  5912. "../../util/common": 185,
  5913. "./ModalCloserEvent": 61,
  5914. events: 202
  5915. }],
  5916. 63: [function(e, t, i) {
  5917. "use strict";
  5918. var A = e("../lib/dat.gui")
  5919. , C = e("three")
  5920. , I = e("../util/easing")
  5921. , E = e("../enum/Viewmode")
  5922. , _ = e("../enum/Colors")
  5923. , b = e("../enum/WarpStyle")
  5924. , w = e("../settings");
  5925. e("../tag/tag"),
  5926. A.GUI.prototype.removeFolder = function(e) {
  5927. var t = this.__folders[e];
  5928. t && (t.close(),
  5929. this.__ul.removeChild(t.domElement.parentNode),
  5930. delete this.__folders[e],
  5931. this.onResize())
  5932. }
  5933. ,
  5934. t.exports.toggle = function(t, e, i) {
  5935. var n = new A.GUI({
  5936. width: 400
  5937. })
  5938. , r = n.addFolder("Flydown from Dollhouse");
  5939. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5940. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5941. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5942. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5943. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5944. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5945. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5946. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5947. var o = n.addFolder("Transition between panos");
  5948. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5949. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5950. w.transition.flyTime = 0,
  5951. o.__controllers.forEach(function(e) {
  5952. e.updateDisplay()
  5953. })
  5954. }),
  5955. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5956. w.transition.flySpeed = 0,
  5957. o.__controllers.forEach(function(e) {
  5958. e.updateDisplay()
  5959. })
  5960. }),
  5961. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5962. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5963. o.add(w.transition, "movementEasing", Object.keys(I));
  5964. var a = n.addFolder("Path Display");
  5965. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5966. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5967. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5968. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5969. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5970. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5971. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5972. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5973. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5974. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5975. w.path.color = _[w.path.color],
  5976. w.path.colorUp = _._desat(w.path.color),
  5977. w.path.colorDown = _.darken(w.path.color)
  5978. }),
  5979. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5980. w.reticuleColor = _[w.reticuleColor]
  5981. });
  5982. var s = n.addFolder("Warping")
  5983. , l = s.addFolder("Warp/Teleport");
  5984. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5985. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5986. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5987. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5988. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5989. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5990. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5991. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5992. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5993. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5994. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  5995. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5996. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5997. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  5998. w.path.typ = b[w.path.typ]
  5999. }),
  6000. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  6001. e.endlessLoop = w.warp.loop
  6002. }),
  6003. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  6004. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  6005. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  6006. var c = s.addFolder("Long Warp Only");
  6007. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  6008. w.warp.flySpeed = 0,
  6009. c.__controllers.forEach(function(e) {
  6010. e.updateDisplay()
  6011. })
  6012. }),
  6013. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  6014. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  6015. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  6016. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6017. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6018. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  6019. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  6020. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  6021. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  6022. var h = n.addFolder("Warp Esoterica");
  6023. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  6024. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  6025. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6026. w.warp.minWarpTime = 0,
  6027. h.__controllers.forEach(function(e) {
  6028. e.updateDisplay()
  6029. })
  6030. }),
  6031. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  6032. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  6033. h.add(w.warp, "movementEasing", Object.keys(I));
  6034. var u = n.addFolder("Misc");
  6035. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  6036. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  6037. }),
  6038. u.add(w, "insideFOV", 10, 180).onChange(function() {
  6039. i.cameras[E.PANORAMA].fov = w.insideFOV
  6040. }),
  6041. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  6042. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  6043. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  6044. var d = n.addFolder("Navigation");
  6045. d.add(w.navigation, "panoScores").onFinishChange(function() {
  6046. w.navigation.panoScores || t.panos.forEach(function(e) {
  6047. e.floor.remove(e.text3d),
  6048. e.text3d = null
  6049. })
  6050. }),
  6051. d.add(w.navigation, "mouseDirection"),
  6052. d.add(w.navigation, "filterStrictness", 0, 1),
  6053. d.add(w.navigation, "angleFactor", -60, 0),
  6054. d.add(w.navigation, "directionFactor", 1, 20),
  6055. d.add(w.navigation, "distanceFactor", -5, 5),
  6056. d.add(w.navigation, "optionalityFactor", .1, 10);
  6057. var p = n.addFolder("tags")
  6058. , f = p.addFolder("Tag Creation");
  6059. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  6060. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  6061. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  6062. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  6063. var g = p.addFolder("Visibility");
  6064. g.add(w.tags.visibility, "anyDistance"),
  6065. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  6066. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  6067. g.add(w.tags.visibility, "hideViaFloor"),
  6068. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  6069. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  6070. var m = p.addFolder("Disc Parameters");
  6071. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  6072. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  6073. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  6074. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  6075. }),
  6076. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  6077. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  6078. }),
  6079. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  6080. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  6081. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  6082. var v = p.addFolder("Navigate");
  6083. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  6084. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  6085. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  6086. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  6087. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  6088. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  6089. var y = n.addFolder("Debug");
  6090. y.add(w, "wireframe").onFinishChange(function() {
  6091. t.chunks.forEach(function(e) {
  6092. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  6093. e.wireframeTwin.material.depthWrite = !1,
  6094. e.wireframeTwin.material.depthTest = !1,
  6095. e.wireframeTwin.material.opacity = .5,
  6096. e.wireframeTwin.material.transparent = !0),
  6097. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  6098. })
  6099. }),
  6100. y.add(w, "skyboxWireframe").onFinishChange(function() {
  6101. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  6102. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  6103. t.skybox.wireframe = null)
  6104. }),
  6105. y.add(w, "showSweeps").onFinishChange(function() {
  6106. t.setSweepVisibility(w.showSweeps)
  6107. }),
  6108. y.add(w, "showMesh").onFinishChange(function() {
  6109. t.chunks.forEach(function(e) {
  6110. e.visible = w.showMesh
  6111. })
  6112. }),
  6113. y.add(w, "showFloors").onFinishChange(function() {
  6114. t.floors.forEach(function(e) {
  6115. e.collider.children.forEach(function(e) {
  6116. e.material.visible = w.showFloors
  6117. })
  6118. })
  6119. }),
  6120. y.add(w, "showSkyboxes").onFinishChange(function() {
  6121. t.panos.forEach(function(e) {
  6122. e.skyboxMesh.visible = w.showSkyboxes
  6123. })
  6124. }),
  6125. y.add(w, "showNeighbors").onChange(function() {}),
  6126. y.add(t, "alpha", 0, 1)
  6127. }
  6128. }
  6129. , {
  6130. "../enum/Colors": 19,
  6131. "../enum/Viewmode": 51,
  6132. "../enum/WarpStyle": 52,
  6133. "../lib/dat.gui": 93,
  6134. "../tag/tag": 123,
  6135. "../settings": 166,
  6136. "../util/easing": 186,
  6137. three: 217
  6138. }],
  6139. 64: [function(c, h, e) {
  6140. (function(e) {
  6141. "use strict";
  6142. function i(e, t, i, n) {
  6143. $(".gui-error .error-problem-text").text(e),
  6144. $(".gui-error .error-solution-text").text(t),
  6145. $(".gui-error .error-explanation").text(i),
  6146. $(".gui-error .error-actions").html(n),
  6147. $(window).resize(),
  6148. $(".gui-error").fadeIn(),
  6149. $("#bottom-logo").fadeIn()
  6150. }
  6151. function n(e) {
  6152. 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("");
  6153. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  6154. r.isMobile() || $("[rel=tiletip]").tooltip({
  6155. placement: "bottom",
  6156. delay: {
  6157. show: 50,
  6158. hide: 0
  6159. },
  6160. trigger: "hover",
  6161. viewport: {
  6162. selector: "body",
  6163. padding: 10
  6164. }
  6165. })
  6166. }
  6167. function t() {
  6168. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  6169. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  6170. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  6171. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6172. e.preventDefault(),
  6173. e.stopPropagation(),
  6174. n(" ")
  6175. })
  6176. }
  6177. var r = c("./../util/browser")
  6178. , o = c("./../analytics")
  6179. , a = c("./../settings")
  6180. , s = c("../localization/localize")
  6181. , l = new (c("./../util/logger"))(e);
  6182. h.exports.error = function(e) {
  6183. if ($("head title").text(a.pageTitle),
  6184. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6185. $("#gui-loading").fadeOut(250),
  6186. $("#quick-blackout").hide(),
  6187. o.track("showcase_error", {
  6188. error_key: e
  6189. }),
  6190. s.locale || s.init(),
  6191. "webgl-unsupported" === e)
  6192. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6193. else if ("webgl-ios" === e)
  6194. i(s.ERROR_WEBGL_IOS_PROBLEM, s.ERROR_WEBGL_IOS_SOLUTION, "", s.ERROR_WEBGL_IOS_ACTIONS_1 + "<strong>" + s.ERROR_WEBGL_IOS_ACTIONS_2 + "</strong>.");
  6195. else if ("webgl-safari" === e)
  6196. i(s.ERROR_WEBGL_SAFARI_PROBLEM, "", "", s.ERROR_WEBGL_SAFARI_ACTIONS_1 + "<strong>" + s.ERROR_WEBGL_SAFARI_ACTIONS_2 + "</strong>. " + s.ERROR_WEBGL_SAFARI_ACTIONS_3 + "<strong>" + s.ERROR_WEBGL_SAFARI_ACTIONS_4 + "</strong>.");
  6197. else if ("webgl-generic" === e)
  6198. t();
  6199. else if ("missing-urls" === e)
  6200. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  6201. else if ("loading-failed" === e)
  6202. i(s.ERROR_LOADING_FAILED_PROBLEM, "", "", s.ERROR_LOADING_FAILED_ACTIONS_1 + '<a class="link" target="_blank" href="https://support.port.com/hc/articles/208220058">' + s.ERROR_LOADING_FAILED_ACTIONS_2 + "</a>.");
  6203. else {
  6204. if ("loading-failed-maintenance" !== e)
  6205. return void l.error("Unhandled error: " + e);
  6206. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  6207. }
  6208. }
  6209. }
  6210. ).call(this, "/js/gui/error.js")
  6211. }
  6212. , {
  6213. "../localization/localize": 108,
  6214. "./../analytics": 4,
  6215. "./../settings": 166,
  6216. "./../util/browser": 182,
  6217. "./../util/logger": 189
  6218. }],
  6219. 65: [function(Oe, Le, e) {
  6220. (function(e) {
  6221. "use strict";
  6222. function c() {
  6223. for (var e in Ce)
  6224. if (Ce.hasOwnProperty(e)) {
  6225. var t = Ce[e];
  6226. if (!t.visible)
  6227. for (var i = 0; i < t.elements.length; i++)
  6228. $(t.elements[i]).hide()
  6229. }
  6230. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6231. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  6232. ge = [],
  6233. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  6234. ge.push(".hideTarget", ".pinTop.right")
  6235. }
  6236. function v(e, t) {
  6237. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  6238. $("#gui-zoomin").toggle(i),
  6239. $("#gui-zoomout").toggle(i)
  6240. }
  6241. function l() {
  6242. n(),
  6243. $(".pinBottom").toggleClass("open"),
  6244. $("#drawer").toggleClass("open"),
  6245. $(".footer").toggleClass("open"),
  6246. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  6247. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  6248. O.resetDrawer()),
  6249. setTimeout(function() {
  6250. $("#pullTab").toggleClass("opened")
  6251. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  6252. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  6253. }
  6254. function t(e) {
  6255. var t;
  6256. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6257. t = e.position().top + e.outerHeight(),
  6258. e.attr("style", "display: none")),
  6259. $("#player").outerHeight() - 130 < t + 25
  6260. }
  6261. function y(e) {
  6262. "touchstart" === e.type && e.preventDefault(),
  6263. e.stopPropagation()
  6264. }
  6265. function n() {
  6266. w && (w.reload(),
  6267. w.init())
  6268. }
  6269. function r() {
  6270. $("#gui-spinner").stop(!0, !0),
  6271. $("#gui-spinner").fadeOut(1e3),
  6272. !(Ae = !0)
  6273. }
  6274. function A(e, t) {
  6275. var i = e.mode
  6276. , n = t || e.currentPano;
  6277. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  6278. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  6279. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  6280. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  6281. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  6282. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  6283. $("#gui-modes-outside").removeClass("desktop-only")),
  6284. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  6285. pe = i,
  6286. $("#gui-modes-outside").addClass("hidden"),
  6287. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6288. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  6289. }
  6290. function C(t, i) {
  6291. function e() {
  6292. document.getElementById("vr").classList.remove("hidden"),
  6293. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  6294. S.supportsFullscreen() ? function(e) {
  6295. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  6296. Q.init(t.data, i, e, x),
  6297. Q.on(J.OPENED, _e.bind(gui, "vr")),
  6298. Q.on(J.SHOW_TERMS, W.show.bind(W))
  6299. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  6300. $(".improper-embed").toggleClass("hidden", !1),
  6301. n())
  6302. }, function(e) {
  6303. n()
  6304. }) : n()
  6305. }
  6306. function n() {
  6307. var e;
  6308. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6309. X.init(t.data, x),
  6310. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6311. function() {
  6312. _e("vr"),
  6313. V.open(e)
  6314. }
  6315. )),
  6316. X.on(Z.CLOSED, V.reset)
  6317. }
  6318. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6319. switch (M.vr.option) {
  6320. case le.CONTEXTUAL:
  6321. e();
  6322. break;
  6323. case le.ANDROID:
  6324. S.detectAndroid() && e();
  6325. break;
  6326. case le.NONE:
  6327. }
  6328. }
  6329. function h(e, i) {
  6330. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6331. if ("372" !== getQueryVariable("m")) {
  6332. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6333. $(".gui-floor").find(".container").prepend(r)
  6334. }
  6335. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6336. n.on("click", function(e) {
  6337. y(e),
  6338. _e("floor"),
  6339. n.toggleClass("open")
  6340. }),
  6341. $(".floorChoice").on("click", function(e) {
  6342. y(e);
  6343. var t = $(this).data("index");
  6344. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6345. i.player.gotoFloor(t),
  6346. R.track("showcase_gui", {
  6347. gui_action: "click_floor_select_button",
  6348. interaction_source: "gui"
  6349. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6350. _e("move"),
  6351. i.allFloors(),
  6352. R.track("showcase_gui", {
  6353. gui_action: "click_toggle_all_floors_button",
  6354. interaction_source: "gui"
  6355. })),
  6356. n.removeClass("open")
  6357. })
  6358. }
  6359. function I(e, t) {
  6360. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6361. $(".gui-floor-icon").hide(),
  6362. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6363. $(".gui-floor-icon").show(),
  6364. $(".gui-floor-title").hide()),
  6365. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6366. $(".gui-floor-number").text(se.FLOOR_ALL),
  6367. $(".floorChoice").removeClass("active"),
  6368. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6369. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6370. $(".floorChoice").removeClass("active"),
  6371. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6372. }
  6373. function E() {
  6374. var e = $("#player").width() - 20
  6375. , t = $("#scroller")
  6376. , i = $("#drawer")
  6377. , n = $(".pinBottom");
  6378. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6379. i.addClass("noScroll"),
  6380. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6381. i.toggleClass("noScroll"),
  6382. n.toggleClass("noScroll"))
  6383. }
  6384. function _(e) {
  6385. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6386. e = e || 0,
  6387. Ae = !1,
  6388. window.setTimeout(function() {
  6389. Ae || (!0,
  6390. $("#gui-spinner").stop(!0, !0).show())
  6391. }
  6392. .bind(this), e)
  6393. }(M.modelComponentLoadSpinnerDelay)
  6394. }
  6395. function b(e, t) {
  6396. for (var i = []; e; )
  6397. i.push(e),
  6398. e = e.parentNode;
  6399. for (; t && -1 === i.indexOf(t); )
  6400. t = t.parentNode;
  6401. return t
  6402. }
  6403. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6404. Oe("../util/ajax"),
  6405. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6406. Oe("../util/camera"),
  6407. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6408. Oe("./helpManager")), O = Oe("./immersiveMode"), L = Oe("./loadingScreen"), D = Oe("./landingScreen"), N = Oe("./playButton"), F = Oe("./populateModal"), B = Oe("./memoryUsage"), V = Oe("./closer/modalCloser"), k = Oe("./closer/ModalCloserEvent"), U = Oe("./help/help"), H = Oe("./help/HelpEvent"), z = Oe("./title/titleBar"), G = Oe("./title/TitleEvents"), W = Oe("./terms/terms"), j = Oe("./terms/TermsEvent"), Y = Oe("./title/tagToggle"), q = Oe("./tourInteraction"), X = Oe("./vr/vrModal"), Z = Oe("./vr/vrEvent"), K = Oe("./sharing/modal"), Q = Oe("./webvr/webVRgui"), J = Oe("./webvr/WebVrEvent"), ee = Oe("../controls/serializer"), te = Oe("../enum/Keys"), ie = Oe("../enum/Viewmode"), ne = (Oe("../enum/BlackoutStyle"),
  6409. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6410. Oe("../enum/PathDisplayMode"),
  6411. Oe("../enum/DirectorEvents"),
  6412. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6413. Oe("../enum/WarpStyle"),
  6414. Oe("../enum/AlignmentType"),
  6415. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6416. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6417. coBrand: {
  6418. visible: !0,
  6419. elements: [".co-brand", "#loaderCoBrand"]
  6420. },
  6421. help: {
  6422. visible: !0,
  6423. elements: [".nav-help", "#nav-help"]
  6424. },
  6425. tourControls: {
  6426. visible: !0,
  6427. elements: [".next", ".previous", "#play"]
  6428. },
  6429. highlight: {
  6430. visible: !0,
  6431. elements: ["#drawer", "#pullTab"]
  6432. },
  6433. share: {
  6434. visible: !0,
  6435. elements: [".socialButton", "#share"]
  6436. },
  6437. fullScreen: {
  6438. visible: !0,
  6439. elements: ["#gui-fullscreen"]
  6440. },
  6441. floors: {
  6442. visible: !0,
  6443. elements: [".gui-floor"]
  6444. }
  6445. }, Ie = (g = document.getElementById("drawer"),
  6446. function() {
  6447. $("#player").height() < 400 && g.classList.contains("open") && l()
  6448. }
  6449. ), Ee = (f = document.getElementById("meta-info"),
  6450. function() {
  6451. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6452. }
  6453. ), _e = (i = document.getElementById("meta-info"),
  6454. s = document.getElementById("interaction-modal"),
  6455. u = $("#drawer").eq(0),
  6456. d = $(".gui-floor").eq(0),
  6457. p = $(".vr-popup").eq(0),
  6458. function(e) {
  6459. switch (e) {
  6460. case "info":
  6461. we(),
  6462. Te(),
  6463. Ie(),
  6464. Me(),
  6465. Re(),
  6466. xe(),
  6467. Pe();
  6468. break;
  6469. case "terms":
  6470. be(),
  6471. Te(),
  6472. Se(),
  6473. Me(),
  6474. Re(),
  6475. xe(),
  6476. Pe();
  6477. break;
  6478. case "help":
  6479. be(),
  6480. we(),
  6481. Me(),
  6482. Re(),
  6483. xe(),
  6484. Pe();
  6485. break;
  6486. case "vr":
  6487. be(),
  6488. we(),
  6489. Me(),
  6490. Re(),
  6491. Te(),
  6492. Pe(),
  6493. t(p) && Se();
  6494. break;
  6495. case "highlights":
  6496. Ee(),
  6497. we(),
  6498. Me(),
  6499. Re();
  6500. break;
  6501. case "share":
  6502. be(),
  6503. we(),
  6504. Te(),
  6505. Re(),
  6506. xe(),
  6507. Pe();
  6508. break;
  6509. case "floor":
  6510. we(),
  6511. Me(),
  6512. xe();
  6513. break;
  6514. case "view":
  6515. Re(),
  6516. Me(),
  6517. we(),
  6518. xe();
  6519. break;
  6520. case "tour":
  6521. case "move":
  6522. we(),
  6523. Me(),
  6524. Re(),
  6525. xe();
  6526. break;
  6527. case "resize":
  6528. be(),
  6529. Ie(),
  6530. Re();
  6531. break;
  6532. case "tag":
  6533. we(),
  6534. Te(),
  6535. Me(),
  6536. Re(),
  6537. xe()
  6538. }
  6539. }
  6540. );
  6541. function be() {
  6542. i.classList.contains("expand") && z.toggleMeta(!0)
  6543. }
  6544. function we() {
  6545. W.hide()
  6546. }
  6547. function Te() {
  6548. U.close()
  6549. }
  6550. function xe() {
  6551. X.dismiss()
  6552. }
  6553. function Se() {
  6554. u.hasClass("open") && l()
  6555. }
  6556. function Me() {
  6557. K.hide()
  6558. }
  6559. function Re() {
  6560. d.hasClass("open") && d.removeClass("open")
  6561. }
  6562. function Pe() {
  6563. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6564. }
  6565. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6566. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6567. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6568. setTimeout(function() {
  6569. $(".icon:visible").hide().show(0)
  6570. }, 100)
  6571. }),
  6572. $("#gui-fullscreen").find("a").on("click", function(e) {
  6573. y(e),
  6574. S.requestFullscreen($("body")[0]),
  6575. R.track("showcase_gui", {
  6576. gui_action: "click_enter_fullscreen",
  6577. interaction_source: "gui"
  6578. })
  6579. }),
  6580. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6581. y(e),
  6582. S.exitFullscreen(),
  6583. R.track("showcase_gui", {
  6584. gui_action: "click_exit_fullscreen",
  6585. interaction_source: "gui"
  6586. })
  6587. }),
  6588. $(window).on("resize", function(e) {
  6589. var t = e.target.innerHeight
  6590. , i = e.target.innerWidth;
  6591. t === o && i === a || (Ce.highlight.visible && E(),
  6592. _e("resize"),
  6593. $(".pinTop.right").removeClass("hideUnderMeta"),
  6594. n(),
  6595. o = t,
  6596. a = i)
  6597. }).resize(),
  6598. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6599. $("#pullTab").on("click", function(e) {
  6600. y(e),
  6601. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6602. gui_action: "hide_highlight_reel"
  6603. }),
  6604. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6605. gui_action: "show_highlight_reel"
  6606. }),
  6607. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6608. l()
  6609. }),
  6610. window.MP_PREFETCHED_MODELDATA.showHotListSta && ($("#hotList").css("display", ""),
  6611. $("#hotList").on("click", function(e) {
  6612. y(e);
  6613. var t = $("#hotListWrap")[0];
  6614. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6615. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6616. this.classList.add("active"))
  6617. }),
  6618. $("#hotListContent ul").on("mouseover", function(e) {
  6619. y(e);
  6620. var t = e.target
  6621. , i = document.getElementById("hotListWrap");
  6622. if ("SPAN" === t.tagName) {
  6623. var n = t.parentElement.parentElement;
  6624. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6625. } else if ("LI" === t.tagName) {
  6626. n = t.parentElement;
  6627. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6628. } else
  6629. i.style.width = ""
  6630. }),
  6631. $("#hotListContent ul").on("click", function(e) {
  6632. y(e),
  6633. this.preElem && this.preElem.classList.remove("active"),
  6634. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6635. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player, !0),
  6636. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6637. e.target.hot && e.target.hot.examine(window.player, !0),
  6638. this.preElem = e.target)
  6639. }),
  6640. $("#hotListClose").on("click", function(e) {
  6641. y(e),
  6642. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6643. $("#hotListContent ul .active").removeClass("active"),
  6644. $("#hotList")[0].classList.remove("active")
  6645. })),
  6646. "true" === window.MP_PREFETCHED_MODELDATA.supportsVR && $("#vr").css("display", ""),
  6647. $("#more-menu-button").on("click", function(e) {
  6648. y(e),
  6649. $("#more-menu").toggleClass("open")
  6650. }),
  6651. Le.exports.init = function(s, l, c, e, t, i, n) {
  6652. var r;
  6653. x = n,
  6654. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6655. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6656. F.init(),
  6657. D.init(s, i),
  6658. ce.init(s, l, e),
  6659. $(".icon").on("mouseover", function() {
  6660. l.player && l.player.reticule.hide()
  6661. }),
  6662. function(e, t) {
  6663. var i = t.player;
  6664. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6665. y(e),
  6666. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6667. R.track("USER", {
  6668. event_type: "showcase_gui",
  6669. gui_action: "click_inside_mode_button"
  6670. }),
  6671. t.changeMode(ie.PANORAMA)
  6672. }),
  6673. $("#gui-modes-outside").find("a").on("click", function(e) {
  6674. y(e),
  6675. R.track("showcase_gui", {
  6676. gui_action: "click_outside_mode_button"
  6677. }),
  6678. t.changeMode(pe)
  6679. }),
  6680. $("#gui-modes-floorplan").on("click", function(e) {
  6681. y(e),
  6682. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6683. gui_action: "click_floorplan_mode_button"
  6684. }),
  6685. t.changeMode(ie.FLOORPLAN))
  6686. }),
  6687. $("#gui-modes-dollhouse").on("click", function(e) {
  6688. y(e),
  6689. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6690. gui_action: "click_dollhouse_mode_button"
  6691. }),
  6692. t.changeMode(ie.DOLLHOUSE))
  6693. })
  6694. }(0, l),
  6695. function(e, t) {
  6696. $("#play").on("mousedown touchstart", function(e) {
  6697. y(e),
  6698. _e("tour"),
  6699. q.play(),
  6700. R.trackAlways("showcase_gui", {
  6701. gui_action: "play_highlights"
  6702. })
  6703. }),
  6704. window.startAndPlay = function(e) {
  6705. _e("tour"),
  6706. q.play(),
  6707. R.trackAlways("showcase_gui", {
  6708. gui_action: "play_highlights"
  6709. })
  6710. }
  6711. ,
  6712. $("#pause").on("mousedown touchstart", function(e) {
  6713. y(e),
  6714. q.pause(),
  6715. R.trackAlways("showcase_gui", {
  6716. gui_action: "pause_highlights"
  6717. })
  6718. }),
  6719. $("#gui-zoomin").find("a").on("click", function(e) {
  6720. y(e),
  6721. t.player.zoomInIncrementally()
  6722. }),
  6723. $("#gui-zoomout").find("a").on("click", function(e) {
  6724. y(e),
  6725. t.player.zoomOutIncrementally()
  6726. })
  6727. }(0, l),
  6728. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(MP_PREFETCHED_MODELDATA.name/* s.data.name */),
  6729. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6730. function() {
  6731. _e("share"),
  6732. V.open(r)
  6733. }
  6734. )),
  6735. K.on(ae.CLOSED, V.reset)),
  6736. 0 < s.heroLocations.length ? function(e, i, t) {
  6737. var n = 100 / (fe = e.heroLocations.length) + "%"
  6738. , r = $("#thumb-container")
  6739. , o = $("#progressBar");
  6740. $("#status").find(".totalSteps").text(fe);
  6741. for (var a = 0; a < fe; a++) {
  6742. var s = e.heroLocations[a]
  6743. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6744. if(s.heroLocations){//有子项,选第一张截图
  6745. var tmp = s.heroLocations[0].thumbUrl.replace('https://','').replace('http://','')
  6746. }else{
  6747. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6748. }
  6749. if (l.attr("data-index", a),
  6750. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6751. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6752. s.name) {
  6753. var c = $('<div class="overlay"></div>').text(s.name);
  6754. l.prepend(c)
  6755. }
  6756. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6757. var h = e.panos.get(s.panoId)
  6758. , u = h && !h.isAligned() ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  6759. l.prepend(u)
  6760. }
  6761. r.append(l),
  6762. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6763. }
  6764. T = 144 * fe,
  6765. 111 * fe,
  6766. $(".thumbImg").on("mouseover", function() {
  6767. !function(e) {
  6768. return e.describe().inTransition
  6769. }(i) && t.showPathToHeroLocation([$(this).data("index"),0])//改
  6770. }),
  6771. $(".thumbImg").on("mouseout", function() {
  6772. i.clearPath()
  6773. }),
  6774. $(".thumbImg").on("click", function(e) {
  6775. y(e);
  6776. var t = $(this);
  6777. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6778. R.trackAlways("showcase_gui", {
  6779. gui_action: "click_highlight"
  6780. }),
  6781. i.goToHighlight([t.data("index"),0])//改
  6782. }),
  6783. $(".previous").find("a").on("click", function(e) {
  6784. y(e),
  6785. R.trackAlways("showcase_gui", {
  6786. gui_action: "prev_highlight"
  6787. }),
  6788. i.prevHighlight()
  6789. }),
  6790. $(".next").find("a").on("click", function(e) {
  6791. y(e),
  6792. R.trackAlways("showcase_gui", {
  6793. gui_action: "next_highlight"
  6794. }),
  6795. i.nextHighlight()
  6796. }),
  6797. $("#drawer").on("mouseleave", function(t) {
  6798. var i;
  6799. y(t);
  6800. try {
  6801. i = new MouseEvent("mouseup",{
  6802. clientX: t.clientX,
  6803. clientY: t.clientY,
  6804. screenX: t.screenX,
  6805. screenY: t.screenY
  6806. })
  6807. } catch (e) {
  6808. (i = document.createEvent("MouseEvents")).initMouseEvent("mouseup", 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)
  6809. }
  6810. document.dispatchEvent(i)
  6811. }),
  6812. (w = new Sly($("#scrollFrame"),{
  6813. horizontal: !0,
  6814. itemNav: "centered",
  6815. smart: !0,
  6816. scrollTrap: !0,
  6817. scrollBy: 1,
  6818. mouseDragging: !0,
  6819. touchDragging: !0,
  6820. speed: 300,
  6821. dragHandle: !0,
  6822. dynamicHandle: !0,
  6823. clickBar: !0,
  6824. scrollBar: $("#scroller"),
  6825. activateOn: null
  6826. }).init()).on("active", function(e, t) {
  6827. t,
  6828. _e("tour"),
  6829. $(".step").removeClass("active"),
  6830. $("#status").find(".curIdx").text(t + 1);
  6831. for (var i = 0; i <= t; i++)
  6832. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6833. }),
  6834. E()
  6835. }(s, l, c) : (Ce.highlight.visible = !1,
  6836. Ce.tourControls.visible = !1),
  6837. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6838. function() {
  6839. var n;
  6840. document.body.addEventListener("mousedown", function(e) {
  6841. n = 0 === e.button || 1 === e.which ? e.target : null
  6842. }, !0),
  6843. document.body.addEventListener("mouseup", function(t) {
  6844. n !== t.target && (n = b(n, t.target));
  6845. var e = document.getElementById("gui-parent");
  6846. if (b(e, n) !== e && (n = null),
  6847. n) {
  6848. var i;
  6849. try {
  6850. i = new MouseEvent("click",t)
  6851. } catch (e) {
  6852. (i = document.createEvent("MouseEvents")).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)
  6853. }
  6854. i.syntheticClick = !0,
  6855. n.dispatchEvent(i),
  6856. n = null
  6857. }
  6858. }, !0),
  6859. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6860. e.syntheticClick || (e.stopPropagation(),
  6861. "A" === e.target.nodeName && e.preventDefault())
  6862. }, !0)
  6863. }(),
  6864. A(c),
  6865. C(s, t),
  6866. s.on("floor.changed", I),
  6867. s.on("waiting", function(e) {
  6868. _(e)
  6869. }
  6870. .bind(this, s)),
  6871. s.on("waiting-done", function(e) {
  6872. _(e)
  6873. }
  6874. .bind(this, s)),
  6875. c.on(re.ModeChanged, function(e, t) {
  6876. A(c),
  6877. v(l, c),
  6878. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6879. U.updateMode(t)
  6880. }),
  6881. e.on(oe.Move, _e.bind(this, "move")),
  6882. c.on(re.Ready, function() {
  6883. O.init(e, c, c.tagManager, l),
  6884. c.on(re.ModeChanged, function(e, t) {
  6885. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6886. })
  6887. }),
  6888. c.on(re.PanoChosen, function(e, t) {
  6889. A(c, t),
  6890. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6891. }),
  6892. V.on(k.CLOSE, function(e) {
  6893. switch (e) {
  6894. case "vr-modal":
  6895. X.dismiss();
  6896. break;
  6897. case "share-modal":
  6898. K.hide();
  6899. break;
  6900. case "terms-modal":
  6901. W.hide()
  6902. }
  6903. });
  6904. var o, h = $("#play").eq(0), u = $("#pause").eq(0), d = $(".pinBottom").toArray(), p = $("#drawer").eq(0), f = $("#playHead").eq(0), a = $("#progressBar").eq(0), g = $("#thumb-container").eq(0).children(), m = a.children();
  6905. l.on("update.controls", function() {
  6906. var e, t, i, n = l.describe();
  6907. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6908. u.show()),
  6909. n.tourInProgress && (d.forEach(function(e) {
  6910. e.classList.add("playing")
  6911. }),
  6912. p.addClass("playing"),
  6913. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6914. u.hide()),
  6915. n.tourInProgress || (q.stopTour(),
  6916. d.forEach(function(e) {
  6917. e.classList.remove("playing")
  6918. }),
  6919. p.removeClass("playing"),
  6920. f.removeClass("playing"))),
  6921. null !== n.currentItem) {
  6922. var r, o;
  6923. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6924. n.onTheBus ? (r = "active",
  6925. o = "recent") : (o = "active",
  6926. r = "recent");
  6927. var a = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6928. for (e = 0; e < s.heroLocations.length; e += 1)
  6929. i = g.eq(e),
  6930. t = m.eq(e),
  6931. i.removeClass(o),
  6932. t.removeClass(o),
  6933. n.onTheBus && e === n.destinationItem[0] ? (i.addClass(r),
  6934. t.addClass(r),
  6935. w.activate(e)) : n.onTheBus && a && e === n.currentItem[0] ? (i.addClass(r),
  6936. t.addClass(r)) : (i.removeClass(r),
  6937. t.removeClass(r))
  6938. } else
  6939. for (e = 0; e < s.heroLocations.length; e += 1)
  6940. i = g.eq(e),
  6941. t = m.eq(e),
  6942. i.removeClass("active recent"),
  6943. t.removeClass("active recent");
  6944. v(l, c)
  6945. }),
  6946. document.addEventListener("keydown", function(e) {
  6947. switch (R.updateInteraction(oe.InteractionKey),
  6948. e.which) {
  6949. case te.ZERO:
  6950. M.debug && s.toggleAlpha();
  6951. break;
  6952. case te.NINE:
  6953. M.debug && B.toggle();
  6954. break;
  6955. case te.ONE:
  6956. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6957. break;
  6958. case te.TWO:
  6959. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6960. break;
  6961. case te.THREE:
  6962. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6963. break;
  6964. case te.FOUR:
  6965. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6966. break;
  6967. case te.SPACE:
  6968. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6969. break;
  6970. case te.RETURN:
  6971. M.debug && s.toggleExplodeUp();
  6972. break;
  6973. case te.P:
  6974. !function(e) {
  6975. me.gui || (me.gui = function(e) {
  6976. var t = new he.GUI;
  6977. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6978. e.setSweepVisibility(M.showSweeps)
  6979. }),
  6980. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6981. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6982. M.transition.flySpeed = 0,
  6983. t.__controllers.forEach(function(e) {
  6984. e.updateDisplay()
  6985. })
  6986. }),
  6987. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6988. $(t.__closeButton).hide(),
  6989. t
  6990. }(me.model)),
  6991. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6992. }(!me.visible);
  6993. break;
  6994. case te.U:
  6995. !function(e) {
  6996. ve.gui || (ve.gui = function(t, i) {
  6997. function e() {
  6998. var e = i.toJSON();
  6999. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  7000. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  7001. }
  7002. var n = {}
  7003. , r = new he.GUI({
  7004. autoPlace: !0,
  7005. width: "60%"
  7006. });
  7007. return e(),
  7008. i.on(re.ViewChanged, e),
  7009. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  7010. r.domElement.id = "datLinks",
  7011. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  7012. if (!S.detectSafari()) {
  7013. var t = document.createElement("button");
  7014. t.classList.add("btn-deep-link"),
  7015. t.innerText = se.MENU_COPY,
  7016. e.nextSibling.appendChild(t);
  7017. var n = function() {
  7018. alert(se.LINK_ALERT_COPY),
  7019. t.hide()
  7020. };
  7021. t.addEventListener("click", function(e) {
  7022. try {
  7023. var t = e.target.parentNode.childNodes[0];
  7024. t.select();
  7025. var i = document.execCommand("copy");
  7026. t.blur(),
  7027. i || n()
  7028. } catch (e) {
  7029. n()
  7030. }
  7031. })
  7032. }
  7033. }),
  7034. $(r.__closeButton).hide(),
  7035. r
  7036. }(ve.model, ve.player)),
  7037. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  7038. }(!ve.visible);
  7039. break;
  7040. case te.X:
  7041. M.debug && s.toggleExplode();
  7042. break;
  7043. case te.PLUSEQUALS:
  7044. l.player.activatePersistentZooming(!0),
  7045. O.hideUi();
  7046. break;
  7047. case te.DASHUNDERSCORE:
  7048. l.player.activatePersistentZooming(!1),
  7049. O.hideUi();
  7050. break;
  7051. case te.SEVEN:
  7052. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  7053. break;
  7054. case te.EIGHT:
  7055. l.player.decreaseZoomSpeed();
  7056. break;
  7057. case te.NINE:
  7058. l.player.increaseZoomSpeed()
  7059. }
  7060. return c && c.reticule.hide(),
  7061. !0
  7062. }
  7063. .bind(this)),
  7064. document.addEventListener("keyup", function(e) {
  7065. switch (e.which) {
  7066. case te.PLUSEQUALS:
  7067. l.player.deactivatePersistentZooming();
  7068. break;
  7069. case te.DASHUNDERSCORE:
  7070. l.player.deactivatePersistentZooming()
  7071. }
  7072. }
  7073. .bind(this)),
  7074. function(e) {
  7075. me = {
  7076. gui: null,
  7077. visible: !1,
  7078. model: e
  7079. }
  7080. }(s),
  7081. function(e, t) {
  7082. ve = {
  7083. gui: null,
  7084. visible: !1,
  7085. model: e,
  7086. player: t
  7087. }
  7088. }(s, l.player),
  7089. function(e) {
  7090. function t(e, i) {
  7091. $(e).find("a").each(function(e, t) {
  7092. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  7093. t.style.pointerEvents = i ? "auto" : "none"
  7094. })
  7095. }
  7096. e.on(de.ZoomMax, function() {
  7097. t("#gui-zoomin", !1),
  7098. t("#gui-zoomout", !0)
  7099. }),
  7100. e.on(de.ZoomMin, function() {
  7101. t("#gui-zoomin", !0),
  7102. t("#gui-zoomout", !1)
  7103. }),
  7104. e.on(de.ZoomIn, function() {
  7105. t("#gui-zoomout", !0)
  7106. }),
  7107. e.on(de.ZoomOut, function() {
  7108. t("#gui-zoomin", !0)
  7109. }),
  7110. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  7111. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  7112. }(c),
  7113. P.setAutoPlay(s.heroCount()),
  7114. U.init(c, i.mode),
  7115. U.on(H.OPENED, _e.bind(this, "help")),
  7116. W.init(),
  7117. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  7118. function() {
  7119. _e("terms"),
  7120. V.open(o)
  7121. }
  7122. )),
  7123. W.on(j.CLOSED, V.reset),
  7124. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  7125. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  7126. M.profiling.enabled && B.show(),
  7127. q.init(l)
  7128. }
  7129. ,
  7130. Le.exports.startLoading = function(e, t, i, n, r, o) {
  7131. function a() {
  7132. o.setLoadingStartTime(),
  7133. function() {
  7134. function e(e) {
  7135. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  7136. }
  7137. $("body").css("touch-action", "none"),
  7138. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  7139. var t = document.getElementById("terms-text")
  7140. , i = document.getElementById("more-help-wrapper")
  7141. , n = (document.getElementById("navigation-help-wrapper"),
  7142. document.getElementById("help-dialog"),
  7143. document.getElementById("tag-billboards"));
  7144. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  7145. passive: !1
  7146. }),
  7147. document.body.addEventListener("DOMMouseScroll", e)),
  7148. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7149. e.stopPropagation()
  7150. })
  7151. }(),
  7152. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  7153. l()) : function(e) {
  7154. L.show(e),
  7155. c()
  7156. }(l)
  7157. }
  7158. var s = $.Deferred()
  7159. , l = s.resolve.bind(s);
  7160. ye = !0,
  7161. _(e);
  7162. e.data.player_options && function(e) {
  7163. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  7164. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  7165. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  7166. }(e.data.player_options),
  7167. 1 === M.specialEdition && $("body").addClass("specialEdition");
  7168. se.localizeGUI();
  7169. !function(i) {
  7170. function e(e, t) {
  7171. return !!i.player_options[e] && i[t || e]
  7172. }
  7173. $(".model-title").text(i.name);
  7174. var t = M.pageTitle;
  7175. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  7176. document.title = t,
  7177. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  7178. delay: {
  7179. show: 50,
  7180. hide: 0
  7181. },
  7182. trigger: "hover",
  7183. html: !1,
  7184. viewport: {
  7185. selector: "body",
  7186. padding: 10
  7187. }
  7188. }),
  7189. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  7190. z.populate({
  7191. name: e("model_name", "name"),
  7192. coBrand: e("presented_by"),
  7193. description: e("model_summary", "summary") || "暂无内容",
  7194. contactName: e("contact_name"),
  7195. address: e("address"),
  7196. phone: e("contact_phone"),
  7197. formattedPhone: i.formatted_contact_phone,
  7198. email: e("contact_email"),
  7199. url: e("external_url"),
  7200. socialSharing: i.enable_social_sharing && i.is_public
  7201. })
  7202. }(e.data);
  7203. r || $(".quick").addClass("hidden");
  7204. n ? (R.impression(),
  7205. a()) : (o.setWaitingStartTime(),
  7206. N.show(r, a))
  7207. return s
  7208. }
  7209. ,
  7210. Le.exports.endLoading = function(e, t, i) {
  7211. var n = t.player;
  7212. function r() {
  7213. i.dismissExaminedTag(),
  7214. i.disableHovering()
  7215. }
  7216. $("#gui-thumb").fadeOut(2500),
  7217. L.hide(function() {
  7218. ye = !1
  7219. }),
  7220. Y.init(e, i),
  7221. z.finishSetup(Object.keys(e.tags).length),
  7222. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  7223. X.on(Z.OPENED, r),
  7224. K.on(ae.OPENED, r),
  7225. U.on(H.OPENED, r),
  7226. W.on(j.OPENED, r);
  7227. var o = i.enableHovering.bind(i);
  7228. if (X.on(Z.CLOSED, o),
  7229. K.on(ae.CLOSED, o),
  7230. U.on(H.CLOSED, o),
  7231. W.on(j.CLOSED, o),
  7232. M.labels.enabled && Object.keys(e.labels).length,
  7233. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  7234. I(e.currentFloor, n.mode)),
  7235. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  7236. h(e, t)),
  7237. c(),
  7238. v(t, t.player),
  7239. $("#gui").fadeIn(1500),
  7240. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  7241. l(),
  7242. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  7243. }, 2e3),
  7244. !S.isMobile())
  7245. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  7246. $(a[s]).addClass("hasHover");
  7247. _(e),
  7248. z.setupToggling(),
  7249. window.editHotPanel && editHotPanel(),
  7250. function() {
  7251. var i = $("#pullTab")
  7252. , e = {
  7253. bottom: {
  7254. "border-bottom-left-radius": "10px",
  7255. "border-bottom-right-radius": "10px"
  7256. },
  7257. top: {
  7258. "border-top-left-radius": "10px",
  7259. "border-top-right-radius": "10px"
  7260. }
  7261. }
  7262. , t = {
  7263. bottom: {
  7264. "border-top-right-radius": "10px",
  7265. "border-bottom-right-radius": "10px"
  7266. },
  7267. top: {
  7268. "border-bottom-left-radius": "10px",
  7269. "border-top-left-radius": "10px"
  7270. }
  7271. };
  7272. function n(e, t) {
  7273. $("#gui-modes-map > div:visible:last").css(e),
  7274. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  7275. }
  7276. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  7277. (window.MP_PREFETCHED_MODELDATA.model.special || "true" === window.MP_PREFETCHED_MODELDATA.special) && window.specialScene && specialScene.special().afterImplement()
  7278. }()
  7279. }
  7280. ,
  7281. Le.exports.onProgress = function(e) {
  7282. L.progress(e)
  7283. }
  7284. }
  7285. ).call(this, "/js/gui/gui.js")
  7286. }
  7287. , {
  7288. "../analytics": 4,
  7289. "../controls/serializer": 14,
  7290. "../enum/AlignmentType": 17,
  7291. "../enum/BlackoutStyle": 18,
  7292. "../enum/ControlEvents": 21,
  7293. "../enum/DirectorEvents": 23,
  7294. "../enum/Keys": 30,
  7295. "../enum/PathDiscardMode": 38,
  7296. "../enum/PathDisplayMode": 39,
  7297. "../enum/PlayerEvents": 40,
  7298. "../enum/VROption": 47,
  7299. "../enum/Vectors": 50,
  7300. "../enum/Viewmode": 51,
  7301. "../enum/WarpStyle": 52,
  7302. "../enum/ZoomEvents": 53,
  7303. "../lib/dat.gui": 93,
  7304. "../localization/localize": 108,
  7305. "../tag/Media/MediaEvent": 131,
  7306. "../objects/Snapshot": 153,
  7307. "../settings": 166,
  7308. "../util/ajax": 181,
  7309. "../util/browser": 182,
  7310. "../util/camera": 183,
  7311. "../util/logger": 189,
  7312. "../util/showcase": 193,
  7313. "../util/transitions": 195,
  7314. "./closer/ModalCloserEvent": 61,
  7315. "./closer/modalCloser": 62,
  7316. "./help/HelpEvent": 66,
  7317. "./help/help": 67,
  7318. "./helpManager": 68,
  7319. "./immersiveMode": 69,
  7320. "./konami": 70,
  7321. "./landingScreen": 71,
  7322. "./loadingScreen": 72,
  7323. "./memoryUsage": 73,
  7324. "./playButton": 74,
  7325. "./populateModal": 75,
  7326. "./sharing/ShareEvents": 76,
  7327. "./sharing/modal": 77,
  7328. "./terms/TermsEvent": 78,
  7329. "./terms/terms": 79,
  7330. "./title/TitleEvents": 80,
  7331. "./title/tagToggle": 81,
  7332. "./title/titleBar": 82,
  7333. "./tourInteraction": 84,
  7334. "./vr/vrEvent": 85,
  7335. "./vr/vrModal": 87,
  7336. "./webvr/WebVrEvent": 88,
  7337. "./webvr/webVRgui": 89,
  7338. three: 217
  7339. }],
  7340. 66: [function(e, t, i) {
  7341. "use strict";
  7342. t.exports = Object.freeze({
  7343. OPENED: "help.opened",
  7344. CLOSED: "help.closed"
  7345. })
  7346. }
  7347. , {}],
  7348. 67: [function(e, t, i) {
  7349. "use strict";
  7350. function n() {
  7351. p.on("click", function(e) {
  7352. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7353. setTimeout(function() {
  7354. x = !1
  7355. }, h.help.modalStayDuration),
  7356. S.emit(l.OPENED),
  7357. f.addClass("open " + T),
  7358. p.addClass("open"),
  7359. o(),
  7360. r(),
  7361. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7362. v.classList.add("fadeIn")))
  7363. }),
  7364. E.on("click", function(e) {
  7365. S.close()
  7366. }),
  7367. C.on("click", function(e) {
  7368. T && T !== a.TRANSITIONING && (o(),
  7369. r())
  7370. }),
  7371. I.on("click", function(e) {
  7372. o(),
  7373. I.addClass("underline-tab"),
  7374. c.fill(b, s.MORE_HELP),
  7375. f.addClass("more-help")
  7376. })
  7377. }
  7378. function r() {
  7379. C.addClass("underline-tab"),
  7380. c.fill(_, s.NAVIGATION, T),
  7381. f.addClass(T)
  7382. }
  7383. function o() {
  7384. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7385. A.forEach(function(e) {
  7386. e.classList.remove("underline-tab")
  7387. })
  7388. }
  7389. var a = e("../../enum/Viewmode")
  7390. , s = e("../../enum/HelpModalType")
  7391. , l = e("./HelpEvent")
  7392. , c = (e("../helpManager"),
  7393. e("./../populateModal"))
  7394. , h = e("../../settings")
  7395. , u = e("../../util/common")
  7396. , d = e("events").EventEmitter
  7397. , p = $(".footer-help").eq(0)
  7398. , f = $("#help-dialog").eq(0)
  7399. , g = document.querySelector("#quick-logo")
  7400. , m = document.querySelector("#loaderCoBrand")
  7401. , v = document.querySelector("#help-dialog")
  7402. , y = document.querySelector(".footer")
  7403. , A = $(".help-tabs").children().toArray()
  7404. , C = $(".navigation-tab").eq(0)
  7405. , I = $(".more-help-tab").eq(0)
  7406. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7407. f.find(".close").eq(0))
  7408. , _ = f.find(".interactions").toArray()
  7409. , b = f.find(".ui-instructions").toArray()
  7410. , w = a.PANORAMA
  7411. , T = a.PANORAMA
  7412. , x = !1
  7413. , S = {
  7414. init: function(e, t) {
  7415. w = T = t,
  7416. [v, m, g, y].forEach(function(e) {
  7417. e.classList.add(c.deviceType)
  7418. }),
  7419. n()
  7420. },
  7421. close: function() {
  7422. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7423. p.removeClass("open"),
  7424. f.removeClass("open"),
  7425. v.classList.contains("fadeIn"))) {
  7426. v.classList.remove("fadeIn");
  7427. var e = T === a.TRANSITIONING ? w : T;
  7428. c.clear(_, s.NAVIGATION, e)
  7429. }
  7430. },
  7431. updateMode: function(e) {
  7432. w = T,
  7433. T = e
  7434. }
  7435. };
  7436. u.extendObject(S, d.prototype),
  7437. t.exports = S
  7438. }
  7439. , {
  7440. "../../enum/HelpModalType": 28,
  7441. "../../enum/Viewmode": 51,
  7442. "../../settings": 166,
  7443. "../../util/common": 185,
  7444. "../helpManager": 68,
  7445. "./../populateModal": 75,
  7446. "./HelpEvent": 66,
  7447. events: 202
  7448. }],
  7449. 68: [function(s, l, e) {
  7450. (function(e) {
  7451. "use strict";
  7452. var t = s("../util/browser")
  7453. , i = s("./../util/logger")
  7454. , n = s("./../settings")
  7455. , r = new i(e)
  7456. , o = function() {
  7457. var t;
  7458. try {
  7459. return t = window.localStorage.getItem("visitCount") || "0",
  7460. t = (parseFloat(t) + 1).toString(),
  7461. window.localStorage.setItem("visitCount", t),
  7462. r.debug("visitCount = " + t),
  7463. t
  7464. } catch (e) {
  7465. t = "1",
  7466. r.debug("couldn't set local storage")
  7467. }
  7468. }()
  7469. , a = !1;
  7470. l.exports = {
  7471. isHelpDisabled: function() {
  7472. return "0" === t.valueFromHash("help", null) || a
  7473. },
  7474. isLargeHelpEnabled: function() {
  7475. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7476. },
  7477. isSmallHelpEnabled: function() {
  7478. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7479. },
  7480. isHelpEnabled: function() {
  7481. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7482. },
  7483. setAutoPlay: function(e) {
  7484. a = 0 <= n.warp.auto && 1 < e
  7485. }
  7486. }
  7487. }
  7488. ).call(this, "/js/gui/helpManager.js")
  7489. }
  7490. , {
  7491. "../util/browser": 182,
  7492. "./../settings": 166,
  7493. "./../util/logger": 189
  7494. }],
  7495. 69: [function(e, t, i) {
  7496. "use strict";
  7497. function r(e) {
  7498. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7499. T = !0,
  7500. h.close(),
  7501. function(e) {
  7502. !n(e) && S ? v.forEach(function(e) {
  7503. e.classList.remove("drawerOpen"),
  7504. e.classList.add("duringTour")
  7505. }) : C.hasClass("open") ? v.forEach(function(e) {
  7506. e.classList.remove("duringTour"),
  7507. e.classList.add("drawerOpen")
  7508. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7509. e.classList.add("fadeOut")
  7510. })
  7511. }(e),
  7512. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7513. C.hasClass("playing") || (y.forEach(function(e) {
  7514. e.classList.add("detectHover")
  7515. }),
  7516. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7517. }
  7518. function o() {
  7519. C.hasClass("playing") || (clearTimeout(x),
  7520. x = setTimeout(a, c.immersive.timeToShowAgain))
  7521. }
  7522. function a() {
  7523. clearTimeout(x),
  7524. T = !1,
  7525. m.forEach(function(e) {
  7526. e.classList.remove("drawerOpen")
  7527. }),
  7528. S || v.forEach(function(e) {
  7529. e.classList.remove("duringTour")
  7530. }),
  7531. y.forEach(function(e) {
  7532. e.classList.remove("detectHover")
  7533. })
  7534. }
  7535. function s() {
  7536. T ? a() : r(),
  7537. M = !0,
  7538. setTimeout(function() {
  7539. M = !1
  7540. }, c.immersive.uiStayDuration)
  7541. }
  7542. function n(e) {
  7543. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7544. }
  7545. var l = e("../util/browser")
  7546. , c = e("../settings")
  7547. , h = e("./help/help")
  7548. , u = e("../enum/tagEvents")
  7549. , d = e("../enum/ControlEvents")
  7550. , p = e("../enum/PlayerEvents")
  7551. , f = e("../enum/DirectorEvents")
  7552. , g = (p = e("../enum/PlayerEvents"),
  7553. e("../enum/Viewmode"))
  7554. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7555. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7556. , y = $("#hover-bottom, #hover-top").toArray()
  7557. , A = ($("#pullTab").eq(0),
  7558. $("#playHead").eq(0),
  7559. $(".pinBottom-container").eq(0))
  7560. , C = $("#drawer").eq(0)
  7561. , I = $("#drawer-container").eq(0)
  7562. , E = $("#meta-info").eq(0)
  7563. , _ = $(".pinTop.left").eq(0)
  7564. , b = $("#player").eq(0)
  7565. , w = document.getElementById("pullTab")
  7566. , T = !1
  7567. , x = null
  7568. , S = !1
  7569. , M = !1
  7570. , R = null
  7571. , P = !1;
  7572. t.exports.init = function(e, t, i, n) {
  7573. (function(t, i, e, n) {
  7574. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7575. t.controls[e].on(d.Move, r),
  7576. t.controls[e].on(d.LongTap, s)
  7577. }),
  7578. b.on("mousewheel DOMMouseScroll", r),
  7579. e.on(u.TagActivated, r),
  7580. e.on(u.TagNavigation, r),
  7581. i.on(p.FlyingEnded, o),
  7582. i.on(p.ModeChanging, function(e, t) {
  7583. P = t !== g.PANORAMA && e !== g.PANORAMA
  7584. }),
  7585. i.on(p.ModeChanged, function(e, t) {
  7586. R = i.mode,
  7587. t !== g.TRANSITIONING ? a() : r("modeChange")
  7588. }),
  7589. n.on(f.TourStart, function() {
  7590. S = !0,
  7591. r()
  7592. }),
  7593. n.on(f.TourEnd, function() {
  7594. S = !1,
  7595. a()
  7596. }),
  7597. n.on(f.ActionInterrupted, function() {
  7598. S = !1
  7599. }),
  7600. w.addEventListener("touchend", function() {
  7601. $("#pullTab").hasClass("opened") && !S && a()
  7602. }, !0)
  7603. }
  7604. )(e, t, i, n),
  7605. l.isMobile() ? (y.forEach(function(e) {
  7606. e.classList.add("mobile")
  7607. }),
  7608. A.click(a)) : (y.forEach(function(e) {
  7609. e.addEventListener("mouseleave", function() {
  7610. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7611. }, !0)
  7612. }),
  7613. b.mouseleave(function() {
  7614. y[0].classList.contains("detectHover") && a()
  7615. })),
  7616. R = t.mode
  7617. }
  7618. ,
  7619. t.exports.hideUi = r,
  7620. t.exports.resetDrawer = function() {
  7621. I.hasClass("duringTour") || (S = !1,
  7622. r("gui"),
  7623. a())
  7624. }
  7625. }
  7626. , {
  7627. "../enum/ControlEvents": 21,
  7628. "../enum/DirectorEvents": 23,
  7629. "../enum/tagEvents": 32,
  7630. "../enum/PlayerEvents": 40,
  7631. "../enum/Viewmode": 51,
  7632. "../settings": 166,
  7633. "../util/browser": 182,
  7634. "./help/help": 67
  7635. }],
  7636. 70: [function(i, n, e) {
  7637. (function(e) {
  7638. "use strict";
  7639. var t = i("./../util/logger")
  7640. , o = i("./../settings")
  7641. , a = i("./debug")
  7642. , s = i("./../util/common")
  7643. , l = (i("./gui"),
  7644. new t(e));
  7645. o.console && $("body").append('<div id="debug-console"></div>'),
  7646. n.exports.init = function(i, n, r) {
  7647. l.debug("konami has the modelInstance");
  7648. var t = [];
  7649. $(window).on("keydown", function(e) {
  7650. t.push(e.which),
  7651. t.length > o.secretPanelWord.length && t.shift(),
  7652. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7653. o.debug = !0)
  7654. }),
  7655. $(window).on("keydown", function e(t) {
  7656. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7657. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7658. })
  7659. }
  7660. }
  7661. ).call(this, "/js/gui/konami.js")
  7662. }
  7663. , {
  7664. "./../settings": 166,
  7665. "./../util/common": 185,
  7666. "./../util/logger": 189,
  7667. "./debug": 63,
  7668. "./gui": 65
  7669. }],
  7670. 71: [function(e, t, i) {
  7671. "use strict";
  7672. function r() {
  7673. s.clear(m, l.LANDING[v]),
  7674. g.removeClass("fadeIn")
  7675. }
  7676. var o = e("../settings")
  7677. , a = (e("./help/help"),
  7678. e("./helpManager"))
  7679. , s = e("./populateModal")
  7680. , l = e("../enum/HelpModalType")
  7681. , n = e("../enum/Viewmode")
  7682. , c = e("../enum/DirectorEvents")
  7683. , h = e("../enum/PlayerEvents")
  7684. , u = $("#quick-blackout").eq(0)
  7685. , d = $("#quick-logo").eq(0)
  7686. , p = $(".quick-brand").toArray()
  7687. , f = $("#loaderCoBrand").eq(0)
  7688. , g = $("#interaction-modal").eq(0)
  7689. , m = g.find(".interaction").toArray()
  7690. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7691. "");
  7692. t.exports.delayLanding = function(e) {
  7693. var t = $.Deferred();
  7694. e || t.resolve();
  7695. var i = o.startupFlyinDelay;
  7696. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7697. setTimeout(t.resolve.bind(t), i),
  7698. t
  7699. }
  7700. ,
  7701. t.exports.showMessage = function(e, t, i) {
  7702. var n = 0;
  7703. o.quickstart.enabled && (function(e) {
  7704. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7705. d.before(f),
  7706. p = $(".quick-brand").toArray()), */
  7707. u.addClass("fadeOut")
  7708. /* setTimeout(function() {
  7709. p.forEach(function(e) {
  7710. e.classList.add("fadeIn")
  7711. })
  7712. }, o.quickstart.showTextDelay),
  7713. setTimeout(function() {
  7714. p.forEach(function(e) {
  7715. e.classList.add("fadeOut")
  7716. })
  7717. }, o.quickstart.fadeOutDelay) */
  7718. }(i),
  7719. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7720. function(e, t) {
  7721. setTimeout(function() {
  7722. if (a.isHelpEnabled()) {
  7723. if (t(),
  7724. s.init(),
  7725. g.addClass("fadeIn landing " + s.deviceType),
  7726. a.isSmallHelpEnabled())
  7727. return void g.addClass("small");
  7728. s.fill(m, l.LANDING[v]),
  7729. g.addClass(v)
  7730. }
  7731. }, e);
  7732. var i = {
  7733. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7734. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7735. }
  7736. , n = $(".nav-icon .icon");
  7737. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7738. function r(e) {
  7739. e.on("click", function() {
  7740. var e = null;
  7741. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7742. i.length < e || e < 1)
  7743. return !1;
  7744. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7745. "data-page": e,
  7746. src: i.mobile[e - 1]
  7747. }) : n.attr({
  7748. "data-page": e,
  7749. src: i.pc[e - 1]
  7750. })
  7751. })
  7752. }
  7753. r($(".next-button")),
  7754. r($(".prev-button"))
  7755. }(n, function() {
  7756. e.once(h.Move, r),
  7757. t.once(c.TourStart, r)
  7758. })
  7759. }
  7760. ,
  7761. t.exports.init = function(e, t) {
  7762. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7763. }
  7764. ,
  7765. t.exports.dismissModal = r
  7766. }
  7767. , {
  7768. "../enum/DirectorEvents": 23,
  7769. "../enum/HelpModalType": 28,
  7770. "../enum/PlayerEvents": 40,
  7771. "../enum/Viewmode": 51,
  7772. "../settings": 166,
  7773. "./help/help": 67,
  7774. "./helpManager": 68,
  7775. "./populateModal": 75
  7776. }],
  7777. 72: [function(e, t, i) {
  7778. "use strict";
  7779. var n = e("./circleLoader").circleLoader;
  7780. t.exports = {
  7781. element: $("#gui-loading"),
  7782. hide: function(e) {
  7783. n.done(),
  7784. this.element.fadeOut(1500, e)
  7785. },
  7786. show: function(e) {
  7787. this.element.fadeIn(500, function() {
  7788. this.element.css("display", "table"),
  7789. e && e()
  7790. }
  7791. .bind(this))
  7792. },
  7793. progress: function(e) {
  7794. n.set(e)
  7795. }
  7796. }
  7797. }
  7798. , {
  7799. "./circleLoader": 60
  7800. }],
  7801. 73: [function(e, t, i) {
  7802. "use strict";
  7803. var n = e("../settings")
  7804. , r = $("#memory-info")
  7805. , o = r.find("#memory-gpu")
  7806. , a = !1;
  7807. t.exports = {
  7808. show: function() {
  7809. n.profiling.enabled && (r.show(),
  7810. a = !0)
  7811. },
  7812. hide: function() {
  7813. r.hide(),
  7814. a = !1
  7815. },
  7816. toggle: function() {
  7817. a ? this.hide() : this.show()
  7818. },
  7819. update: function(e) {
  7820. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7821. }
  7822. }
  7823. }
  7824. , {
  7825. "../settings": 166
  7826. }],
  7827. 74: [function(e, t, i) {
  7828. "use strict";
  7829. e("../util/browser"),
  7830. e("../analytics");
  7831. e("../settings"),
  7832. t.exports = {
  7833. show: function(e, t) {
  7834. $("#gui-message").fadeOut(500, function() {
  7835. t()
  7836. })
  7837. }
  7838. }
  7839. }
  7840. , {
  7841. "../analytics": 4,
  7842. "../settings": 166,
  7843. "../util/browser": 182
  7844. }],
  7845. 75: [function(e, t, i) {
  7846. "use strict";
  7847. function n(e, t, i, n) {
  7848. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7849. }
  7850. var r = e("../util/browser")
  7851. , o = e("../localization/localize")
  7852. , a = e("../enum/HelpModalType")
  7853. , s = (e("../enum/HelpModalSize"),
  7854. e("../enum/Viewmode"));
  7855. t.exports = {
  7856. init: function() {
  7857. if (!this.hasInitialized) {
  7858. this.hasInitialized = !0,
  7859. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7860. this.assets = {},
  7861. this.assets[a.LANDING[s.PANORAMA]] = {
  7862. desktop: {
  7863. left: {
  7864. "top-info": o.ROTATE,
  7865. "big-image": "images/nav_help_mouse_drag_left.png",
  7866. keyboard: "images/nav_help_keyboard_left_right.png"
  7867. },
  7868. middle: {
  7869. "top-info": o.MOVE,
  7870. "big-image": "images/nav_help_mouse_click.png",
  7871. keyboard: "images/nav_help_keyboard_up_down.png"
  7872. },
  7873. right: {
  7874. "top-info": o.ZOOM,
  7875. "big-image": "images/nav_help_mouse_zoom.png",
  7876. keyboard: "images/nav_help_zoom_keys.png"
  7877. }
  7878. },
  7879. mobile: {
  7880. left: {
  7881. "top-info": o.ROTATE,
  7882. "big-image": "images/nav_help_gesture_drag.png"
  7883. },
  7884. middle: {
  7885. "top-info": o.MOVE,
  7886. "big-image": "images/nav_help_gesture_tap.png"
  7887. },
  7888. right: {
  7889. "top-info": o.ZOOM,
  7890. "big-image": "images/nav_help_gesture_pinch.png"
  7891. }
  7892. }
  7893. },
  7894. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7895. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7896. desktop: {
  7897. left: {
  7898. "top-info": o.ROTATE,
  7899. "big-image": "images/nav_help_mouse_drag_left.png",
  7900. keyboard: "images/nav_help_keyboard_left_right.png"
  7901. },
  7902. middle: {
  7903. "top-info": o.MOVE,
  7904. "big-image": "images/nav_help_mouse_position_right.png"
  7905. }
  7906. },
  7907. mobile: {
  7908. left: {
  7909. "top-info": o.ROTATE,
  7910. "big-image": "images/nav_help_gesture_drag.png"
  7911. },
  7912. middle: {
  7913. "top-info": o.MOVE,
  7914. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7915. }
  7916. }
  7917. },
  7918. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7919. desktop: {
  7920. left: {
  7921. "top-info": o.MOVE,
  7922. "big-image": "images/nav_help_mouse_position_left.png"
  7923. },
  7924. middle: {
  7925. "top-info": o.ROTATE,
  7926. "big-image": "images/nav_help_mouse_drag_right.png",
  7927. keyboard: "images/nav_help_keyboard_left_right.png"
  7928. }
  7929. },
  7930. mobile: {
  7931. left: {
  7932. "top-info": o.MOVE,
  7933. "big-image": "images/nav_help_gesture_position.png"
  7934. },
  7935. middle: {
  7936. "top-info": o.ROTATE,
  7937. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7938. }
  7939. }
  7940. };
  7941. var e = {
  7942. "top-info": o.INSIDE,
  7943. "big-image": "images/nav_help_click_inside.png",
  7944. keyboard: "images/nav_help_inside_key.png"
  7945. };
  7946. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7947. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7948. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7949. var t = {
  7950. "top-info": o.INSIDE,
  7951. "big-image": "images/nav_help_tap_inside.png"
  7952. };
  7953. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7954. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7955. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7956. this.assets[a.NAVIGATION] = {},
  7957. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7958. desktop: {
  7959. left: {
  7960. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7961. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7962. "big-image": "images/nav_help_mouse_drag_left.png",
  7963. keyboard: "images/nav_help_keyboard_left_right.png"
  7964. },
  7965. middle: {
  7966. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7967. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7968. "big-image": "images/nav_help_mouse_click.png",
  7969. keyboard: "images/nav_help_keyboard_up_down.png"
  7970. },
  7971. right: {
  7972. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7973. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7974. "big-image": "images/nav_help_mouse_zoom.png",
  7975. keyboard: "images/nav_help_zoom_keys.png"
  7976. }
  7977. },
  7978. mobile: {
  7979. left: {
  7980. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7981. "big-image": "images/nav_help_gesture_drag.png"
  7982. },
  7983. middle: {
  7984. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7985. "big-image": "images/nav_help_gesture_tap.png"
  7986. },
  7987. right: {
  7988. "top-info": o.HELP_MOBILE_3,
  7989. "big-image": "images/nav_help_gesture_pinch.png"
  7990. }
  7991. }
  7992. },
  7993. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7994. desktop: {
  7995. left: {
  7996. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7997. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7998. "big-image": "images/nav_help_mouse_drag_left.png",
  7999. keyboard: "images/nav_help_keyboard_all.png"
  8000. },
  8001. middle: {
  8002. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  8003. "big-image": "images/nav_help_mouse_position_right.png"
  8004. },
  8005. right: {
  8006. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  8007. "big-image": "images/nav_help_mouse_zoom.png"
  8008. }
  8009. },
  8010. mobile: {
  8011. left: {
  8012. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  8013. "big-image": "images/nav_help_gesture_drag.png"
  8014. },
  8015. middle: {
  8016. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8017. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8018. },
  8019. right: {
  8020. "top-info": o.HELP_MOBILE_3,
  8021. "big-image": "images/nav_help_gesture_pinch.png"
  8022. }
  8023. }
  8024. },
  8025. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8026. desktop: {
  8027. left: {
  8028. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8029. "big-image": "images/nav_help_mouse_position_left.png"
  8030. },
  8031. middle: {
  8032. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8033. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8034. "big-image": "images/nav_help_mouse_drag_right.png",
  8035. keyboard: "images/nav_help_keyboard_left_right.png"
  8036. },
  8037. right: {
  8038. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8039. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8040. "big-image": "images/nav_help_mouse_zoom.png",
  8041. keyboard: "images/nav_help_keyboard_up_down.png"
  8042. }
  8043. },
  8044. mobile: {
  8045. left: {
  8046. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8047. "big-image": "images/nav_help_gesture_position.png"
  8048. },
  8049. middle: {
  8050. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8051. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8052. },
  8053. right: {
  8054. "top-info": o.HELP_MOBILE_3,
  8055. "big-image": "images/nav_help_gesture_pinch.png"
  8056. }
  8057. }
  8058. },
  8059. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8060. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8061. "top-info": o.HELP_DESKTOP_360_2A,
  8062. "bottom-info": o.HELP_DESKTOP_360_2B,
  8063. "big-image": "images/nav_help_click_inside.png",
  8064. keyboard: "images/nav_help_inside_key.png"
  8065. },
  8066. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8067. "top-info": o.HELP_MOBILE_360_2,
  8068. "big-image": "images/nav_help_tap_inside.png"
  8069. },
  8070. this.assets[a.MORE_HELP] = {
  8071. desktop: {
  8072. "more-help-hlr": {
  8073. "top-info": o.HELP_MORE_HLR_A,
  8074. "big-image": "images/nav_help_expand.svg",
  8075. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8076. },
  8077. "more-help-dollhouse": {
  8078. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8079. "big-image": "images/nav_help_dollhouse.svg",
  8080. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8081. },
  8082. "more-help-floors": {
  8083. "top-info": o.HELP_MORE_FLOORS_A,
  8084. "big-image": "images/nav_help_floor picker.svg",
  8085. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8086. },
  8087. "more-help-tag": {
  8088. "top-info": o.HELP_MORE_TAG_A,
  8089. "big-image": "images/nav_help_tag.svg",
  8090. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8091. },
  8092. "more-help-zoom": {
  8093. "top-info": o.HELP_MORE_ZOOM_A,
  8094. "big-image": "images/nav_help_zoom.svg",
  8095. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8096. },
  8097. "more-help-tour": {
  8098. "top-info": o.HELP_MORE_TOUR_A,
  8099. "big-image": "images/nav_help_play.png",
  8100. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8101. },
  8102. "more-help-inside": {
  8103. "top-info": o.HELP_MORE_INSIDE_A,
  8104. "big-image": "images/nav_help_inside.svg",
  8105. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8106. },
  8107. "more-help-vr": {
  8108. "top-info": o.HELP_MORE_VR_A,
  8109. "big-image": "images/nav_help_vr.svg",
  8110. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8111. },
  8112. "more-help-360": {
  8113. "top-info": o.HELP_MORE_360_A,
  8114. "big-image": "images/nav_help_360.svg",
  8115. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8116. },
  8117. "more-help-fullscreen": {
  8118. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8119. "big-image": "images/nav_help_fullscreen.svg",
  8120. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8121. }
  8122. },
  8123. mobile: {
  8124. "more-help-hlr": {
  8125. "top-info": o.HELP_MORE_HLR_A,
  8126. "big-image": "images/nav_help_expand.svg",
  8127. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8128. },
  8129. "more-help-dollhouse": {
  8130. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8131. "big-image": "images/nav_help_dollhouse.svg",
  8132. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8133. },
  8134. "more-help-floors": {
  8135. "top-info": o.HELP_MORE_FLOORS_A,
  8136. "big-image": "images/nav_help_floor picker.svg",
  8137. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8138. },
  8139. "more-help-tag": {
  8140. "top-info": o.HELP_MORE_TAG_A,
  8141. "big-image": "images/nav_help_tag.svg",
  8142. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8143. },
  8144. "more-help-tour": {
  8145. "top-info": o.HELP_MORE_TOUR_A,
  8146. "big-image": "images/nav_help_play.png",
  8147. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8148. },
  8149. "more-help-inside": {
  8150. "top-info": o.HELP_MORE_INSIDE_A,
  8151. "big-image": "images/nav_help_inside.svg",
  8152. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8153. },
  8154. "more-help-vr": {
  8155. "top-info": o.HELP_MORE_VR_A,
  8156. "big-image": "images/webvr.svg",
  8157. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8158. },
  8159. "more-help-360": {
  8160. "top-info": o.HELP_MORE_360_A,
  8161. "big-image": "images/nav_help_360.svg",
  8162. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8163. }
  8164. }
  8165. },
  8166. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8167. desktop: {
  8168. left: {
  8169. "top-info": o.ROTATE,
  8170. "big-image": "images/nav_help_mouse_drag_left.png",
  8171. keyboard: "images/nav_help_keyboard_left_right.png"
  8172. },
  8173. middle: {
  8174. "top-info": o.MOVE,
  8175. "big-image": "images/nav_help_mouse_click.png",
  8176. keyboard: "images/nav_help_keyboard_up_down.png"
  8177. },
  8178. right: {
  8179. "top-info": o.PLAY,
  8180. "big-image": "images/Desktop-help-play-button.svg",
  8181. keyboard: "images/Desktop-help-spacebar-2.svg"
  8182. }
  8183. },
  8184. mobile: {
  8185. left: {
  8186. "top-info": o.ROTATE,
  8187. "big-image": "images/nav_help_gesture_drag.png"
  8188. },
  8189. middle: {
  8190. "top-info": o.MOVE,
  8191. "big-image": "images/nav_help_gesture_tap.png"
  8192. },
  8193. right: {
  8194. "top-info": o.PLAY,
  8195. "big-image": "images/mobile-help-play-button.svg"
  8196. }
  8197. }
  8198. },
  8199. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8200. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8201. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8202. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8203. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8204. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8205. }
  8206. },
  8207. fill: function(e, t, i) {
  8208. n.call(this, e, t, i, !0)
  8209. },
  8210. clear: function(e, t, i) {
  8211. n.call(this, e, t, i, !1)
  8212. }
  8213. }
  8214. }
  8215. , {
  8216. "../enum/HelpModalSize": 27,
  8217. "../enum/HelpModalType": 28,
  8218. "../enum/Viewmode": 51,
  8219. "../localization/localize": 108,
  8220. "../util/browser": 182
  8221. }],
  8222. 76: [function(e, t, i) {
  8223. "use strict";
  8224. t.exports = Object.freeze({
  8225. OPENED: "share.open",
  8226. CLOSED: "share.closed",
  8227. LINK_CLICKED: "share.linked"
  8228. })
  8229. }
  8230. , {}],
  8231. 77: [function(e, t, i) {
  8232. "use strict";
  8233. function n(n) {
  8234. function e(e, t) {
  8235. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  8236. I.emit(l.LINK_CLICKED, {
  8237. channel: n
  8238. }),
  8239. window.open(C[n], "shareWindow", i)
  8240. }
  8241. switch (n) {
  8242. case A.FACEBOOK:
  8243. e(580, 420);
  8244. break;
  8245. case A.TWITTER:
  8246. e(550, 440);
  8247. break;
  8248. case A.MAIL:
  8249. I.emit(l.LINK_CLICKED, {
  8250. channel: "email"
  8251. }),
  8252. window.open(C[n], "_blank");
  8253. break;
  8254. case A.LINKEDIN:
  8255. }
  8256. }
  8257. function r(e) {
  8258. I.emit(l.LINK_CLICKED, {
  8259. channel: "copylink"
  8260. });
  8261. var t = document.createRange();
  8262. t.selectNodeContents(v);
  8263. var i = window.getSelection();
  8264. i.removeAllRanges(),
  8265. i.addRange(t),
  8266. document.execCommand("copy"),
  8267. y.classList.remove("hidden"),
  8268. v.classList.add("highlighted")
  8269. }
  8270. function o(e) {
  8271. e && (e.stopPropagation(),
  8272. e.target === v) || (window.getSelection().removeAllRanges(),
  8273. v.classList.remove("highlighted"),
  8274. y.classList.add("hidden"))
  8275. }
  8276. var a = e("../../util/browser")
  8277. , s = e("../../localization/localize")
  8278. , l = e("./ShareEvents")
  8279. , c = e("../../util/common")
  8280. , h = e("events").EventEmitter
  8281. , u = document.getElementById("sharing")
  8282. , d = document.getElementById("share-modal")
  8283. , p = document.getElementById("share-close")
  8284. , f = document.getElementById("facebook-share")
  8285. , g = document.getElementById("twitter-share")
  8286. , m = document.getElementById("mail-share")
  8287. , v = document.getElementById("share-url-text")
  8288. , y = document.getElementById("copy-success")
  8289. , A = Object.freeze({
  8290. FACEBOOK: "facebook",
  8291. TWITTER: "twitter",
  8292. MAIL: "mail",
  8293. LINKEDIN: "linkedin"
  8294. })
  8295. , C = {};
  8296. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8297. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8298. C[A.MAIL] = "mailto:?subject=";
  8299. var I = {
  8300. init: function(e) {
  8301. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8302. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8303. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8304. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8305. u.addEventListener("click", this.toggle.bind(this)),
  8306. p.addEventListener("click", this.hide.bind(this)),
  8307. v.addEventListener("click", r),
  8308. d.addEventListener("click", o),
  8309. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8310. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8311. m.addEventListener("click", n.bind(this, A.MAIL)),
  8312. v.textContent = window.location.href + "&utm_source=4",
  8313. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8314. u.classList.remove("hidden")
  8315. },
  8316. show: function() {
  8317. this.emit(l.OPENED),
  8318. d.classList.add("fadeIn")
  8319. },
  8320. hide: function() {
  8321. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8322. document.selection && document.selection.empty(),
  8323. window.getSelection().removeAllRanges(),
  8324. o(),
  8325. d.classList.remove("fadeIn"))
  8326. },
  8327. toggle: function() {
  8328. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8329. }
  8330. };
  8331. c.extendObject(I, h.prototype),
  8332. t.exports = I
  8333. }
  8334. , {
  8335. "../../localization/localize": 108,
  8336. "../../util/browser": 182,
  8337. "../../util/common": 185,
  8338. "./ShareEvents": 76,
  8339. events: 202
  8340. }],
  8341. 78: [function(e, t, i) {
  8342. "use strict";
  8343. t.exports = Object.freeze({
  8344. OPENED: "terms.opened",
  8345. CLOSED: "terms.closed"
  8346. })
  8347. }
  8348. , {}],
  8349. 79: [function(e, t, i) {
  8350. "use strict";
  8351. var n = e("./TermsEvent")
  8352. , r = e("../../localization/localize")
  8353. , o = e("../../analytics")
  8354. , a = e("../../util/ajax")
  8355. , s = e("../../util/common")
  8356. , l = e("events").EventEmitter
  8357. , c = document.getElementById("terms-modal")
  8358. , h = {
  8359. init: function() {
  8360. $(".footer-terms").on("click", function(e) {
  8361. e.preventDefault(),
  8362. this.show()
  8363. }
  8364. .bind(this)),
  8365. $("#terms-modal .close").on("click", this.hide.bind(this))
  8366. },
  8367. show: function() {
  8368. this.emit(n.OPENED),
  8369. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8370. var t = $("#terms-text").html(e);
  8371. o.track("showcase_gui", {
  8372. gui_action: "click_terms_button",
  8373. interaction_source: "gui"
  8374. }),
  8375. t.find("a").attr("target", "_blank")
  8376. }).fail(function() {
  8377. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8378. }),
  8379. c.classList.add("fadeIn")
  8380. },
  8381. hide: function(e) {
  8382. e && e.preventDefault(),
  8383. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8384. c.classList.remove("fadeIn")
  8385. }
  8386. };
  8387. s.extendObject(h, l.prototype),
  8388. t.exports = h
  8389. }
  8390. , {
  8391. "../../analytics": 4,
  8392. "../../localization/localize": 108,
  8393. "../../util/ajax": 181,
  8394. "../../util/common": 185,
  8395. "./TermsEvent": 78,
  8396. events: 202
  8397. }],
  8398. 80: [function(e, t, i) {
  8399. "use strict";
  8400. t.exports = Object.freeze({
  8401. OPEN_INFO: "title.open.info",
  8402. CLOSE_INFO: "title.close.info",
  8403. SHOW_INFO: "title.show.info",
  8404. HIDE_INFO: "title.hide.info",
  8405. LINK_CLICKED: "title.link.click",
  8406. CONTACT_LINK_CLICKED: "title.contact.click",
  8407. ORIGIN_LINK_CLICKED: "title.origin.click"
  8408. })
  8409. }
  8410. , {}],
  8411. 81: [function(e, t, i) {
  8412. "use strict";
  8413. var o = e("../../settings");
  8414. t.exports.init = function(e, t) {
  8415. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8416. function e(e) {
  8417. t.shouldShowtags = "show" === this.value,
  8418. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8419. }
  8420. document.getElementById("tag-toggles").classList.remove("hidden"),
  8421. document.getElementById("radio-tag-show").checked = !0;
  8422. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8423. n[r].addEventListener("change", e)
  8424. }(e, t)
  8425. }
  8426. }
  8427. , {
  8428. "../../settings": 166
  8429. }],
  8430. 82: [function(S, M, e) {
  8431. (function(e) {
  8432. "use strict";
  8433. function i(e) {
  8434. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8435. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8436. _.appendChild(function(e) {
  8437. var t = document.createElement("a");
  8438. return t.id = "url",
  8439. t.target = "_blank",
  8440. t.href = e,
  8441. t.innerText = e,
  8442. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8443. t
  8444. }(e)),
  8445. b.forEach(function(e) {
  8446. e.classList.add("share-link")
  8447. }),
  8448. 0))
  8449. }
  8450. function s(e, t) {
  8451. var i = e
  8452. , n = t;
  8453. return function(e, t) {
  8454. i.push(t || n, e)
  8455. }
  8456. }
  8457. var l = S("../../util/browser")
  8458. , t = S("../../util/common")
  8459. , n = S("../../util/logger")
  8460. , r = S("../../localization/localize")
  8461. , o = S("./titleBarSettings")
  8462. , c = S("../../settings")
  8463. , a = S("./TitleEvents")
  8464. , h = S("events").EventEmitter
  8465. , u = new n(e)
  8466. , d = document.querySelector(".pinTop.left")
  8467. , p = document.getElementsByClassName("title-container")[0]
  8468. , f = document.getElementById("title-toggle").querySelector("i")
  8469. , g = document.getElementById("meta-info-wrapper")
  8470. , m = document.getElementById("meta-info")
  8471. , v = document.getElementById("meta-description")
  8472. , y = document.getElementsByClassName("contact-info")[0]
  8473. , A = document.getElementById("contact-data")
  8474. , C = document.getElementById("addressTxt")
  8475. , I = document.getElementById("tag-toggles")
  8476. , E = document.getElementById("share-origin")
  8477. , _ = document.getElementById("share-link-wrapper")
  8478. , b = [m, g, p]
  8479. , w = !1
  8480. , T = !1
  8481. , x = {
  8482. populate: function(e) {
  8483. if (function(e, t) {
  8484. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8485. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8486. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8487. document.getElementById("gui-name").classList.add("noCoBrand"),
  8488. document.getElementById("cobrandTitle").classList.add("hidden")),
  8489. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8490. !1)
  8491. }(MP_PREFETCHED_MODELDATA.name, e.coBrand)) {
  8492. if (function(e) {
  8493. e ? (w = !0,
  8494. v.innerHTML = e) : v.classList.add("hidden")
  8495. }(e.description),
  8496. function(e, t, i, n) {
  8497. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8498. w = !0;
  8499. var r = []
  8500. , o = s(r, "<br>");
  8501. if (e && o('<span id="contactName">' + e + "</span>"),
  8502. t) {
  8503. var a = n || t;
  8504. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8505. }
  8506. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8507. r[0] = "",
  8508. A.innerHTML = r.join("")
  8509. } else
  8510. y.classList.add("hidden")
  8511. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8512. function(e) {
  8513. if ("string" == typeof e)
  8514. try {
  8515. e = JSON.parse(e)
  8516. } catch (e) {
  8517. return u.warn("Unable to parse address data"),
  8518. C.parentElement.classList.add("hidden")
  8519. }
  8520. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8521. w = !0;
  8522. var t = []
  8523. , i = s(t, " ");
  8524. e.address_1 && i(e.address_1),
  8525. e.address_2 && i(e.address_2),
  8526. e.city && i(e.city, ", "),
  8527. e.state && i(e.state, ", "),
  8528. e.zip && i(e.zip, e.state ? " " : ", "),
  8529. t[0] = "",
  8530. C.innerText = t.join("")
  8531. } else
  8532. C.parentElement.classList.add("hidden")
  8533. }(e.address),
  8534. w) {
  8535. var t = document.createElement("br");
  8536. I.insertBefore(t, I.firstElementChild)
  8537. }
  8538. e.socialSharing && c.share.enabled && (T = i(e.url))
  8539. }
  8540. },
  8541. finishSetup: function(e) {
  8542. w = w || !!e,
  8543. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8544. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8545. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8546. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8547. }),
  8548. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8549. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8550. contact_type: e.getAttribute("id")
  8551. }))
  8552. }),
  8553. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8554. },
  8555. toggleMeta: function(e, t) {
  8556. var i = document.getElementById("model-title");
  8557. t && t.preventDefault();
  8558. var n = m.classList.contains("expand");
  8559. e && !n || (n ? (b.forEach(function(e) {
  8560. e.classList.remove("expand")
  8561. }),
  8562. this.emit(a.CLOSE_INFO),
  8563. i.classList.remove("expand")) : (b.forEach(function(e) {
  8564. e.classList.add("expand")
  8565. }),
  8566. i.classList.add("expand"),
  8567. this.emit(a.OPEN_INFO)))
  8568. },
  8569. setupToggling: function() {
  8570. g.style.height = m.offsetHeight + "px",
  8571. m.addEventListener("transitionend", function() {
  8572. g.style.height = m.offsetHeight + "px"
  8573. })
  8574. },
  8575. toggleTitle: function(e) {
  8576. e && e.preventDefault(),
  8577. d.classList.contains("closed") ? (d.classList.add("open"),
  8578. f.classList.remove("icon-dpad-right"),
  8579. f.classList.add("icon-dpad-left"),
  8580. this.emit(a.SHOW_INFO),
  8581. setTimeout(function() {
  8582. d.classList.remove("closed"),
  8583. d.classList.remove("open")
  8584. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8585. f.classList.remove("icon-dpad-left"),
  8586. f.classList.add("icon-dpad-right"),
  8587. this.emit(a.HIDE_INFO))
  8588. }
  8589. };
  8590. t.extendObject(x, h.prototype),
  8591. M.exports = x
  8592. }
  8593. ).call(this, "/js/gui/title/titleBar.js")
  8594. }
  8595. , {
  8596. "../../localization/localize": 108,
  8597. "../../settings": 166,
  8598. "../../util/browser": 182,
  8599. "../../util/common": 185,
  8600. "../../util/logger": 189,
  8601. "./TitleEvents": 80,
  8602. "./titleBarSettings": 83,
  8603. events: 202
  8604. }],
  8605. 83: [function(e, t, i) {
  8606. "use strict";
  8607. t.exports = Object.freeze({
  8608. minTooltipCharacters: 19,
  8609. removeAnimationClasses: 500
  8610. })
  8611. }
  8612. , {}],
  8613. 84: [function(e, t, i) {
  8614. "use strict";
  8615. function n() {
  8616. v.playTour(),
  8617. y && clearTimeout(y),
  8618. c(),
  8619. E.removeClass("fadeIn")
  8620. }
  8621. function r() {
  8622. A.classList.contains("playing") && (v.stopTour(),
  8623. E.addClass("fadeIn"),
  8624. setTimeout(function() {
  8625. E.removeClass("fadeIn")
  8626. }, h.tourInteraction.showPauseButton),
  8627. M || (clearTimeout(y),
  8628. y = setTimeout(s, h.tourInteraction.showModal)),
  8629. setTimeout(function() {
  8630. A.classList.remove("playing")
  8631. }, h.tourInteraction.allowNextClick))
  8632. }
  8633. function o() {
  8634. v.tourInProgress && (v.stopTour(),
  8635. v.endTourProgress(),
  8636. A.classList.remove("playing"))
  8637. }
  8638. function a() {
  8639. _.is(":visible") ? n() : r()
  8640. }
  8641. function s() {//去掉导览结束时的提示
  8642. /* if (!h.tourInteraction.disabled) {
  8643. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8644. T.addClass("fadeIn tour " + p.deviceType);
  8645. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8646. if (!h.tourInteraction.smallModal)
  8647. e = v.player.mode === d.PANORAMA && !v.player.currentPano.isAligned() || v.player.mode === d.DOLLHOUSE ? d.OUTDOOR : v.player.mode === d.FLOORPLAN ? d.FLOORPLAN : d.PANORAMA,
  8648. p.fill(x, g.TOUR_INTERACTION[e]),
  8649. T.addClass(e);
  8650. T.addClass(t)
  8651. } */
  8652. }
  8653. function l(e, t) {
  8654. if (t) {
  8655. var i = "keydown" === t.type
  8656. , n = t.which === u.SPACE || v.tourIsPlaying;
  8657. i && n || e || (M = !0),
  8658. v.atEndOfTour() && c(),
  8659. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8660. c(),
  8661. t.which !== u.SPACE && o()),
  8662. i && n && a()
  8663. }
  8664. }
  8665. function c() {
  8666. T.removeClass("fadeIn")
  8667. }
  8668. var h = (e("../util/browser"),
  8669. e("../settings"))
  8670. , u = e("../enum/Keys")
  8671. , d = e("../enum/Viewmode")
  8672. , p = (e("./helpManager"),
  8673. e("./populateModal"))
  8674. , f = e("../enum/DirectorEvents")
  8675. , g = e("../enum/HelpModalType")
  8676. , m = e("../enum/HelpModalSize")
  8677. , v = null
  8678. , y = null
  8679. , A = document.getElementById("pause-overlay")
  8680. , C = document.getElementById("player")
  8681. , I = document.getElementById("gui")
  8682. , E = $("#pause-icon").eq(0)
  8683. , _ = $("#play").eq(0)
  8684. , b = $("#playHead").eq(0)
  8685. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8686. , T = $("#interaction-modal").eq(0)
  8687. , x = $("#interaction-modal .interaction").toArray()
  8688. , S = ["touchstart", "mousedown", "pointerdown"]
  8689. , M = !1;
  8690. t.exports.init = function(e) {
  8691. v = e,
  8692. S.forEach(function(t) {
  8693. C.addEventListener(t, l.bind(this, !1), !0),
  8694. I.addEventListener(t, l.bind(this, !0), !0),
  8695. A.addEventListener(t, r, !0),
  8696. w.forEach(function(e) {
  8697. e.addEventListener(t, o, !0)
  8698. }),
  8699. $("#drawer img").on(t, o)
  8700. }),
  8701. document.addEventListener("keydown", l.bind(this, !1), !0),
  8702. v.on(f.TourStart, function() {
  8703. A.classList.add("playing")
  8704. })
  8705. }
  8706. ,
  8707. t.exports.play = n,
  8708. t.exports.pause = r,
  8709. t.exports.pauseWithoutCTA = o,
  8710. t.exports.togglePlay = a,
  8711. t.exports.stopTour = function() {
  8712. b.hasClass("playing") && (clearTimeout(y),
  8713. v.atEndOfTour() ? (A.classList.remove("playing"),
  8714. s()) : E.removeClass("fadeIn"))
  8715. }
  8716. ,
  8717. t.exports.dismissModal = c
  8718. }
  8719. , {
  8720. "../enum/DirectorEvents": 23,
  8721. "../enum/HelpModalSize": 27,
  8722. "../enum/HelpModalType": 28,
  8723. "../enum/Keys": 30,
  8724. "../enum/Viewmode": 51,
  8725. "../settings": 166,
  8726. "../util/browser": 182,
  8727. "./helpManager": 68,
  8728. "./populateModal": 75
  8729. }],
  8730. 85: [function(e, t, i) {
  8731. "use strict";
  8732. t.exports = Object.freeze({
  8733. OPENED: "vr.modal.opened",
  8734. LAUNCH: "vr.modal.launch",
  8735. CLOSED: "vr.modal.closed",
  8736. NEXT: "vr.modal.next",
  8737. PREV: "vr.modal.prev",
  8738. STORE: "vr.modal.store",
  8739. falseICECHOSEN: "vr.modal.device"
  8740. })
  8741. }
  8742. , {}],
  8743. 86: [function(e, t, i) {
  8744. "use strict";
  8745. var h = e("../../util/browser")
  8746. , u = e("../../enum/VRApps")
  8747. , n = e("../../enum/VRPlatforms")
  8748. , d = e("../../util/ajax")
  8749. , p = e("../../settings")
  8750. , r = {};
  8751. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8752. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8753. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8754. u) {
  8755. var a = u[o];
  8756. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8757. }
  8758. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8759. "https://" + s);
  8760. t.exports.init = function(e, t, o) {
  8761. function a(e, t, i, n) {
  8762. function r() {
  8763. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8764. }
  8765. return h.valueFromHash("vrcoll", !1) ? l + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(i) + "&ld=" + encodeURIComponent(n) + "&display=" + e + r() : c + "&m=" + t + "&display=" + e + r()
  8766. }
  8767. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8768. , l = g + "/vr/dlist/?ret=" + s
  8769. , c = g + "/vr/show/?ret=" + s;
  8770. switch (e) {
  8771. case n.IOS:
  8772. !function(t, e, i, n) {
  8773. var r = a(t, e, i, n)
  8774. , o = {
  8775. responseType: "json",
  8776. data: {
  8777. branch_key: p.appConfig.branch_key,
  8778. data: {
  8779. m: e,
  8780. full_url: r,
  8781. $desktop_url: "",
  8782. $og_app_id: "331853976762864119",
  8783. $og_title: i,
  8784. $og_description: n,
  8785. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8786. $canonical_url: window.location.href
  8787. }
  8788. }
  8789. };
  8790. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8791. f[t] = e.url
  8792. }).fail(function(e) {
  8793. f[t] = e
  8794. }
  8795. .bind(this, r))
  8796. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8797. break;
  8798. default:
  8799. !function(e, t, i) {
  8800. for (var n in u) {
  8801. var r = u[n]
  8802. , o = a(r, e, t, i);
  8803. f[r] = o
  8804. }
  8805. }(t.sid, t.name, t.summary)
  8806. }
  8807. }
  8808. ,
  8809. t.exports.launch = function(e) {
  8810. var t = f[e];
  8811. window.open(t, "_blank")
  8812. }
  8813. ,
  8814. t.exports.launchStore = function(e) {
  8815. var t = r[e];
  8816. window.open(t, "_blank")
  8817. }
  8818. }
  8819. , {
  8820. "../../enum/VRApps": 46,
  8821. "../../enum/VRPlatforms": 49,
  8822. "../../settings": 166,
  8823. "../../util/ajax": 181,
  8824. "../../util/browser": 182
  8825. }],
  8826. 87: [function(e, t, i) {
  8827. "use strict";
  8828. function c(e) {
  8829. var t;
  8830. switch (e) {
  8831. case y.IOS:
  8832. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8833. case y.Android:
  8834. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8835. }
  8836. return !1
  8837. }
  8838. function h(e) {
  8839. switch (e) {
  8840. case y.Android:
  8841. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8842. x.filter(".gearvr").off().on("click", q.gear),
  8843. n(k, U, "logo-button", "same-line");
  8844. break;
  8845. case y.UnsupportedAndroid:
  8846. n("", H, "", "");
  8847. break;
  8848. case y.IOS:
  8849. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8850. n(k, "", "logo-button", "");
  8851. break;
  8852. case y.Desktop:
  8853. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8854. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8855. n(k, U, "logo-button", "same-line"),
  8856. Q.cardboard()
  8857. }
  8858. }
  8859. function u(e) {
  8860. $(".p1, .p2, .p3").hide(),
  8861. l.insertAfter(T),
  8862. w.removeClass("front-page"),
  8863. w.removeClass("details-page"),
  8864. w.removeClass("lastPage"),
  8865. x.removeClass("logo-button"),
  8866. x.removeClass("same-line"),
  8867. T.removeClass("headsetOptions"),
  8868. S.attr("src", ""),
  8869. S.filter(".second").removeClass("gear"),
  8870. S.css("display", "inline-block"),
  8871. S.off(),
  8872. M.filter(".second").css("display", ""),
  8873. O.css("display", "none"),
  8874. $(".p" + (e + 1) + _).show(),
  8875. S.filter(".third").insertBefore(M.filter(".third"))
  8876. }
  8877. function n(e, t, i, n) {
  8878. w.addClass("front-page"),
  8879. S.filter(".first").attr("src", e),
  8880. S.filter(".second").attr("src", t),
  8881. x.filter(".first").addClass(i),
  8882. x.filter(".second").addClass(i),
  8883. x.addClass(n),
  8884. ".show-desktop" === _ && T.insertAfter(l)
  8885. }
  8886. function r(e, t, i) {
  8887. T.addClass("headsetOptions"),
  8888. x.off(),
  8889. S.filter(".second").attr("src", t),
  8890. O.css("display", "block"),
  8891. M.filter(".second").css("display", "none"),
  8892. O.on("click", function() {
  8893. u(b.Title),
  8894. h(y.Desktop)
  8895. }),
  8896. e && (X.emit(C.falseICECHOSEN, {
  8897. name: v.GearVR
  8898. }),
  8899. S.filter(".first").attr("src", e),
  8900. S.filter(".second").addClass("gear"),
  8901. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8902. Q.gearvr()),
  8903. i && (X.emit(C.falseICECHOSEN, {
  8904. name: v.Cardboard
  8905. }),
  8906. S.filter(".third").attr("src", i),
  8907. S.filter(".third").show(),
  8908. S.filter(".third").insertAfter(S.filter(".second")),
  8909. S.filter(".third").addClass("link"),
  8910. S.filter(".second").addClass("link"),
  8911. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8912. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8913. Q.cardboard())
  8914. }
  8915. function d(e, t) {
  8916. switch (t) {
  8917. case y.IOS:
  8918. j = W,
  8919. Y = G;
  8920. break;
  8921. case y.Desktop:
  8922. e === b.Cardboard ? (j = N,
  8923. Y = B,
  8924. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8925. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8926. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8927. Y = "");
  8928. break;
  8929. default:
  8930. Y = e === b.Cardboard ? (j = H,
  8931. G) : (j = V,
  8932. z)
  8933. }
  8934. }
  8935. function p(e, t, i) {
  8936. w.find(".inner").addClass("details-page"),
  8937. w.addClass("details-page"),
  8938. S.filter(".first").attr("src", e),
  8939. S.filter(".second").attr("src", t),
  8940. S.filter(".third").attr("src", i)
  8941. }
  8942. function f() {
  8943. var e = 1 < g.aspectRatio() && g.isMobile();
  8944. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8945. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8946. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8947. }
  8948. var g = e("../../util/browser")
  8949. , m = e("./vrLink")
  8950. , v = e("../../enum/VRApps")
  8951. , y = e("../../enum/VRPlatforms")
  8952. , A = e("../../enum/VRPages")
  8953. , C = e("./vrEvent")
  8954. , o = (e("../../settings"),
  8955. e("../../constants"))
  8956. , I = e("../../localization/localize")
  8957. , a = e("../../util/common")
  8958. , s = e("events").EventEmitter
  8959. , E = 0
  8960. , _ = null
  8961. , b = A.standard
  8962. , w = $(".vr-popup")
  8963. , l = w.find(".vr-popup-body")
  8964. , T = w.find(".vr-images")
  8965. , x = w.find(".img-container")
  8966. , S = w.find(".vr-sm-image")
  8967. , M = x.find(".vr-img-caption")
  8968. , R = $(".vr-buttons").find(".prev-button")
  8969. , P = $(".vr-buttons").find(".next-button")
  8970. , O = T.find(".front-close")
  8971. , L = $(".vr-page")
  8972. , D = w.find("img")
  8973. , N = "images/apple-store.png"
  8974. , F = "images/badge-oculus.png"
  8975. , B = "images/badge-cardboard.png"
  8976. , V = "images/logo-samsung.png"
  8977. , k = "images/headset-cardboard.png"
  8978. , U = "images/headset-gearvr.png"
  8979. , H = "images/ico-android-robot.png"
  8980. , z = "images/ico-gearvr.png"
  8981. , G = "images/ico-vr.png"
  8982. , W = "images/apple-logo-white.svg"
  8983. , j = null
  8984. , Y = null
  8985. , q = {}
  8986. , X = {
  8987. init: function(e, t) {
  8988. function i(e) {
  8989. X.emit(C.STORE, {
  8990. type: e
  8991. }),
  8992. m.launchStore(e)
  8993. }
  8994. function n(e) {
  8995. switch (e !== b.pageCount && (u(e),
  8996. L.text(e + 1 + " / " + b.pageCount)),
  8997. e) {
  8998. case b.Title:
  8999. R.css("display", "none"),
  9000. P.text(a[e]),
  9001. h(r);
  9002. break;
  9003. case b.Cardboard:
  9004. R.css("display", "block"),
  9005. P.text(a[e]),
  9006. x.filter(".cardboard").off(),
  9007. x.filter(".gearvr").off(),
  9008. d(e, r),
  9009. p(k, j, Y);
  9010. break;
  9011. case b.Gear:
  9012. P.text(a[e]),
  9013. d(e, r),
  9014. w.addClass("lastPage"),
  9015. p(U, j, Y);
  9016. break;
  9017. case b.pageCount:
  9018. w.removeClass("fadeIn"),
  9019. X.emit(C.CLOSED)
  9020. }
  9021. D.filter("[src='']").hide()
  9022. }
  9023. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  9024. _ = ".show-supported",
  9025. y.Android) : (w.addClass("unsupported"),
  9026. _ = ".show-unsupported",
  9027. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  9028. _ = ".show-ios",
  9029. b = A.ios,
  9030. y.IOS) : (w.addClass("desktop"),
  9031. _ = ".show-desktop",
  9032. y.Desktop);
  9033. function o(e) {
  9034. X.emit(C.LAUNCH, {
  9035. vr_platform: r,
  9036. vr_app: e
  9037. }),
  9038. m.launch(e)
  9039. }
  9040. m.init(r, e, t),
  9041. r !== y.Desktop && w.addClass("mobile"),
  9042. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  9043. q.gear = o.bind(this, v.GearVR),
  9044. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  9045. f(),
  9046. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  9047. $(_).show();
  9048. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  9049. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  9050. r === y.IOS && (a.splice(1, 1),
  9051. s.splice(1, 1)),
  9052. $("#vr").on("click", function(e) {
  9053. e.preventDefault(),
  9054. window.vrEnabled || (window.vrEnabled = !0,
  9055. this.classList.add("active"),
  9056. $("#gui div").not("#vrOff").addClass("vrHide"),
  9057. $("#vrOffImg").css({
  9058. display: "inline-block"
  9059. }))
  9060. }),
  9061. $("#vrOff").on("click", function() {
  9062. window.vrEnabled = !1,
  9063. $("#gui div").not("#vrOff").removeClass("vrHide"),
  9064. $("#vrOffImg").css({
  9065. display: "none"
  9066. }),
  9067. $("#player canvas").css({
  9068. width: "",
  9069. height: ""
  9070. }),
  9071. $("#vr").removeClass("active")
  9072. });
  9073. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  9074. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  9075. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  9076. $("span.modelLink").text(l),
  9077. R.on("click", function(e) {
  9078. X.emit(C.PREV),
  9079. n(--E)
  9080. }),
  9081. P.on("click", function(e) {
  9082. P.text(),
  9083. X.emit(C.NEXT, {
  9084. nextAction: s[E]
  9085. }),
  9086. n(++E)
  9087. }),
  9088. w.find(".close").on("click", X.dismiss)
  9089. },
  9090. dismiss: function() {
  9091. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  9092. X.emit(C.CLOSED))
  9093. },
  9094. isDeviceSupported: c
  9095. };
  9096. a.extendObject(X, s.prototype),
  9097. $(window).resize(f);
  9098. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  9099. K = M.filter(".first").find(".gearvr"),
  9100. {
  9101. cardboard: function() {
  9102. K.addClass("hidden"),
  9103. Z.removeClass("hidden")
  9104. },
  9105. gearvr: function() {
  9106. Z.addClass("hidden"),
  9107. K.removeClass("hidden")
  9108. }
  9109. });
  9110. t.exports = X
  9111. }
  9112. , {
  9113. "../../constants": 8,
  9114. "../../enum/VRApps": 46,
  9115. "../../enum/VRPages": 48,
  9116. "../../enum/VRPlatforms": 49,
  9117. "../../localization/localize": 108,
  9118. "../../settings": 166,
  9119. "../../util/browser": 182,
  9120. "../../util/common": 185,
  9121. "./vrEvent": 85,
  9122. "./vrLink": 86,
  9123. events: 202
  9124. }],
  9125. 88: [function(e, t, i) {
  9126. "use strict";
  9127. t.exports = Object.freeze({
  9128. OPENED: "webvr.modal.opened",
  9129. SHOW_TERMS: "webvr.footer.show.terms"
  9130. })
  9131. }
  9132. , {}],
  9133. 89: [function(B, V, e) {
  9134. (function(e) {
  9135. "use strict";
  9136. function a() {
  9137. function t() {
  9138. p.isPresenting || (r.info("exiting webVR"),
  9139. c("webvr_exit_app"),
  9140. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  9141. window.removeEventListener("vrdisplaypresentchange", t))
  9142. }
  9143. r.info("Headset mounted"),
  9144. u.suspend();
  9145. var e = document.createElement("canvas");
  9146. for (e.getContext("webgl"),
  9147. e.className = "webvr-canvas",
  9148. document.bgColor = "#000",
  9149. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9150. document.body.removeChild(document.body.firstChild);
  9151. document.body.appendChild(e),
  9152. c("webvr_enter_app"),
  9153. p.requestPresent([{
  9154. source: e,
  9155. predistorted: !0
  9156. }]).catch(function(e) {
  9157. r.error("Failed to present: " + e),
  9158. c("webvr_exit_calibrate"),
  9159. t()
  9160. }),
  9161. d.then(function() {
  9162. window.dispatchEvent(new Event("vrapp-start"))
  9163. }),
  9164. window.addEventListener("vrdisplaypresentchange", t)
  9165. }
  9166. function s() {
  9167. c("webvr_modal_close"),
  9168. _.find(".enter-button").off("click", a),
  9169. E.fadeOut(g.guiAnimationSpeed, function() {
  9170. _.toggleClass("hidden", !1),
  9171. b.toggleClass("hidden", !0),
  9172. f.exitFullscreen()
  9173. }),
  9174. I.fadeIn(g.guiAnimationSpeed)
  9175. }
  9176. function t() {
  9177. M.toggleClass("hidden", !0),
  9178. S.toggleClass("hidden", !1)
  9179. }
  9180. function l() {
  9181. _.toggleClass("hidden"),
  9182. b.toggleClass("hidden")
  9183. }
  9184. function c(e) {
  9185. var t = f.isLandscape() ? "landscape" : "portrait";
  9186. i.trackAlways("showcase_gui", {
  9187. gui_action: e,
  9188. orientation: t
  9189. })
  9190. }
  9191. function h() {
  9192. var e = f.isLandscape();
  9193. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  9194. }
  9195. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  9196. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  9197. B("../../localization/localize")), n = B("../../util/common"), r = new (B("../../util/logger"))(e), o = B("events").EventEmitter, I = $("#gui"), E = $(".webvr-popup"), _ = $(".webvr-popup .page.p1"), b = $(".webvr-popup .page.p2"), w = E.find(".image"), T = $(".webvr-popup .detail.headset"), x = $(".webvr-popup .detail.phone"), S = $(".webvr-popup .tab-content.webvr"), M = $(".webvr-popup .tab-content.native"), R = "images/headset-cardboard.png", P = "https://madeby.google.com/vr/", O = "webvr_daydream_link", L = P, D = O, N = {
  9198. init: function(e, t, i, n) {
  9199. function r(e) {
  9200. e.preventDefault(),
  9201. o(e.currentTarget.id)
  9202. }
  9203. function o(i) {
  9204. F[i](),
  9205. Object.keys(F).map(function(e, t) {
  9206. $("#" + e).toggleClass("tabs-underlined", e === i)
  9207. })
  9208. }
  9209. p = i,
  9210. u = t,
  9211. y.init(m.Android, e, n),
  9212. h(),
  9213. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  9214. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  9215. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  9216. w.filter(".device-headset-side").attr("src", R),
  9217. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  9218. $("#vr").on("click", function(e) {
  9219. e.preventDefault(),
  9220. c("click_webvr_button"),
  9221. E.is(":hidden") && (N.emit(A.OPENED),
  9222. I.fadeOut(g.guiAnimationSpeed),
  9223. E.fadeIn(g.guiAnimationSpeed),
  9224. function() {
  9225. if (!d) {
  9226. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  9227. d = new Promise(function(e, t) {
  9228. var i = document.createElement("script");
  9229. i.type = "text/javascript",
  9230. i.src = n,
  9231. i.onload = e,
  9232. document.head.appendChild(i)
  9233. }
  9234. )
  9235. }
  9236. _.find(".enter-button").on("click", a)
  9237. }())
  9238. }),
  9239. $(".webvr-popup .close").on("click", function(e) {
  9240. e.preventDefault(),
  9241. _.hasClass("hidden") ? (c("webvr_help_close"),
  9242. l()) : s()
  9243. }),
  9244. $("#tabcardboard").on("click", r),
  9245. $("#tabdaydream").on("click", r),
  9246. $("#tabnative").on("click", r),
  9247. $(".webvr-popup .open-with-app").on("click", function(e) {
  9248. e.preventDefault(),
  9249. c("webvr_learn_more"),
  9250. o("tabnative"),
  9251. l()
  9252. }),
  9253. $(".webvr-popup .help").on("click", function(e) {
  9254. e.preventDefault(),
  9255. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9256. l()
  9257. }),
  9258. $(".webvr-popup .terms").on("click", function(e) {
  9259. e.preventDefault(),
  9260. c("webvr_click_terms"),
  9261. s(),
  9262. N.emit(A.SHOW_TERMS)
  9263. }),
  9264. T.on("click", function(e) {
  9265. e.preventDefault(),
  9266. c(D),
  9267. window.open(L, "_blank")
  9268. }),
  9269. x.on("click", function(e) {
  9270. e.preventDefault(),
  9271. c("webvr_phone_link"),
  9272. window.open("https://vr.google.com/daydream/phones/", "_blank")
  9273. }),
  9274. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9275. e.preventDefault(),
  9276. c("webvr_cardboard_link"),
  9277. y.launch(v.CardboardAndroid)
  9278. }),
  9279. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9280. e.preventDefault(),
  9281. c("webvr_oculus_link"),
  9282. y.launch(v.GearVR)
  9283. })
  9284. }
  9285. }, F = {
  9286. tabcardboard: function() {
  9287. w.filter(".device-headset").attr("src", R),
  9288. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  9289. L = "https://vr.google.com/cardboard/get-cardboard/",
  9290. D = "webvr_cardboard_link",
  9291. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  9292. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9293. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9294. t()
  9295. },
  9296. tabdaydream: function() {
  9297. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  9298. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9299. L = P,
  9300. D = O,
  9301. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9302. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9303. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9304. t()
  9305. },
  9306. tabnative: function() {
  9307. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9308. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9309. M.toggleClass("hidden", !1),
  9310. S.toggleClass("hidden", !0)
  9311. }
  9312. };
  9313. n.extendObject(N, o.prototype),
  9314. $(window).resize(h),
  9315. V.exports = N
  9316. }
  9317. ).call(this, "/js/gui/webvr/webVRgui.js")
  9318. }
  9319. , {
  9320. "../../analytics": 4,
  9321. "../../constants": 8,
  9322. "../../enum/VRApps": 46,
  9323. "../../enum/VRPlatforms": 49,
  9324. "../../localization/localize": 108,
  9325. "../../settings": 166,
  9326. "../../util/browser": 182,
  9327. "../../util/common": 185,
  9328. "../../util/logger": 189,
  9329. "./../gui": 65,
  9330. "./../vr/vrLink": 86,
  9331. "./WebVrEvent": 88,
  9332. events: 202
  9333. }],
  9334. 90: [function(e, t, i) {
  9335. "use strict";
  9336. function n(e, t, i, n, r) {
  9337. this.floorId = n || 0 === n ? n : -1,
  9338. this.roomId = r || "",
  9339. this.labelId = e,
  9340. this.position = (new o.Vector3).copy(t),
  9341. this.text = i
  9342. }
  9343. var o = e("three")
  9344. , r = e("../util/browser");
  9345. n.prototype.build = function() {
  9346. var e = window.document.createElement("div");
  9347. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9348. var t = window.document.createElement("div");
  9349. t.setAttribute("class", "gui-floorplan-label-text");
  9350. var i = window.document.createTextNode(this.text);
  9351. t.appendChild(i),
  9352. e.appendChild(t),
  9353. window.document.body.appendChild(e),
  9354. this.labelGui = e,
  9355. this.textBlock = t,
  9356. $(this.labelGui).hide();
  9357. var n = window.getComputedStyle(this.labelGui);
  9358. this.initialTransform = n.transform || n.webkitTransform
  9359. }
  9360. ,
  9361. t.exports = n
  9362. }
  9363. , {
  9364. "../util/browser": 182,
  9365. three: 217
  9366. }],
  9367. 91: [function(e, t, i) {
  9368. "use strict";
  9369. function n() {
  9370. this.player = null,
  9371. this.modelManager = null,
  9372. this.container = null
  9373. }
  9374. var c, o, r = e("three"), a = (e("../util/common"),
  9375. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9376. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9377. e("../util/transitions"),
  9378. e("../util/lerp"),
  9379. e("../util/browser"));
  9380. n.prototype.init = function(e, t, i) {
  9381. this.player = e,
  9382. this.modelManager = t,
  9383. this.container = i,
  9384. this.updateModel(),
  9385. this.bindEvents()
  9386. }
  9387. ,
  9388. n.prototype.bindEvents = function() {
  9389. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9390. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9391. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9392. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9393. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9394. }
  9395. ,
  9396. n.prototype.updateModel = function() {
  9397. this.model = this.modelManager.getActiveModel()
  9398. }
  9399. ,
  9400. n.prototype.handlePlayerViewChanged = function() {
  9401. this.updateLabelVisibility(),
  9402. this.updateLabelDisplay()
  9403. }
  9404. ,
  9405. n.prototype.getLabelsForFloor = function(t, i) {
  9406. return (i = i || []).length = 0,
  9407. this.model.labels.forEach(function(e) {
  9408. this.labelVisibleForFloor(e, t) && i.push(e)
  9409. }
  9410. .bind(this)),
  9411. i
  9412. }
  9413. ,
  9414. n.prototype.getLabelsForCurrentFloor = function(e) {
  9415. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9416. }
  9417. ,
  9418. n.prototype.labelVisibleForFloor = function(e, t) {
  9419. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9420. if (!this.model.showingLabels || !e.labelGui || !i)
  9421. return !1;
  9422. var n = e.floorId === this.model.floors.size() - 1;
  9423. return this.model.allFloorsVisible ? n : e.floorId === t
  9424. }
  9425. ,
  9426. n.prototype.updateLabelVisibility = function(e) {
  9427. this.model.labels.forEach(function(e) {
  9428. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex) ? this.showLabel(e, l.labels.fadeInDelay, l.labels.fadeInDuration) : this.hideLabel(e, l.labels.fadeOutDelay, l.labels.fadeOutDuration)
  9429. }
  9430. .bind(this))
  9431. }
  9432. ,
  9433. n.prototype.showAllLabels = function(t, i) {
  9434. this.model.labels.forEach(function(e) {
  9435. this.showLabel(e, t, i)
  9436. }
  9437. .bind(this))
  9438. }
  9439. ,
  9440. n.prototype.hideAllLabels = function(t, i) {
  9441. this.model.labels.forEach(function(e) {
  9442. this.hideLabel(e, t, i)
  9443. }
  9444. .bind(this))
  9445. }
  9446. ,
  9447. n.prototype.showLabel = function(e, t, i) {
  9448. this.model.showingLabels && (e.visible || (e.visible = !0,
  9449. e.labelGui.style.display = "block",
  9450. e.labelGui.style.opacity = 0,
  9451. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9452. }
  9453. ,
  9454. n.prototype.hideLabel = function(e, t, i) {
  9455. e.visible && (e.visible = !1,
  9456. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9457. }
  9458. ,
  9459. n.prototype.supportedMode = function() {
  9460. return this.player.mode === h.FLOORPLAN
  9461. }
  9462. ,
  9463. n.prototype.updateLabelDisplay = (new r.Vector3,
  9464. new r.Vector3,
  9465. o = [],
  9466. function() {
  9467. var e = this.player.getLabelScaleFactor()
  9468. , t = 1.2 * (1 - e) + .6
  9469. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9470. this.getLabelsForCurrentFloor(o);
  9471. for (var n = 0; n < o.length; n++) {
  9472. var r = o[n];
  9473. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9474. i <= e && r.text.length >= l.labels.minLengthForTruncate ? r.textBlock.innerText = r.text.substring(0, l.labels.truncateLength) + l.labels.truncateSuffix : r.textBlock.innerText = r.text)
  9475. }
  9476. }
  9477. ),
  9478. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9479. new r.Vector3,
  9480. function(e, t, i, n, r) {
  9481. t.style.fontSize = 100 * r + "%";
  9482. var o = .5 * $("#player").width()
  9483. , a = .5 * $("#player").height();
  9484. c.copy(i),
  9485. c.project(this.player.camera);
  9486. var s = c.x * o + o
  9487. , l = -c.y * a + a;
  9488. s -= e.offsetWidth / 2,
  9489. l -= e.offsetHeight / 2,
  9490. e.style.left = s + "px",
  9491. e.style.top = l + "px"
  9492. }
  9493. ),
  9494. n.prototype.handleStartInside = function(e) {
  9495. this.updateLabelVisibility()
  9496. }
  9497. ,
  9498. n.prototype.handleStartOutside = function() {
  9499. this.updateLabelVisibility()
  9500. }
  9501. ,
  9502. t.exports = n
  9503. }
  9504. , {
  9505. "../enum/DirectorEvents": 23,
  9506. "../enum/ModelManagerEvents": 33,
  9507. "../enum/PlayerEvents": 40,
  9508. "../enum/Viewmode": 51,
  9509. "../enum/WarpStyle": 52,
  9510. "../settings": 166,
  9511. "../util/browser": 182,
  9512. "../util/common": 185,
  9513. "../util/lerp": 188,
  9514. "../util/transitions": 195,
  9515. three: 217
  9516. }],
  9517. 92: [function(e, t, i) {
  9518. "use strict";
  9519. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9520. if (null == this)
  9521. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9522. if ("function" != typeof e)
  9523. throw new TypeError("predicate must be a function");
  9524. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9525. if (t = i[o],
  9526. e.call(r, t, o, i))
  9527. return o;
  9528. return -1
  9529. }
  9530. ),
  9531. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9532. value: function(e) {
  9533. if (null == this)
  9534. throw new TypeError('"this" is null or not defined');
  9535. var t = Object(this)
  9536. , i = t.length >>> 0;
  9537. if ("function" != typeof e)
  9538. throw new TypeError("predicate must be a function");
  9539. for (var n = arguments[1], r = 0; r < i; ) {
  9540. var o = t[r];
  9541. if (e.call(n, o, r, t))
  9542. return o;
  9543. r++
  9544. }
  9545. }
  9546. })
  9547. }
  9548. , {}],
  9549. 93: [function(e, t, i) {
  9550. "use strict";
  9551. var n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J, ee = ee || {};
  9552. function te() {
  9553. this.backgroundElement = document.createElement("div"),
  9554. r.extend(this.backgroundElement.style, {
  9555. backgroundColor: "rgba(0,0,0,0.8)",
  9556. top: 0,
  9557. left: 0,
  9558. display: "none",
  9559. zIndex: "1000",
  9560. opacity: 0,
  9561. WebkitTransition: "opacity 0.2s linear"
  9562. }),
  9563. n.makeFullscreen(this.backgroundElement),
  9564. this.backgroundElement.style.position = "fixed",
  9565. this.domElement = document.createElement("div"),
  9566. r.extend(this.domElement.style, {
  9567. position: "fixed",
  9568. display: "none",
  9569. zIndex: "1001",
  9570. opacity: 0,
  9571. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9572. }),
  9573. document.body.appendChild(this.backgroundElement),
  9574. document.body.appendChild(this.domElement);
  9575. var e = this;
  9576. n.bind(this.backgroundElement, "click", function() {
  9577. e.hide()
  9578. })
  9579. }
  9580. function ie(e, t, i) {
  9581. Object.defineProperty(e, t, {
  9582. get: function() {
  9583. return "RGB" === this.__state.space || re(this, t, i),
  9584. this.__state[t]
  9585. },
  9586. set: function(e) {
  9587. "RGB" !== this.__state.space && (re(this, t, i),
  9588. this.__state.space = "RGB"),
  9589. this.__state[t] = e
  9590. }
  9591. })
  9592. }
  9593. function ne(e, t) {
  9594. Object.defineProperty(e, t, {
  9595. get: function() {
  9596. return "HSV" === this.__state.space || oe(this),
  9597. this.__state[t]
  9598. },
  9599. set: function(e) {
  9600. "HSV" !== this.__state.space && (oe(this),
  9601. this.__state.space = "HSV"),
  9602. this.__state[t] = e
  9603. }
  9604. })
  9605. }
  9606. function re(e, t, i) {
  9607. if ("HEX" === e.__state.space)
  9608. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9609. else {
  9610. if ("HSV" !== e.__state.space)
  9611. throw "Corrupted color state";
  9612. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9613. }
  9614. }
  9615. function oe(e) {
  9616. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9617. l.extend(e.__state, {
  9618. s: t.s,
  9619. v: t.v
  9620. }),
  9621. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9622. }
  9623. function ae() {
  9624. if (this.__state = o.apply(this, arguments),
  9625. !1 === this.__state)
  9626. throw "Failed to interpret color arguments";
  9627. this.__state.a = this.__state.a || 1
  9628. }
  9629. function se(e) {
  9630. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9631. }
  9632. function le(e, t) {
  9633. this.initialValue = e[t],
  9634. this.domElement = document.createElement("div"),
  9635. this.object = e,
  9636. this.property = t,
  9637. this.__onChange = void 0,
  9638. this.__onFinishChange = void 0
  9639. }
  9640. (t.exports = ee).gui = ee.gui || {},
  9641. ee.utils = ee.utils || {},
  9642. ee.controllers = ee.controllers || {},
  9643. ee.dom = ee.dom || {},
  9644. ee.color = ee.color || {},
  9645. ee.utils.css = {
  9646. load: function(e, t) {
  9647. var i = (t = t || document).createElement("link");
  9648. i.type = "text/css",
  9649. i.rel = "stylesheet",
  9650. i.href = e,
  9651. t.getElementsByTagName("head")[0].appendChild(i)
  9652. },
  9653. inject: function(e, t) {
  9654. t = t || document;
  9655. var i = document.createElement("style");
  9656. i.type = "text/css",
  9657. i.innerHTML = e,
  9658. t.getElementsByTagName("head")[0].appendChild(i)
  9659. }
  9660. },
  9661. ee.utils.common = (Q = Array.prototype.forEach,
  9662. J = Array.prototype.slice,
  9663. {
  9664. BREAK: {},
  9665. extend: function(i) {
  9666. return this.each(J.call(arguments, 1), function(e) {
  9667. for (var t in e)
  9668. this.isUndefined(e[t]) || (i[t] = e[t])
  9669. }, this),
  9670. i
  9671. },
  9672. defaults: function(i) {
  9673. return this.each(J.call(arguments, 1), function(e) {
  9674. for (var t in e)
  9675. this.isUndefined(i[t]) && (i[t] = e[t])
  9676. }, this),
  9677. i
  9678. },
  9679. compose: function() {
  9680. var i = J.call(arguments);
  9681. return function() {
  9682. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9683. e = [i[t].apply(this, e)];
  9684. return e[0]
  9685. }
  9686. },
  9687. each: function(e, t, i) {
  9688. if (e)
  9689. if (Q && e.forEach && e.forEach === Q)
  9690. e.forEach(t, i);
  9691. else if (e.length === e.length + 0) {
  9692. for (var n = 0, r = e.length; n < r; n++)
  9693. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9694. return
  9695. } else
  9696. for (var n in e)
  9697. if (t.call(i, e[n], n) === this.BREAK)
  9698. return
  9699. },
  9700. defer: function(e) {
  9701. setTimeout(e, 0)
  9702. },
  9703. toArray: function(e) {
  9704. return e.toArray ? e.toArray() : J.call(e)
  9705. },
  9706. isUndefined: function(e) {
  9707. return void 0 === e
  9708. },
  9709. isNull: function(e) {
  9710. return null === e
  9711. },
  9712. isNaN: function(e) {
  9713. return e != e
  9714. },
  9715. isArray: Array.isArray || function(e) {
  9716. return e.constructor === Array
  9717. }
  9718. ,
  9719. isObject: function(e) {
  9720. return e === Object(e)
  9721. },
  9722. isNumber: function(e) {
  9723. return e === e + 0
  9724. },
  9725. isString: function(e) {
  9726. return e === e + ""
  9727. },
  9728. isBoolean: function(e) {
  9729. return !1 === e || !0 === e
  9730. },
  9731. isFunction: function(e) {
  9732. return "[object Function]" === Object.prototype.toString.call(e)
  9733. }
  9734. }),
  9735. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9736. onChange: function(e) {
  9737. return this.__onChange = e,
  9738. this
  9739. },
  9740. onFinishChange: function(e) {
  9741. return this.__onFinishChange = e,
  9742. this
  9743. },
  9744. setValue: function(e) {
  9745. return this.object[this.property] = e,
  9746. this.__onChange && this.__onChange.call(this, e),
  9747. this.updateDisplay(),
  9748. this
  9749. },
  9750. getValue: function() {
  9751. return this.object[this.property]
  9752. },
  9753. updateDisplay: function() {
  9754. return this
  9755. },
  9756. isModified: function() {
  9757. return this.initialValue !== this.getValue()
  9758. }
  9759. }),
  9760. le),
  9761. ee.dom.dom = function(c) {
  9762. function i(e) {
  9763. if ("0" === e || c.isUndefined(e))
  9764. return 0;
  9765. var t = e.match(n);
  9766. return c.isNull(t) ? 0 : parseFloat(t[1])
  9767. }
  9768. var h = {};
  9769. c.each({
  9770. HTMLEvents: ["change"],
  9771. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9772. KeyboardEvents: ["keydown"]
  9773. }, function(e, t) {
  9774. c.each(e, function(e) {
  9775. h[e] = t
  9776. })
  9777. });
  9778. var n = /(\d+(\.\d+)?)px/
  9779. , r = {
  9780. makeSelectable: function(e, t) {
  9781. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9782. return !1
  9783. }
  9784. : function() {}
  9785. ,
  9786. e.style.MozUserSelect = t ? "auto" : "none",
  9787. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9788. e.unselectable = t ? "on" : "off")
  9789. },
  9790. makeFullscreen: function(e, t, i) {
  9791. c.isUndefined(t) && (t = !0),
  9792. c.isUndefined(i) && (i = !0),
  9793. e.style.position = "absolute",
  9794. t && (e.style.left = 0,
  9795. e.style.right = 0),
  9796. i && (e.style.top = 0,
  9797. e.style.bottom = 0)
  9798. },
  9799. fakeEvent: function(e, t, i, n) {
  9800. i = i || {};
  9801. var r = h[t];
  9802. if (!r)
  9803. throw new Error("Event type " + t + " not supported.");
  9804. var o = document.createEvent(r);
  9805. switch (r) {
  9806. case "MouseEvents":
  9807. var a = i.x || i.clientX || 0
  9808. , s = i.y || i.clientY || 0;
  9809. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9810. break;
  9811. case "KeyboardEvents":
  9812. var l = o.initKeyboardEvent || o.initKeyEvent;
  9813. c.defaults(i, {
  9814. cancelable: !0,
  9815. ctrlKey: !1,
  9816. altKey: !1,
  9817. shiftKey: !1,
  9818. metaKey: !1,
  9819. keyCode: void 0,
  9820. charCode: void 0
  9821. }),
  9822. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9823. break;
  9824. default:
  9825. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9826. }
  9827. c.defaults(o, n),
  9828. e.dispatchEvent(o)
  9829. },
  9830. bind: function(e, t, i, n) {
  9831. return n = n || !1,
  9832. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9833. r
  9834. },
  9835. unbind: function(e, t, i, n) {
  9836. return n = n || !1,
  9837. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9838. r
  9839. },
  9840. addClass: function(e, t) {
  9841. if (void 0 === e.className)
  9842. e.className = t;
  9843. else if (e.className !== t) {
  9844. var i = e.className.split(/ +/);
  9845. -1 == i.indexOf(t) && (i.push(t),
  9846. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9847. }
  9848. return r
  9849. },
  9850. removeClass: function(e, t) {
  9851. if (t)
  9852. if (void 0 === e.className)
  9853. ;
  9854. else if (e.className === t)
  9855. e.removeAttribute("class");
  9856. else {
  9857. var i = e.className.split(/ +/)
  9858. , n = i.indexOf(t);
  9859. -1 != n && (i.splice(n, 1),
  9860. e.className = i.join(" "))
  9861. }
  9862. else
  9863. e.className = void 0;
  9864. return r
  9865. },
  9866. hasClass: function(e, t) {
  9867. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9868. },
  9869. getWidth: function(e) {
  9870. var t = getComputedStyle(e);
  9871. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9872. },
  9873. getHeight: function(e) {
  9874. var t = getComputedStyle(e);
  9875. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9876. },
  9877. getOffset: function(e) {
  9878. var t = {
  9879. left: 0,
  9880. top: 0
  9881. };
  9882. if (e.offsetParent)
  9883. for (; t.left += e.offsetLeft,
  9884. t.top += e.offsetTop,
  9885. e = e.offsetParent; )
  9886. ;
  9887. return t
  9888. },
  9889. isActive: function(e) {
  9890. return e === document.activeElement && (e.type || e.href)
  9891. }
  9892. };
  9893. return r
  9894. }(ee.utils.common),
  9895. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9896. X = ee.dom.dom,
  9897. Z = ee.utils.common,
  9898. (K = function(e, t, i) {
  9899. K.superclass.call(this, e, t);
  9900. var n = this;
  9901. if (this.__select = document.createElement("select"),
  9902. Z.isArray(i)) {
  9903. var r = {};
  9904. Z.each(i, function(e) {
  9905. r[e] = e
  9906. }),
  9907. i = r
  9908. }
  9909. Z.each(i, function(e, t) {
  9910. var i = document.createElement("option");
  9911. i.innerHTML = t,
  9912. i.setAttribute("value", e),
  9913. n.__select.appendChild(i)
  9914. }),
  9915. this.updateDisplay(),
  9916. X.bind(this.__select, "change", function() {
  9917. var e = this.options[this.selectedIndex].value;
  9918. n.setValue(e)
  9919. }),
  9920. this.domElement.appendChild(this.__select)
  9921. }
  9922. ).superclass = q,
  9923. Z.extend(K.prototype, q.prototype, {
  9924. setValue: function(e) {
  9925. var t = K.superclass.prototype.setValue.call(this, e);
  9926. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9927. t
  9928. },
  9929. updateDisplay: function() {
  9930. return this.__select.value = this.getValue(),
  9931. K.superclass.prototype.updateDisplay.call(this)
  9932. }
  9933. }),
  9934. K),
  9935. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9936. j = ee.utils.common,
  9937. (Y = function(e, t, i) {
  9938. Y.superclass.call(this, e, t),
  9939. i = i || {},
  9940. this.__min = i.min,
  9941. this.__max = i.max,
  9942. this.__step = i.step,
  9943. j.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,
  9944. this.__precision = se(this.__impliedStep)
  9945. }
  9946. ).superclass = W,
  9947. j.extend(Y.prototype, W.prototype, {
  9948. setValue: function(e) {
  9949. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9950. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9951. Y.superclass.prototype.setValue.call(this, e)
  9952. },
  9953. min: function(e) {
  9954. return this.__min = e,
  9955. this
  9956. },
  9957. max: function(e) {
  9958. return this.__max = e,
  9959. this
  9960. },
  9961. step: function(e) {
  9962. return this.__step = e,
  9963. this.__impliedStep = e,
  9964. this.__precision = se(e),
  9965. this
  9966. }
  9967. }),
  9968. Y),
  9969. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9970. H = ee.dom.dom,
  9971. z = ee.utils.common,
  9972. (G = function(e, t, i) {
  9973. function n() {
  9974. var e = parseFloat(s.__input.value);
  9975. z.isNaN(e) || s.setValue(e)
  9976. }
  9977. function r(e) {
  9978. var t = a - e.clientY;
  9979. s.setValue(s.getValue() + t * s.__impliedStep),
  9980. a = e.clientY
  9981. }
  9982. function o() {
  9983. H.unbind(window, "mousemove", r),
  9984. H.unbind(window, "mouseup", o)
  9985. }
  9986. this.__truncationSuspended = !1,
  9987. G.superclass.call(this, e, t, i);
  9988. var a, s = this;
  9989. this.__input = document.createElement("input"),
  9990. this.__input.setAttribute("type", "text"),
  9991. H.bind(this.__input, "change", n),
  9992. H.bind(this.__input, "blur", function() {
  9993. n(),
  9994. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9995. }),
  9996. H.bind(this.__input, "mousedown", function(e) {
  9997. H.bind(window, "mousemove", r),
  9998. H.bind(window, "mouseup", o),
  9999. a = e.clientY
  10000. }),
  10001. H.bind(this.__input, "keydown", function(e) {
  10002. 13 === e.keyCode && (s.__truncationSuspended = !0,
  10003. this.blur(),
  10004. s.__truncationSuspended = !1)
  10005. }),
  10006. this.updateDisplay(),
  10007. this.domElement.appendChild(this.__input)
  10008. }
  10009. ).superclass = U,
  10010. z.extend(G.prototype, U.prototype, {
  10011. updateDisplay: function() {
  10012. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  10013. var i = Math.pow(10, t);
  10014. return Math.round(e * i) / i
  10015. }(this.getValue(), this.__precision),
  10016. G.superclass.prototype.updateDisplay.call(this)
  10017. }
  10018. }),
  10019. G),
  10020. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  10021. F = ee.dom.dom,
  10022. B = ee.utils.css,
  10023. V = ee.utils.common,
  10024. (k = function(e, t, i, n, r) {
  10025. function o(e) {
  10026. e.preventDefault();
  10027. var t = F.getOffset(s.__background)
  10028. , i = F.getWidth(s.__background);
  10029. return s.setValue(function(e, t, i, n, r) {
  10030. return n + (e - t) / (i - t) * (r - n)
  10031. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  10032. !1
  10033. }
  10034. function a() {
  10035. F.unbind(window, "mousemove", o),
  10036. F.unbind(window, "mouseup", a),
  10037. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  10038. }
  10039. k.superclass.call(this, e, t, {
  10040. min: i,
  10041. max: n,
  10042. step: r
  10043. });
  10044. var s = this;
  10045. this.__background = document.createElement("div"),
  10046. this.__foreground = document.createElement("div"),
  10047. F.bind(this.__background, "mousedown", function(e) {
  10048. F.bind(window, "mousemove", o),
  10049. F.bind(window, "mouseup", a),
  10050. o(e)
  10051. }),
  10052. F.addClass(this.__background, "slider"),
  10053. F.addClass(this.__foreground, "slider-fg"),
  10054. this.updateDisplay(),
  10055. this.__background.appendChild(this.__foreground),
  10056. this.domElement.appendChild(this.__background)
  10057. }
  10058. ).superclass = N,
  10059. k.useDefaultStyles = function() {
  10060. B.inject("/**\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}")
  10061. }
  10062. ,
  10063. V.extend(k.prototype, N.prototype, {
  10064. updateDisplay: function() {
  10065. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10066. return this.__foreground.style.width = 100 * e + "%",
  10067. k.superclass.prototype.updateDisplay.call(this)
  10068. }
  10069. }),
  10070. k),
  10071. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  10072. O = ee.dom.dom,
  10073. L = ee.utils.common,
  10074. (D = function(e, t, i) {
  10075. D.superclass.call(this, e, t);
  10076. var n = this;
  10077. this.__button = document.createElement("div"),
  10078. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  10079. O.bind(this.__button, "click", function(e) {
  10080. return e.preventDefault(),
  10081. n.fire(),
  10082. !1
  10083. }),
  10084. O.addClass(this.__button, "button"),
  10085. this.domElement.appendChild(this.__button)
  10086. }
  10087. ).superclass = P,
  10088. L.extend(D.prototype, P.prototype, {
  10089. fire: function() {
  10090. this.__onChange && this.__onChange.call(this),
  10091. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10092. this.getValue().call(this.object)
  10093. }
  10094. }),
  10095. D),
  10096. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  10097. S = ee.dom.dom,
  10098. M = ee.utils.common,
  10099. (R = function(e, t) {
  10100. R.superclass.call(this, e, t);
  10101. var i = this;
  10102. this.__prev = this.getValue(),
  10103. this.__checkbox = document.createElement("input"),
  10104. this.__checkbox.setAttribute("type", "checkbox"),
  10105. S.bind(this.__checkbox, "change", function() {
  10106. i.setValue(!i.__prev)
  10107. }, !1),
  10108. this.domElement.appendChild(this.__checkbox),
  10109. this.updateDisplay()
  10110. }
  10111. ).superclass = x,
  10112. M.extend(R.prototype, x.prototype, {
  10113. setValue: function(e) {
  10114. var t = R.superclass.prototype.setValue.call(this, e);
  10115. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10116. this.__prev = this.getValue(),
  10117. t
  10118. },
  10119. updateDisplay: function() {
  10120. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  10121. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10122. R.superclass.prototype.updateDisplay.call(this)
  10123. }
  10124. }),
  10125. R),
  10126. ee.color.toString = (T = ee.utils.common,
  10127. function(e) {
  10128. if (1 == e.a || T.isUndefined(e.a)) {
  10129. for (var t = e.hex.toString(16); t.length < 6; )
  10130. t = "0" + t;
  10131. return "#" + t
  10132. }
  10133. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  10134. }
  10135. ),
  10136. ee.color.interpret = (I = ee.color.toString,
  10137. E = ee.utils.common,
  10138. w = [{
  10139. litmus: E.isString,
  10140. conversions: {
  10141. THREE_CHAR_HEX: {
  10142. read: function(e) {
  10143. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10144. return null !== t && {
  10145. space: "HEX",
  10146. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10147. }
  10148. },
  10149. write: I
  10150. },
  10151. SIX_CHAR_HEX: {
  10152. read: function(e) {
  10153. var t = e.match(/^#([A-F0-9]{6})$/i);
  10154. return null !== t && {
  10155. space: "HEX",
  10156. hex: parseInt("0x" + t[1].toString())
  10157. }
  10158. },
  10159. write: I
  10160. },
  10161. CSS_RGB: {
  10162. read: function(e) {
  10163. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10164. return null !== t && {
  10165. space: "RGB",
  10166. r: parseFloat(t[1]),
  10167. g: parseFloat(t[2]),
  10168. b: parseFloat(t[3])
  10169. }
  10170. },
  10171. write: I
  10172. },
  10173. CSS_RGBA: {
  10174. read: function(e) {
  10175. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10176. return null !== t && {
  10177. space: "RGB",
  10178. r: parseFloat(t[1]),
  10179. g: parseFloat(t[2]),
  10180. b: parseFloat(t[3]),
  10181. a: parseFloat(t[4])
  10182. }
  10183. },
  10184. write: I
  10185. }
  10186. }
  10187. }, {
  10188. litmus: E.isNumber,
  10189. conversions: {
  10190. HEX: {
  10191. read: function(e) {
  10192. return {
  10193. space: "HEX",
  10194. hex: e,
  10195. conversionName: "HEX"
  10196. }
  10197. },
  10198. write: function(e) {
  10199. return e.hex
  10200. }
  10201. }
  10202. }
  10203. }, {
  10204. litmus: E.isArray,
  10205. conversions: {
  10206. RGB_ARRAY: {
  10207. read: function(e) {
  10208. return 3 == e.length && {
  10209. space: "RGB",
  10210. r: e[0],
  10211. g: e[1],
  10212. b: e[2]
  10213. }
  10214. },
  10215. write: function(e) {
  10216. return [e.r, e.g, e.b]
  10217. }
  10218. },
  10219. RGBA_ARRAY: {
  10220. read: function(e) {
  10221. return 4 == e.length && {
  10222. space: "RGB",
  10223. r: e[0],
  10224. g: e[1],
  10225. b: e[2],
  10226. a: e[3]
  10227. }
  10228. },
  10229. write: function(e) {
  10230. return [e.r, e.g, e.b, e.a]
  10231. }
  10232. }
  10233. }
  10234. }, {
  10235. litmus: E.isObject,
  10236. conversions: {
  10237. RGBA_OBJ: {
  10238. read: function(e) {
  10239. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  10240. space: "RGB",
  10241. r: e.r,
  10242. g: e.g,
  10243. b: e.b,
  10244. a: e.a
  10245. }
  10246. },
  10247. write: function(e) {
  10248. return {
  10249. r: e.r,
  10250. g: e.g,
  10251. b: e.b,
  10252. a: e.a
  10253. }
  10254. }
  10255. },
  10256. RGB_OBJ: {
  10257. read: function(e) {
  10258. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  10259. space: "RGB",
  10260. r: e.r,
  10261. g: e.g,
  10262. b: e.b
  10263. }
  10264. },
  10265. write: function(e) {
  10266. return {
  10267. r: e.r,
  10268. g: e.g,
  10269. b: e.b
  10270. }
  10271. }
  10272. },
  10273. HSVA_OBJ: {
  10274. read: function(e) {
  10275. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  10276. space: "HSV",
  10277. h: e.h,
  10278. s: e.s,
  10279. v: e.v,
  10280. a: e.a
  10281. }
  10282. },
  10283. write: function(e) {
  10284. return {
  10285. h: e.h,
  10286. s: e.s,
  10287. v: e.v,
  10288. a: e.a
  10289. }
  10290. }
  10291. },
  10292. HSV_OBJ: {
  10293. read: function(e) {
  10294. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10295. space: "HSV",
  10296. h: e.h,
  10297. s: e.s,
  10298. v: e.v
  10299. }
  10300. },
  10301. write: function(e) {
  10302. return {
  10303. h: e.h,
  10304. s: e.s,
  10305. v: e.v
  10306. }
  10307. }
  10308. }
  10309. }
  10310. }],
  10311. function() {
  10312. b = !1;
  10313. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10314. return E.each(w, function(e) {
  10315. if (e.litmus(i))
  10316. return E.each(e.conversions, function(e, t) {
  10317. if (_ = e.read(i),
  10318. !1 === b && !1 !== _)
  10319. return (b = _).conversionName = t,
  10320. _.conversion = e,
  10321. E.BREAK
  10322. }),
  10323. E.BREAK
  10324. }),
  10325. b
  10326. }
  10327. ),
  10328. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10329. function y(e, t, i, n) {
  10330. if (void 0 === t[i])
  10331. throw new Error("Object " + t + ' has no property "' + i + '"');
  10332. var r;
  10333. if (n.color)
  10334. r = new g(t,i);
  10335. else {
  10336. var o = [t, i].concat(n.factoryArgs);
  10337. r = c.apply(e, o)
  10338. }
  10339. n.before instanceof h && (n.before = n.before.__li),
  10340. C(e, r),
  10341. m.addClass(r.domElement, "c");
  10342. var a = document.createElement("span");
  10343. m.addClass(a, "property-name"),
  10344. a.innerHTML = r.property;
  10345. var s = document.createElement("div");
  10346. s.appendChild(a),
  10347. s.appendChild(r.domElement);
  10348. var l = A(e, s, n.before);
  10349. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10350. m.addClass(l, typeof r.getValue()),
  10351. function(t, i, n) {
  10352. if (n.__li = i,
  10353. n.__gui = t,
  10354. v.extend(n, {
  10355. options: function(e) {
  10356. return 1 < arguments.length ? (n.remove(),
  10357. y(t, n.object, n.property, {
  10358. before: n.__li.nextElementSibling,
  10359. factoryArgs: [v.toArray(arguments)]
  10360. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10361. y(t, n.object, n.property, {
  10362. before: n.__li.nextElementSibling,
  10363. factoryArgs: [e]
  10364. })) : void 0
  10365. },
  10366. name: function(e) {
  10367. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10368. n
  10369. },
  10370. listen: function() {
  10371. return n.__gui.listen(n),
  10372. n
  10373. },
  10374. remove: function() {
  10375. return n.__gui.remove(n),
  10376. n
  10377. }
  10378. }),
  10379. n instanceof f) {
  10380. var r = new p(n.object,n.property,{
  10381. min: n.__min,
  10382. max: n.__max,
  10383. step: n.__step
  10384. });
  10385. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10386. var t = n[e]
  10387. , i = r[e];
  10388. n[e] = r[e] = function() {
  10389. var e = Array.prototype.slice.call(arguments);
  10390. return t.apply(n, e),
  10391. i.apply(r, e)
  10392. }
  10393. }),
  10394. m.addClass(i, "has-slider"),
  10395. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10396. } else if (n instanceof p) {
  10397. var e = function(e) {
  10398. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10399. y(t, n.object, n.property, {
  10400. before: n.__li.nextElementSibling,
  10401. factoryArgs: [n.__min, n.__max, n.__step]
  10402. })) : e
  10403. };
  10404. n.min = v.compose(e, n.min),
  10405. n.max = v.compose(e, n.max)
  10406. } else
  10407. n instanceof u ? (m.bind(i, "click", function() {
  10408. m.fakeEvent(n.__checkbox, "click")
  10409. }),
  10410. m.bind(n.__checkbox, "click", function(e) {
  10411. e.stopPropagation()
  10412. })) : n instanceof d ? (m.bind(i, "click", function() {
  10413. m.fakeEvent(n.__button, "click")
  10414. }),
  10415. m.bind(i, "mouseover", function() {
  10416. m.addClass(n.__button, "hover")
  10417. }),
  10418. m.bind(i, "mouseout", function() {
  10419. m.removeClass(n.__button, "hover")
  10420. })) : n instanceof g && (m.addClass(i, "color"),
  10421. n.updateDisplay = v.compose(function(e) {
  10422. return i.style.borderLeftColor = n.__color.toString(),
  10423. e
  10424. }, n.updateDisplay),
  10425. n.updateDisplay());
  10426. n.setValue = v.compose(function(e) {
  10427. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10428. e
  10429. }, n.setValue)
  10430. }(e, l, r),
  10431. e.__controllers.push(r),
  10432. r
  10433. }
  10434. function A(e, t, i) {
  10435. var n = document.createElement("li");
  10436. return t && n.appendChild(t),
  10437. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10438. e.onResize(),
  10439. n
  10440. }
  10441. function C(e, t) {
  10442. var i = e.getRoot()
  10443. , n = i.__rememberedObjects.indexOf(t.object);
  10444. if (-1 != n) {
  10445. var r = i.__rememberedObjectIndecesToControllers[n];
  10446. if (void 0 === r && (r = {},
  10447. i.__rememberedObjectIndecesToControllers[n] = r),
  10448. r[t.property] = t,
  10449. i.load && i.load.remembered) {
  10450. var o, a = i.load.remembered;
  10451. if (a[e.preset])
  10452. o = a[e.preset];
  10453. else {
  10454. if (!a[T])
  10455. return;
  10456. o = a[T]
  10457. }
  10458. if (o[n] && void 0 !== o[n][t.property]) {
  10459. var s = o[n][t.property];
  10460. t.initialValue = s,
  10461. t.setValue(s)
  10462. }
  10463. }
  10464. }
  10465. }
  10466. function I(e, t) {
  10467. return document.location.href + "." + t
  10468. }
  10469. function l(e, t) {
  10470. e.domElement.style.width = t + "px",
  10471. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10472. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10473. }
  10474. function a(r, o) {
  10475. var a = {};
  10476. return v.each(r.__rememberedObjects, function(e, t) {
  10477. var i = {}
  10478. , n = r.__rememberedObjectIndecesToControllers[t];
  10479. v.each(n, function(e, t) {
  10480. i[t] = o ? e.initialValue : e.getValue()
  10481. }),
  10482. a[t] = i
  10483. }),
  10484. a
  10485. }
  10486. function E(e, t, i) {
  10487. var n = document.createElement("option");
  10488. n.innerHTML = t,
  10489. n.value = t,
  10490. e.__preset_select.appendChild(n),
  10491. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10492. }
  10493. function _(e, t) {
  10494. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10495. i.innerHTML = t ? i.value + "*" : i.value
  10496. }
  10497. e.inject(".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");
  10498. var b, w, T = "Default", x = function() {
  10499. try {
  10500. return "localStorage"in window && null !== window.localStorage
  10501. } catch (e) {
  10502. return !1
  10503. }
  10504. }(), S = !0, s = !1, M = [], R = function(t) {
  10505. var i = this;
  10506. this.domElement = document.createElement("div"),
  10507. this.__ul = document.createElement("ul"),
  10508. this.domElement.appendChild(this.__ul),
  10509. m.addClass(this.domElement, "dg"),
  10510. this.__folders = {},
  10511. this.__controllers = [],
  10512. this.__rememberedObjects = [],
  10513. this.__rememberedObjectIndecesToControllers = [],
  10514. this.__listening = [],
  10515. t = t || {},
  10516. t = v.defaults(t, {
  10517. autoPlace: !0,
  10518. width: R.DEFAULT_WIDTH
  10519. }),
  10520. t = v.defaults(t, {
  10521. resizable: t.autoPlace,
  10522. hideable: t.autoPlace
  10523. }),
  10524. v.isUndefined(t.load) ? t.load = {
  10525. preset: T
  10526. } : t.preset && (t.load.preset = t.preset),
  10527. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10528. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10529. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10530. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10531. if (Object.defineProperties(this, {
  10532. parent: {
  10533. get: function() {
  10534. return t.parent
  10535. }
  10536. },
  10537. scrollable: {
  10538. get: function() {
  10539. return t.scrollable
  10540. }
  10541. },
  10542. autoPlace: {
  10543. get: function() {
  10544. return t.autoPlace
  10545. }
  10546. },
  10547. preset: {
  10548. get: function() {
  10549. return i.parent ? i.getRoot().preset : t.load.preset
  10550. },
  10551. set: function(e) {
  10552. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10553. function(e) {
  10554. for (var t = 0; t < e.__preset_select.length; t++)
  10555. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10556. }(this),
  10557. i.revert()
  10558. }
  10559. },
  10560. width: {
  10561. get: function() {
  10562. return t.width
  10563. },
  10564. set: function(e) {
  10565. t.width = e,
  10566. l(i, e)
  10567. }
  10568. },
  10569. name: {
  10570. get: function() {
  10571. return t.name
  10572. },
  10573. set: function(e) {
  10574. t.name = e,
  10575. a && (a.innerHTML = t.name)
  10576. }
  10577. },
  10578. closed: {
  10579. get: function() {
  10580. return t.closed
  10581. },
  10582. set: function(e) {
  10583. t.closed = e,
  10584. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10585. this.onResize(),
  10586. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10587. }
  10588. },
  10589. load: {
  10590. get: function() {
  10591. return t.load
  10592. }
  10593. },
  10594. useLocalStorage: {
  10595. get: function() {
  10596. return r
  10597. },
  10598. set: function(e) {
  10599. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10600. localStorage.setItem(I(0, "isLocal"), e))
  10601. }
  10602. }
  10603. }),
  10604. v.isUndefined(t.parent)) {
  10605. if (t.closed = !1,
  10606. m.addClass(this.domElement, R.CLASS_MAIN),
  10607. m.makeSelectable(this.domElement, !1),
  10608. x && r) {
  10609. i.useLocalStorage = !0;
  10610. var o = localStorage.getItem(I(0, "gui"));
  10611. o && (t.load = JSON.parse(o))
  10612. }
  10613. this.__closeButton = document.createElement("div"),
  10614. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10615. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10616. this.domElement.appendChild(this.__closeButton),
  10617. m.bind(this.__closeButton, "click", function() {
  10618. i.closed = !i.closed
  10619. })
  10620. } else {
  10621. void 0 === t.closed && (t.closed = !0);
  10622. var a = document.createTextNode(t.name);
  10623. m.addClass(a, "controller-name");
  10624. var s = A(i, a);
  10625. m.addClass(this.__ul, R.CLASS_CLOSED),
  10626. m.addClass(s, "title"),
  10627. m.bind(s, "click", function(e) {
  10628. return e.preventDefault(),
  10629. i.closed = !i.closed,
  10630. !1
  10631. }),
  10632. t.closed || (this.closed = !1)
  10633. }
  10634. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10635. m.addClass(w, "dg"),
  10636. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10637. document.body.appendChild(w),
  10638. S = !1),
  10639. w.appendChild(this.domElement),
  10640. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10641. this.parent || l(i, t.width)),
  10642. m.bind(window, "resize", function() {
  10643. i.onResize()
  10644. }),
  10645. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10646. i.onResize()
  10647. }),
  10648. m.bind(this.__ul, "transitionend", function() {
  10649. i.onResize()
  10650. }),
  10651. m.bind(this.__ul, "oTransitionEnd", function() {
  10652. i.onResize()
  10653. }),
  10654. this.onResize(),
  10655. t.resizable && function(t) {
  10656. function e(e) {
  10657. return e.preventDefault(),
  10658. r = e.clientX,
  10659. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10660. m.bind(window, "mousemove", i),
  10661. m.bind(window, "mouseup", n),
  10662. !1
  10663. }
  10664. function i(e) {
  10665. return e.preventDefault(),
  10666. t.width += r - e.clientX,
  10667. t.onResize(),
  10668. r = e.clientX,
  10669. !1
  10670. }
  10671. function n() {
  10672. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10673. m.unbind(window, "mousemove", i),
  10674. m.unbind(window, "mouseup", n)
  10675. }
  10676. var r;
  10677. t.__resize_handle = document.createElement("div"),
  10678. v.extend(t.__resize_handle.style, {
  10679. width: "6px",
  10680. marginLeft: "-3px",
  10681. height: "200px",
  10682. cursor: "ew-resize",
  10683. position: "absolute"
  10684. }),
  10685. m.bind(t.__resize_handle, "mousedown", e),
  10686. m.bind(t.__closeButton, "mousedown", e),
  10687. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10688. }(this),
  10689. n = function() {
  10690. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10691. }
  10692. ,
  10693. this.saveToLocalStorageIfPossible = n,
  10694. i.getRoot(),
  10695. t.parent || ((e = i.getRoot()).width += 1,
  10696. v.defer(function() {
  10697. e.width -= 1
  10698. }))
  10699. };
  10700. return R.toggleHide = function() {
  10701. s = !s,
  10702. v.each(M, function(e) {
  10703. e.domElement.style.zIndex = s ? -999 : 999,
  10704. e.domElement.style.opacity = s ? 0 : 1
  10705. })
  10706. }
  10707. ,
  10708. R.CLASS_AUTO_PLACE = "a",
  10709. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10710. R.CLASS_MAIN = "main",
  10711. R.CLASS_CONTROLLER_ROW = "cr",
  10712. R.CLASS_TOO_TALL = "taller-than-window",
  10713. R.CLASS_CLOSED = "closed",
  10714. R.CLASS_CLOSE_BUTTON = "close-button",
  10715. R.CLASS_DRAG = "drag",
  10716. R.DEFAULT_WIDTH = 245,
  10717. R.TEXT_CLOSED = "Close Controls",
  10718. R.TEXT_OPEN = "Open Controls",
  10719. m.bind(window, "keydown", function(e) {
  10720. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10721. }, !1),
  10722. v.extend(R.prototype, {
  10723. add: function(e, t) {
  10724. return y(this, e, t, {
  10725. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10726. })
  10727. },
  10728. addColor: function(e, t) {
  10729. return y(this, e, t, {
  10730. color: !0
  10731. })
  10732. },
  10733. remove: function(e) {
  10734. this.__ul.removeChild(e.__li),
  10735. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10736. var t = this;
  10737. v.defer(function() {
  10738. t.onResize()
  10739. })
  10740. },
  10741. destroy: function() {
  10742. this.autoPlace && w.removeChild(this.domElement)
  10743. },
  10744. addFolder: function(e) {
  10745. if (void 0 !== this.__folders[e])
  10746. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10747. var t = {
  10748. name: e,
  10749. parent: this
  10750. };
  10751. t.autoPlace = this.autoPlace,
  10752. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10753. t.load = this.load.folders[e]);
  10754. var i = new R(t);
  10755. this.__folders[e] = i;
  10756. var n = A(this, i.domElement);
  10757. return m.addClass(n, "folder"),
  10758. i
  10759. },
  10760. open: function() {
  10761. this.closed = !1
  10762. },
  10763. close: function() {
  10764. this.closed = !0
  10765. },
  10766. onResize: function() {
  10767. var t = this.getRoot();
  10768. if (t.scrollable) {
  10769. var e = m.getOffset(t.__ul).top
  10770. , i = 0;
  10771. v.each(t.__ul.childNodes, function(e) {
  10772. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10773. }),
  10774. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10775. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10776. t.__ul.style.height = "auto")
  10777. }
  10778. t.__resize_handle && v.defer(function() {
  10779. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10780. }),
  10781. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10782. },
  10783. remember: function() {
  10784. if (v.isUndefined(b) && ((b = new o).domElement.innerHTML = '<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>'),
  10785. this.parent)
  10786. throw new Error("You can only call remember on a top level GUI.");
  10787. var t = this;
  10788. v.each(Array.prototype.slice.call(arguments), function(e) {
  10789. 0 == t.__rememberedObjects.length && function(i) {
  10790. var e = i.__save_row = document.createElement("li");
  10791. m.addClass(i.domElement, "has-save"),
  10792. i.__ul.insertBefore(e, i.__ul.firstChild),
  10793. m.addClass(e, "save-row");
  10794. var t = document.createElement("span");
  10795. t.innerHTML = "&nbsp;",
  10796. m.addClass(t, "button gears");
  10797. var n = document.createElement("span");
  10798. n.innerHTML = "Save",
  10799. m.addClass(n, "button"),
  10800. m.addClass(n, "save");
  10801. var r = document.createElement("span");
  10802. r.innerHTML = "New",
  10803. m.addClass(r, "button"),
  10804. m.addClass(r, "save-as");
  10805. var o = document.createElement("span");
  10806. o.innerHTML = "Revert",
  10807. m.addClass(o, "button"),
  10808. m.addClass(o, "revert");
  10809. var a = i.__preset_select = document.createElement("select");
  10810. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10811. E(i, t, t == i.preset)
  10812. }) : E(i, T, !1),
  10813. m.bind(a, "change", function() {
  10814. for (var e = 0; e < i.__preset_select.length; e++)
  10815. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10816. i.preset = this.value
  10817. }),
  10818. e.appendChild(a),
  10819. e.appendChild(t),
  10820. e.appendChild(n),
  10821. e.appendChild(r),
  10822. e.appendChild(o),
  10823. x) {
  10824. var s = document.getElementById("dg-save-locally")
  10825. , l = document.getElementById("dg-local-explain");
  10826. s.style.display = "block";
  10827. var c = document.getElementById("dg-local-storage");
  10828. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10829. var h = function() {
  10830. l.style.display = i.useLocalStorage ? "block" : "none"
  10831. };
  10832. h(),
  10833. m.bind(c, "change", function() {
  10834. i.useLocalStorage = !i.useLocalStorage,
  10835. h()
  10836. })
  10837. }
  10838. var u = document.getElementById("dg-new-constructor");
  10839. m.bind(u, "keydown", function(e) {
  10840. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10841. }),
  10842. m.bind(t, "click", function() {
  10843. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10844. b.show(),
  10845. u.focus(),
  10846. u.select()
  10847. }),
  10848. m.bind(n, "click", function() {
  10849. i.save()
  10850. }),
  10851. m.bind(r, "click", function() {
  10852. var e = prompt("Enter a new preset name.");
  10853. e && i.saveAs(e)
  10854. }),
  10855. m.bind(o, "click", function() {
  10856. i.revert()
  10857. })
  10858. }(t),
  10859. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10860. }),
  10861. this.autoPlace && l(this, this.width)
  10862. },
  10863. getRoot: function() {
  10864. for (var e = this; e.parent; )
  10865. e = e.parent;
  10866. return e
  10867. },
  10868. getSaveObject: function() {
  10869. var i = this.load;
  10870. return i.closed = this.closed,
  10871. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10872. i.remembered || (i.remembered = {}),
  10873. i.remembered[this.preset] = a(this)),
  10874. i.folders = {},
  10875. v.each(this.__folders, function(e, t) {
  10876. i.folders[t] = e.getSaveObject()
  10877. }),
  10878. i
  10879. },
  10880. save: function() {
  10881. this.load.remembered || (this.load.remembered = {}),
  10882. this.load.remembered[this.preset] = a(this),
  10883. _(this, !1),
  10884. this.saveToLocalStorageIfPossible()
  10885. },
  10886. saveAs: function(e) {
  10887. this.load.remembered || (this.load.remembered = {},
  10888. this.load.remembered[T] = a(this, !0)),
  10889. this.load.remembered[e] = a(this),
  10890. this.preset = e,
  10891. E(this, e, !0),
  10892. this.saveToLocalStorageIfPossible()
  10893. },
  10894. revert: function(t) {
  10895. v.each(this.__controllers, function(e) {
  10896. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10897. }, this),
  10898. v.each(this.__folders, function(e) {
  10899. e.revert(e)
  10900. }),
  10901. t || _(this.getRoot(), !1)
  10902. },
  10903. listen: function(e) {
  10904. var t = 0 == this.__listening.length;
  10905. this.__listening.push(e),
  10906. t && function e(t) {
  10907. 0 != t.length && r(function() {
  10908. e(t)
  10909. }),
  10910. v.each(t, function(e) {
  10911. e.updateDisplay()
  10912. })
  10913. }(this.__listening)
  10914. }
  10915. }),
  10916. R
  10917. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10918. u = ee.controllers.NumberControllerBox,
  10919. d = ee.controllers.NumberControllerSlider,
  10920. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10921. y = ee.dom.dom,
  10922. A = ee.utils.common,
  10923. (C = function(e, t) {
  10924. function i() {
  10925. n.setValue(n.__input.value)
  10926. }
  10927. C.superclass.call(this, e, t);
  10928. var n = this;
  10929. this.__input = document.createElement("input"),
  10930. this.__input.setAttribute("type", "text"),
  10931. y.bind(this.__input, "keyup", i),
  10932. y.bind(this.__input, "change", i),
  10933. y.bind(this.__input, "blur", function() {
  10934. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10935. }),
  10936. y.bind(this.__input, "keydown", function(e) {
  10937. 13 === e.keyCode && this.blur()
  10938. }),
  10939. this.updateDisplay(),
  10940. this.domElement.appendChild(this.__input)
  10941. }
  10942. ).superclass = v,
  10943. A.extend(C.prototype, v.prototype, {
  10944. updateDisplay: function() {
  10945. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10946. C.superclass.prototype.updateDisplay.call(this)
  10947. }
  10948. }),
  10949. C),
  10950. f = ee.controllers.FunctionController,
  10951. g = ee.controllers.BooleanController,
  10952. m = ee.utils.common,
  10953. function(e, t) {
  10954. var i = e[t];
  10955. return m.isArray(arguments[2]) || m.isObject(arguments[2]) ? new h(e,t,arguments[2]) : m.isNumber(i) ? m.isNumber(arguments[2]) && m.isNumber(arguments[3]) ? new d(e,t,arguments[2],arguments[3]) : new u(e,t,{
  10956. min: arguments[2],
  10957. max: arguments[3]
  10958. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10959. }
  10960. ), ee.controllers.Controller, ee.controllers.BooleanController, ee.controllers.FunctionController, ee.controllers.NumberControllerBox, ee.controllers.NumberControllerSlider, ee.controllers.OptionController, ee.controllers.ColorController = function(e, h, u, d, p) {
  10961. function f(t, i, n, r) {
  10962. t.style.background = "",
  10963. p.each(o, function(e) {
  10964. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10965. })
  10966. }
  10967. var g = function(e, t) {
  10968. function i(e) {
  10969. a(e),
  10970. h.bind(window, "mousemove", a),
  10971. h.bind(window, "mouseup", n)
  10972. }
  10973. function n() {
  10974. h.unbind(window, "mousemove", a),
  10975. h.unbind(window, "mouseup", n)
  10976. }
  10977. function r() {
  10978. var e = d(this.value);
  10979. !1 !== e ? (l.__color.__state = e,
  10980. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10981. }
  10982. function o() {
  10983. h.unbind(window, "mousemove", s),
  10984. h.unbind(window, "mouseup", o)
  10985. }
  10986. function a(e) {
  10987. e.preventDefault();
  10988. var t = h.getWidth(l.__saturation_field)
  10989. , i = h.getOffset(l.__saturation_field)
  10990. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10991. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10992. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10993. 1 < n ? n = 1 : n < 0 && (n = 0),
  10994. l.__color.v = r,
  10995. l.__color.s = n,
  10996. l.setValue(l.__color.toOriginal()),
  10997. !1
  10998. }
  10999. function s(e) {
  11000. e.preventDefault();
  11001. var t = h.getHeight(l.__hue_field)
  11002. , i = h.getOffset(l.__hue_field)
  11003. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  11004. return 1 < n ? n = 1 : n < 0 && (n = 0),
  11005. l.__color.h = 360 * n,
  11006. l.setValue(l.__color.toOriginal()),
  11007. !1
  11008. }
  11009. g.superclass.call(this, e, t),
  11010. this.__color = new u(this.getValue()),
  11011. this.__temp = new u(0);
  11012. var l = this;
  11013. this.domElement = document.createElement("div"),
  11014. h.makeSelectable(this.domElement, !1),
  11015. this.__selector = document.createElement("div"),
  11016. this.__selector.className = "selector",
  11017. this.__saturation_field = document.createElement("div"),
  11018. this.__saturation_field.className = "saturation-field",
  11019. this.__field_knob = document.createElement("div"),
  11020. this.__field_knob.className = "field-knob",
  11021. this.__field_knob_border = "2px solid ",
  11022. this.__hue_knob = document.createElement("div"),
  11023. this.__hue_knob.className = "hue-knob",
  11024. this.__hue_field = document.createElement("div"),
  11025. this.__hue_field.className = "hue-field",
  11026. this.__input = document.createElement("input"),
  11027. this.__input.type = "text",
  11028. this.__input_textShadow = "0 1px 1px ",
  11029. h.bind(this.__input, "keydown", function(e) {
  11030. 13 === e.keyCode && r.call(this)
  11031. }),
  11032. h.bind(this.__input, "blur", r),
  11033. h.bind(this.__selector, "mousedown", function(e) {
  11034. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11035. h.removeClass(l.__selector, "drag")
  11036. })
  11037. });
  11038. var c = document.createElement("div");
  11039. p.extend(this.__selector.style, {
  11040. width: "122px",
  11041. height: "102px",
  11042. padding: "3px",
  11043. backgroundColor: "#222",
  11044. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11045. }),
  11046. p.extend(this.__field_knob.style, {
  11047. position: "absolute",
  11048. width: "12px",
  11049. height: "12px",
  11050. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11051. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11052. borderRadius: "12px",
  11053. zIndex: 1
  11054. }),
  11055. p.extend(this.__hue_knob.style, {
  11056. position: "absolute",
  11057. width: "15px",
  11058. height: "2px",
  11059. borderRight: "4px solid #fff",
  11060. zIndex: 1
  11061. }),
  11062. p.extend(this.__saturation_field.style, {
  11063. width: "100px",
  11064. height: "100px",
  11065. border: "1px solid #555",
  11066. marginRight: "3px",
  11067. display: "inline-block",
  11068. cursor: "pointer"
  11069. }),
  11070. p.extend(c.style, {
  11071. width: "100%",
  11072. height: "100%",
  11073. background: "none"
  11074. }),
  11075. f(c, "top", "rgba(0,0,0,0)", "#000"),
  11076. p.extend(this.__hue_field.style, {
  11077. width: "15px",
  11078. height: "100px",
  11079. display: "inline-block",
  11080. border: "1px solid #555",
  11081. cursor: "ns-resize"
  11082. }),
  11083. function(e) {
  11084. e.style.background = "",
  11085. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11086. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11087. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11088. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11089. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11090. }(this.__hue_field),
  11091. p.extend(this.__input.style, {
  11092. outline: "none",
  11093. textAlign: "center",
  11094. color: "#fff",
  11095. border: 0,
  11096. fontWeight: "bold",
  11097. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11098. }),
  11099. h.bind(this.__saturation_field, "mousedown", i),
  11100. h.bind(this.__field_knob, "mousedown", i),
  11101. h.bind(this.__hue_field, "mousedown", function(e) {
  11102. s(e),
  11103. h.bind(window, "mousemove", s),
  11104. h.bind(window, "mouseup", o)
  11105. }),
  11106. this.__saturation_field.appendChild(c),
  11107. this.__selector.appendChild(this.__field_knob),
  11108. this.__selector.appendChild(this.__saturation_field),
  11109. this.__selector.appendChild(this.__hue_field),
  11110. this.__hue_field.appendChild(this.__hue_knob),
  11111. this.domElement.appendChild(this.__input),
  11112. this.domElement.appendChild(this.__selector),
  11113. this.updateDisplay()
  11114. };
  11115. g.superclass = e,
  11116. p.extend(g.prototype, e.prototype, {
  11117. updateDisplay: function() {
  11118. var t = d(this.getValue());
  11119. if (!1 !== t) {
  11120. var i = !1;
  11121. p.each(u.COMPONENTS, function(e) {
  11122. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  11123. return i = !0,
  11124. {}
  11125. }, this),
  11126. i && p.extend(this.__color.__state, t)
  11127. }
  11128. p.extend(this.__temp.__state, this.__color.__state),
  11129. this.__temp.a = 1;
  11130. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  11131. , n = 255 - e;
  11132. p.extend(this.__field_knob.style, {
  11133. marginLeft: 100 * this.__color.s - 7 + "px",
  11134. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11135. backgroundColor: this.__temp.toString(),
  11136. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  11137. }),
  11138. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11139. this.__temp.s = 1,
  11140. this.__temp.v = 1,
  11141. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11142. p.extend(this.__input.style, {
  11143. backgroundColor: this.__input.value = this.__color.toString(),
  11144. color: "rgb(" + e + "," + e + "," + e + ")",
  11145. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  11146. })
  11147. }
  11148. });
  11149. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11150. return g
  11151. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  11152. a = ee.color.math = {
  11153. hsv_to_rgb: function(e, t, i) {
  11154. var n = Math.floor(e / 60) % 6
  11155. , r = e / 60 - Math.floor(e / 60)
  11156. , o = i * (1 - t)
  11157. , a = i * (1 - r * t)
  11158. , s = i * (1 - (1 - r) * t)
  11159. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11160. return {
  11161. r: 255 * l[0],
  11162. g: 255 * l[1],
  11163. b: 255 * l[2]
  11164. }
  11165. },
  11166. rgb_to_hsv: function(e, t, i) {
  11167. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  11168. return 0 == o ? {
  11169. h: NaN,
  11170. s: 0,
  11171. v: 0
  11172. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  11173. (n /= 6) < 0 && (n += 1),
  11174. {
  11175. h: 360 * n,
  11176. s: a / o,
  11177. v: o / 255
  11178. })
  11179. },
  11180. rgb_to_hex: function(e, t, i) {
  11181. var n = this.hex_with_component(0, 2, e);
  11182. return n = this.hex_with_component(n, 1, t),
  11183. this.hex_with_component(n, 0, i)
  11184. },
  11185. component_from_hex: function(e, t) {
  11186. return e >> 8 * t & 255
  11187. },
  11188. hex_with_component: function(e, t, i) {
  11189. return i << (c = 8 * t) | e & ~(255 << c)
  11190. }
  11191. },
  11192. s = ee.color.toString,
  11193. l = ee.utils.common,
  11194. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11195. l.extend(ae.prototype, {
  11196. toString: function() {
  11197. return s(this)
  11198. },
  11199. toOriginal: function() {
  11200. return this.__state.conversion.write(this)
  11201. }
  11202. }),
  11203. ie(ae.prototype, "r", 2),
  11204. ie(ae.prototype, "g", 1),
  11205. ie(ae.prototype, "b", 0),
  11206. ne(ae.prototype, "h"),
  11207. ne(ae.prototype, "s"),
  11208. ne(ae.prototype, "v"),
  11209. Object.defineProperty(ae.prototype, "a", {
  11210. get: function() {
  11211. return this.__state.a
  11212. },
  11213. set: function(e) {
  11214. this.__state.a = e
  11215. }
  11216. }),
  11217. Object.defineProperty(ae.prototype, "hex", {
  11218. get: function() {
  11219. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  11220. this.__state.hex
  11221. },
  11222. set: function(e) {
  11223. this.__state.space = "HEX",
  11224. this.__state.hex = e
  11225. }
  11226. }),
  11227. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11228. window.setTimeout(e, 1e3 / 60)
  11229. }
  11230. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  11231. r = ee.utils.common,
  11232. te.prototype.show = function() {
  11233. var e = this;
  11234. this.backgroundElement.style.display = "block",
  11235. this.domElement.style.display = "block",
  11236. this.domElement.style.opacity = 0,
  11237. this.domElement.style.webkitTransform = "scale(1.1)",
  11238. this.layout(),
  11239. r.defer(function() {
  11240. e.backgroundElement.style.opacity = 1,
  11241. e.domElement.style.opacity = 1,
  11242. e.domElement.style.webkitTransform = "scale(1)"
  11243. })
  11244. }
  11245. ,
  11246. te.prototype.hide = function() {
  11247. var e = this
  11248. , t = function() {
  11249. e.domElement.style.display = "none",
  11250. e.backgroundElement.style.display = "none",
  11251. n.unbind(e.domElement, "webkitTransitionEnd", t),
  11252. n.unbind(e.domElement, "transitionend", t),
  11253. n.unbind(e.domElement, "oTransitionEnd", t)
  11254. };
  11255. n.bind(this.domElement, "webkitTransitionEnd", t),
  11256. n.bind(this.domElement, "transitionend", t),
  11257. n.bind(this.domElement, "oTransitionEnd", t),
  11258. this.backgroundElement.style.opacity = 0,
  11259. this.domElement.style.opacity = 0,
  11260. this.domElement.style.webkitTransform = "scale(1.1)"
  11261. }
  11262. ,
  11263. te.prototype.layout = function() {
  11264. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  11265. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  11266. }
  11267. ,
  11268. te), ee.dom.dom, ee.utils.common)
  11269. }
  11270. , {}],
  11271. 94: [function(e, t, i) {
  11272. (function(J) {
  11273. "use strict";
  11274. function i(e) {
  11275. function t(e, t) {
  11276. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11277. for (var a = 1; a <= e[o]; a++)
  11278. r[t[n]] = [],
  11279. r[t[n]][0] = i,
  11280. r[t[n]][1] = o,
  11281. n++,
  11282. i++;
  11283. i *= 2
  11284. }
  11285. return r
  11286. }
  11287. function _(e) {
  11288. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  11289. t & 1 << i && (B |= 1 << V),
  11290. i--,
  11291. --V < 0 && (255 == B ? (b(255),
  11292. b(0)) : b(B),
  11293. V = 7,
  11294. B = 0)
  11295. }
  11296. function b(e) {
  11297. F.push(e)
  11298. }
  11299. function w(e) {
  11300. b(e >> 8 & 255),
  11301. b(255 & e)
  11302. }
  11303. function T(e, t, i, n, r) {
  11304. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11305. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11306. for (h = 0; h < 8; ++h) {
  11307. i = e[d],
  11308. n = e[d + 1],
  11309. r = e[d + 2],
  11310. o = e[d + 3],
  11311. a = e[d + 4],
  11312. s = e[d + 5],
  11313. l = e[d + 6];
  11314. var p = i + (c = e[d + 7])
  11315. , f = i - c
  11316. , g = n + l
  11317. , m = n - l
  11318. , v = r + s
  11319. , y = r - s
  11320. , A = o + a
  11321. , C = o - a
  11322. , I = p + A
  11323. , E = p - A
  11324. , _ = g + v
  11325. , b = g - v;
  11326. e[d] = I + _,
  11327. e[d + 4] = I - _;
  11328. var w = .707106781 * (b + E);
  11329. e[d + 2] = E + w,
  11330. e[d + 6] = E - w;
  11331. var T = .382683433 * ((I = C + y) - (b = m + f))
  11332. , x = .5411961 * I + T
  11333. , S = 1.306562965 * b + T
  11334. , M = .707106781 * (_ = y + m)
  11335. , R = f + M
  11336. , P = f - M;
  11337. e[d + 5] = P + x,
  11338. e[d + 3] = P - x,
  11339. e[d + 1] = R + S,
  11340. e[d + 7] = R - S,
  11341. d += 8
  11342. }
  11343. for (h = d = 0; h < 8; ++h) {
  11344. i = e[d],
  11345. n = e[d + 8],
  11346. r = e[d + 16],
  11347. o = e[d + 24],
  11348. a = e[d + 32],
  11349. s = e[d + 40],
  11350. l = e[d + 48];
  11351. var O = i + (c = e[d + 56])
  11352. , L = i - c
  11353. , D = n + l
  11354. , N = n - l
  11355. , F = r + s
  11356. , B = r - s
  11357. , V = o + a
  11358. , k = o - a
  11359. , U = O + V
  11360. , H = O - V
  11361. , z = D + F
  11362. , G = D - F;
  11363. e[d] = U + z,
  11364. e[d + 32] = U - z;
  11365. var W = .707106781 * (G + H);
  11366. e[d + 16] = H + W,
  11367. e[d + 48] = H - W;
  11368. var j = .382683433 * ((U = k + B) - (G = N + L))
  11369. , Y = .5411961 * U + j
  11370. , q = 1.306562965 * G + j
  11371. , X = .707106781 * (z = B + N)
  11372. , Z = L + X
  11373. , K = L - X;
  11374. e[d + 40] = K + Y,
  11375. e[d + 24] = K - Y,
  11376. e[d + 8] = Z + q,
  11377. e[d + 56] = Z - q,
  11378. d++
  11379. }
  11380. for (h = 0; h < 64; ++h)
  11381. u = e[h] * t[h],
  11382. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11383. return Q
  11384. }(e, t), c = 0; c < 64; ++c)
  11385. A[C[c]] = l[c];
  11386. var h = A[0] - i;
  11387. i = A[0],
  11388. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11389. _(v[o]));
  11390. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11391. ;
  11392. if (0 == u)
  11393. return _(a),
  11394. i;
  11395. for (var d, p = 1; p <= u; ) {
  11396. for (var f = p; 0 == A[p] && p <= u; ++p)
  11397. ;
  11398. var g = p - f;
  11399. if (16 <= g) {
  11400. d = g >> 4;
  11401. for (var m = 1; m <= d; ++m)
  11402. _(s);
  11403. g &= 15
  11404. }
  11405. o = 32767 + A[p],
  11406. _(r[(g << 4) + y[o]]),
  11407. _(v[o]),
  11408. p++
  11409. }
  11410. return 63 != u && _(a),
  11411. i
  11412. }
  11413. function x(e) {
  11414. if (e <= 0 && (e = 1),
  11415. 100 < e && (e = 100),
  11416. i != e) {
  11417. (function(e) {
  11418. 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++) {
  11419. var n = u((t[i] * e + 50) / 100);
  11420. n < 1 ? n = 1 : 255 < n && (n = 255),
  11421. O[C[i]] = n
  11422. }
  11423. 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++) {
  11424. var a = u((r[o] * e + 50) / 100);
  11425. a < 1 ? a = 1 : 255 < a && (a = 255),
  11426. L[C[o]] = a
  11427. }
  11428. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11429. for (var h = 0; h < 8; h++)
  11430. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11431. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11432. l++
  11433. }
  11434. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11435. i = e
  11436. }
  11437. }
  11438. var S, M, R, P, i, u = (Math.round,
  11439. Math.floor), O = new Array(64), L = new Array(64), D = new Array(64), N = new Array(64), v = new Array(65535), y = new Array(65535), Q = new Array(64), A = new Array(64), F = [], B = 0, V = 7, k = new Array(64), U = new Array(64), H = new Array(64), n = new Array(256), z = new Array(2048), C = [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], G = [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], q = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], X = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], Z = [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];
  11440. this.encode = function(e, t) {
  11441. var i = ((new Date).getTime(),
  11442. t.quality);
  11443. i && x(i),
  11444. F = new Array,
  11445. B = 0,
  11446. V = 7,
  11447. w(65496),
  11448. w(65504),
  11449. w(16),
  11450. b(74),
  11451. b(70),
  11452. b(73),
  11453. b(70),
  11454. b(0),
  11455. b(1),
  11456. b(1),
  11457. b(0),
  11458. w(1),
  11459. w(1),
  11460. b(0),
  11461. b(0),
  11462. function() {
  11463. w(65499),
  11464. w(132),
  11465. b(0);
  11466. for (var e = 0; e < 64; e++)
  11467. b(O[e]);
  11468. b(1);
  11469. for (var t = 0; t < 64; t++)
  11470. b(L[t])
  11471. }(),
  11472. function(e, t) {
  11473. w(65472),
  11474. w(17),
  11475. b(8),
  11476. w(t),
  11477. w(e),
  11478. b(3),
  11479. b(1),
  11480. b(17),
  11481. b(0),
  11482. b(2),
  11483. b(17),
  11484. b(1),
  11485. b(3),
  11486. b(17),
  11487. b(1)
  11488. }(e.width, e.height),
  11489. function() {
  11490. w(65476),
  11491. w(418),
  11492. b(0);
  11493. for (var e = 0; e < 16; e++)
  11494. b(G[e + 1]);
  11495. for (var t = 0; t <= 11; t++)
  11496. b(W[t]);
  11497. b(16);
  11498. for (var i = 0; i < 16; i++)
  11499. b(j[i + 1]);
  11500. for (var n = 0; n <= 161; n++)
  11501. b(Y[n]);
  11502. b(1);
  11503. for (var r = 0; r < 16; r++)
  11504. b(q[r + 1]);
  11505. for (var o = 0; o <= 11; o++)
  11506. b(X[o]);
  11507. b(17);
  11508. for (var a = 0; a < 16; a++)
  11509. b(Z[a + 1]);
  11510. for (var s = 0; s <= 161; s++)
  11511. b(K[s])
  11512. }(),
  11513. w(65498),
  11514. w(12),
  11515. b(3),
  11516. b(1),
  11517. b(0),
  11518. b(2),
  11519. b(17),
  11520. b(3),
  11521. b(17),
  11522. b(0),
  11523. b(63),
  11524. b(0);
  11525. var n = 0
  11526. , r = 0
  11527. , o = 0;
  11528. B = 0,
  11529. V = 7,
  11530. this.encode.displayName = "_encode_";
  11531. for (var a, s, l, c, h, u, d, p, f, g = e.data, m = e.width, v = e.height, y = t.flipY, A = 4 * m, C = y ? v : 0, I = y ? -8 : 8; y && 0 < C || !y && C < v; ) {
  11532. for (a = 0; a < A; ) {
  11533. for (u = h = A * C + a,
  11534. d = -1,
  11535. f = p = 0; f < 64; f++)
  11536. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11537. v <= C + p && (u -= A * (C + 1 + p - v)),
  11538. A <= a + d && (u -= a + d - A + 4),
  11539. s = g[u++],
  11540. l = g[u++],
  11541. c = g[u++],
  11542. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11543. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11544. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11545. n = T(k, D, n, S, R),
  11546. r = T(U, N, r, M, P),
  11547. o = T(H, N, o, M, P),
  11548. a += 32
  11549. }
  11550. C += I
  11551. }
  11552. if (0 <= V) {
  11553. var E = [];
  11554. E[1] = V + 1,
  11555. E[0] = (1 << V + 1) - 1,
  11556. _(E)
  11557. }
  11558. return w(65497),
  11559. new J(F)
  11560. }
  11561. ,
  11562. (new Date).getTime(),
  11563. e = e || 50,
  11564. function() {
  11565. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11566. n[t] = e(t)
  11567. }(),
  11568. S = t(G, W),
  11569. M = t(q, X),
  11570. R = t(j, Y),
  11571. P = t(Z, K),
  11572. function() {
  11573. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11574. for (var n = e; n < t; n++)
  11575. y[32767 + n] = i,
  11576. v[32767 + n] = [],
  11577. v[32767 + n][1] = i,
  11578. v[32767 + n][0] = n;
  11579. for (var r = -(t - 1); r <= -e; r++)
  11580. y[32767 + r] = i,
  11581. v[32767 + r] = [],
  11582. v[32767 + r][1] = i,
  11583. v[32767 + r][0] = t - 1 + r;
  11584. e <<= 1,
  11585. t <<= 1
  11586. }
  11587. }(),
  11588. function() {
  11589. for (var e = 0; e < 256; e++)
  11590. z[e] = 19595 * e,
  11591. z[e + 256 >> 0] = 38470 * e,
  11592. z[e + 512 >> 0] = 7471 * e + 32768,
  11593. z[e + 768 >> 0] = -11059 * e,
  11594. z[e + 1024 >> 0] = -21709 * e,
  11595. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11596. z[e + 1536 >> 0] = -27439 * e,
  11597. z[e + 1792 >> 0] = -5329 * e
  11598. }(),
  11599. x(e),
  11600. (new Date).getTime()
  11601. }
  11602. t.exports.encode = function(e, t) {
  11603. return (t = t || {}).quality = t.quality || 50,
  11604. {
  11605. data: new i(t.quality).encode(e, t),
  11606. width: e.width,
  11607. height: e.height
  11608. }
  11609. }
  11610. }
  11611. ).call(this, e("buffer").Buffer)
  11612. }
  11613. , {
  11614. buffer: 198
  11615. }],
  11616. 95: [function(e, t, i) {
  11617. "use strict";
  11618. !function() {
  11619. if ("performance"in window == 0 && (window.performance = {}),
  11620. Date.now = Date.now || function() {
  11621. return (new Date).getTime()
  11622. }
  11623. ,
  11624. "now"in window.performance == 0) {
  11625. var e = Date.now();
  11626. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11627. window.performance.now = function() {
  11628. return Date.now() - e
  11629. }
  11630. }
  11631. }()
  11632. }
  11633. , {}],
  11634. 96: [function(e, t, i) {
  11635. "use strict";
  11636. var a = e("three");
  11637. a.EffectComposer = function(e, t) {
  11638. if (this.renderer = e,
  11639. void 0 === t) {
  11640. var i = {
  11641. minFilter: a.LinearFilter,
  11642. magFilter: a.LinearFilter,
  11643. format: a.RGBAFormat,
  11644. stencilBuffer: !1
  11645. }
  11646. , n = e.getSize();
  11647. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11648. }
  11649. this.renderTarget1 = t,
  11650. this.renderTarget2 = t.clone(),
  11651. this.writeBuffer = this.renderTarget1,
  11652. this.readBuffer = this.renderTarget2,
  11653. this.passes = [],
  11654. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11655. this.copyPass = new a.ShaderPass(a.CopyShader)
  11656. }
  11657. ,
  11658. a.EffectComposer.prototype = {
  11659. swapBuffers: function() {
  11660. var e = this.readBuffer;
  11661. this.readBuffer = this.writeBuffer,
  11662. this.writeBuffer = e
  11663. },
  11664. addPass: function(e) {
  11665. this.passes.push(e)
  11666. },
  11667. insertPass: function(e, t) {
  11668. this.passes.splice(t, 0, e)
  11669. },
  11670. render: function(e) {
  11671. this.writeBuffer = this.renderTarget1,
  11672. this.readBuffer = this.renderTarget2;
  11673. var t, i, n = !1, r = this.passes.length;
  11674. for (i = 0; i < r; i++)
  11675. if ((t = this.passes[i]).enabled) {
  11676. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11677. t.needsSwap) {
  11678. if (n) {
  11679. var o = this.renderer.context;
  11680. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11681. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11682. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11683. }
  11684. this.swapBuffers()
  11685. }
  11686. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11687. }
  11688. },
  11689. reset: function(e) {
  11690. if (void 0 === e) {
  11691. var t = this.renderer.getSize();
  11692. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11693. }
  11694. this.renderTarget1.dispose(),
  11695. this.renderTarget2.dispose(),
  11696. this.renderTarget1 = e,
  11697. this.renderTarget2 = e.clone(),
  11698. this.writeBuffer = this.renderTarget1,
  11699. this.readBuffer = this.renderTarget2
  11700. },
  11701. setSize: function(e, t) {
  11702. this.renderTarget1.setSize(e, t),
  11703. this.renderTarget2.setSize(e, t)
  11704. }
  11705. }
  11706. }
  11707. , {
  11708. three: 217
  11709. }],
  11710. 97: [function(e, t, i) {
  11711. "use strict";
  11712. var n = e("three");
  11713. n.MaskPass = function(e, t) {
  11714. this.scene = e,
  11715. this.camera = t,
  11716. this.enabled = !0,
  11717. this.clear = !0,
  11718. this.needsSwap = !1,
  11719. this.inverse = !1
  11720. }
  11721. ,
  11722. n.MaskPass.prototype = {
  11723. render: function(e, t, i, n) {
  11724. var r, o, a = e.context;
  11725. a.colorMask(!1, !1, !1, !1),
  11726. a.depthMask(!1),
  11727. o = this.inverse ? (r = 0,
  11728. 1) : (r = 1,
  11729. 0),
  11730. a.enable(a.STENCIL_TEST),
  11731. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11732. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11733. a.clearStencil(o),
  11734. e.render(this.scene, this.camera, i, this.clear),
  11735. e.render(this.scene, this.camera, t, this.clear),
  11736. a.colorMask(!0, !0, !0, !0),
  11737. a.depthMask(!0),
  11738. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11739. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11740. }
  11741. },
  11742. n.ClearMaskPass = function() {
  11743. this.enabled = !0
  11744. }
  11745. ,
  11746. n.ClearMaskPass.prototype = {
  11747. render: function(e, t, i, n) {
  11748. var r = e.context;
  11749. r.disable(r.STENCIL_TEST)
  11750. }
  11751. }
  11752. }
  11753. , {
  11754. three: 217
  11755. }],
  11756. 98: [function(e, t, i) {
  11757. "use strict";
  11758. var o = e("three");
  11759. o.RenderPass = function(e, t, i, n, r) {
  11760. this.scene = e,
  11761. this.camera = t,
  11762. this.overrideMaterial = i,
  11763. this.clearColor = n,
  11764. this.clearAlpha = void 0 !== r ? r : 1,
  11765. this.oldClearColor = new o.Color,
  11766. this.oldClearAlpha = 1,
  11767. this.enabled = !0,
  11768. this.clear = !0,
  11769. this.needsSwap = !1
  11770. }
  11771. ,
  11772. o.RenderPass.prototype = {
  11773. render: function(e, t, i, n) {
  11774. this.scene.overrideMaterial = this.overrideMaterial,
  11775. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11776. this.oldClearAlpha = e.getClearAlpha(),
  11777. e.setClearColor(this.clearColor, this.clearAlpha)),
  11778. e.render(this.scene, this.camera, i, this.clear),
  11779. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11780. this.scene.overrideMaterial = null
  11781. }
  11782. }
  11783. }
  11784. , {
  11785. three: 217
  11786. }],
  11787. 99: [function(e, t, i) {
  11788. "use strict";
  11789. var n = e("three");
  11790. n.ShaderPass = function(e, t) {
  11791. this.textureID = void 0 !== t ? t : "tDiffuse",
  11792. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11793. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11794. this.material = new n.ShaderMaterial({
  11795. defines: e.defines || {},
  11796. uniforms: this.uniforms,
  11797. vertexShader: e.vertexShader,
  11798. fragmentShader: e.fragmentShader
  11799. })),
  11800. this.renderToScreen = !1,
  11801. this.enabled = !0,
  11802. this.needsSwap = !0,
  11803. this.clear = !1,
  11804. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11805. this.scene = new n.Scene,
  11806. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11807. this.scene.add(this.quad)
  11808. }
  11809. ,
  11810. n.ShaderPass.prototype = {
  11811. render: function(e, t, i, n) {
  11812. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11813. this.quad.material = this.material,
  11814. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11815. }
  11816. }
  11817. }
  11818. , {
  11819. three: 217
  11820. }],
  11821. 100: [function(e, t, i) {
  11822. "use strict";
  11823. e("three").CopyShader = {
  11824. uniforms: {
  11825. tDiffuse: {
  11826. type: "t",
  11827. value: null
  11828. },
  11829. opacity: {
  11830. type: "f",
  11831. value: 1
  11832. }
  11833. },
  11834. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11835. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11836. }
  11837. }
  11838. , {
  11839. three: 217
  11840. }],
  11841. 101: [function(e, t, i) {
  11842. "use strict";
  11843. e("three").HorizontalBlurShader = {
  11844. uniforms: {
  11845. tDiffuse: {
  11846. type: "t",
  11847. value: null
  11848. },
  11849. h: {
  11850. type: "f",
  11851. value: 1 / 512
  11852. }
  11853. },
  11854. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11855. 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")
  11856. }
  11857. }
  11858. , {
  11859. three: 217
  11860. }],
  11861. 102: [function(e, t, i) {
  11862. "use strict";
  11863. e("three").VerticalBlurShader = {
  11864. uniforms: {
  11865. tDiffuse: {
  11866. type: "t",
  11867. value: null
  11868. },
  11869. v: {
  11870. type: "f",
  11871. value: 1 / 512
  11872. }
  11873. },
  11874. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11875. 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")
  11876. }
  11877. }
  11878. , {
  11879. three: 217
  11880. }],
  11881. 103: [function(e, t, i) {
  11882. "use strict";
  11883. var z = e("three");
  11884. !function() {
  11885. if ("performance"in window == 0 && (window.performance = {}),
  11886. "now"in window.performance == 0) {
  11887. var e = Date.now();
  11888. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11889. window.performance.now = function() {
  11890. return Date.now() - e
  11891. }
  11892. }
  11893. }(),
  11894. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11895. var t, i = this.extensions, n = this.context;
  11896. if (e === z.RepeatWrapping)
  11897. return n.REPEAT;
  11898. if (e === z.ClampToEdgeWrapping)
  11899. return n.CLAMP_TO_EDGE;
  11900. if (e === z.MirroredRepeatWrapping)
  11901. return n.MIRRORED_REPEAT;
  11902. if (e === z.NearestFilter)
  11903. return n.NEAREST;
  11904. if (e === z.NearestMipMapNearestFilter)
  11905. return n.NEAREST_MIPMAP_NEAREST;
  11906. if (e === z.NearestMipMapLinearFilter)
  11907. return n.NEAREST_MIPMAP_LINEAR;
  11908. if (e === z.LinearFilter)
  11909. return n.LINEAR;
  11910. if (e === z.LinearMipMapNearestFilter)
  11911. return n.LINEAR_MIPMAP_NEAREST;
  11912. if (e === z.LinearMipMapLinearFilter)
  11913. return n.LINEAR_MIPMAP_LINEAR;
  11914. if (e === z.UnsignedByteType)
  11915. return n.UNSIGNED_BYTE;
  11916. if (e === z.UnsignedShort4444Type)
  11917. return n.UNSIGNED_SHORT_4_4_4_4;
  11918. if (e === z.UnsignedShort5551Type)
  11919. return n.UNSIGNED_SHORT_5_5_5_1;
  11920. if (e === z.UnsignedShort565Type)
  11921. return n.UNSIGNED_SHORT_5_6_5;
  11922. if (e === z.ByteType)
  11923. return n.BYTE;
  11924. if (e === z.ShortType)
  11925. return n.SHORT;
  11926. if (e === z.UnsignedShortType)
  11927. return n.UNSIGNED_SHORT;
  11928. if (e === z.IntType)
  11929. return n.INT;
  11930. if (e === z.UnsignedIntType)
  11931. return n.UNSIGNED_INT;
  11932. if (e === z.FloatType)
  11933. return n.FLOAT;
  11934. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11935. return t.HALF_FLOAT_OES;
  11936. if (e === z.AlphaFormat)
  11937. return n.ALPHA;
  11938. if (e === z.RGBFormat)
  11939. return n.RGB;
  11940. if (e === z.RGBAFormat)
  11941. return n.RGBA;
  11942. if (e === z.LuminanceFormat)
  11943. return n.LUMINANCE;
  11944. if (e === z.LuminanceAlphaFormat)
  11945. return n.LUMINANCE_ALPHA;
  11946. if (e === z.AddEquation)
  11947. return n.FUNC_ADD;
  11948. if (e === z.SubtractEquation)
  11949. return n.FUNC_SUBTRACT;
  11950. if (e === z.ReverseSubtractEquation)
  11951. return n.FUNC_REVERSE_SUBTRACT;
  11952. if (e === z.ZeroFactor)
  11953. return n.ZERO;
  11954. if (e === z.OneFactor)
  11955. return n.ONE;
  11956. if (e === z.SrcColorFactor)
  11957. return n.SRC_COLOR;
  11958. if (e === z.OneMinusSrcColorFactor)
  11959. return n.ONE_MINUS_SRC_COLOR;
  11960. if (e === z.SrcAlphaFactor)
  11961. return n.SRC_ALPHA;
  11962. if (e === z.OneMinusSrcAlphaFactor)
  11963. return n.ONE_MINUS_SRC_ALPHA;
  11964. if (e === z.DstAlphaFactor)
  11965. return n.DST_ALPHA;
  11966. if (e === z.OneMinusDstAlphaFactor)
  11967. return n.ONE_MINUS_DST_ALPHA;
  11968. if (e === z.DstColorFactor)
  11969. return n.DST_COLOR;
  11970. if (e === z.OneMinusDstColorFactor)
  11971. return n.ONE_MINUS_DST_COLOR;
  11972. if (e === z.SrcAlphaSaturateFactor)
  11973. return n.SRC_ALPHA_SATURATE;
  11974. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11975. if (e === z.RGB_S3TC_DXT1_Format)
  11976. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11977. if (e === z.RGBA_S3TC_DXT1_Format)
  11978. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11979. if (e === z.RGBA_S3TC_DXT3_Format)
  11980. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11981. if (e === z.RGBA_S3TC_DXT5_Format)
  11982. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11983. }
  11984. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11985. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11986. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11987. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11988. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11989. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11990. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11991. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11992. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11993. }
  11994. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11995. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11996. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11997. if (e === z.MinEquation)
  11998. return t.MIN_EXT;
  11999. if (e === z.MaxEquation)
  12000. return t.MAX_EXT
  12001. }
  12002. return 0
  12003. }
  12004. ,
  12005. z.WebGLState = function(l, i, c) {
  12006. var n = this
  12007. , r = new z.Vector4
  12008. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  12009. , o = new Uint8Array(e)
  12010. , a = new Uint8Array(e)
  12011. , s = new Uint8Array(e)
  12012. , t = {}
  12013. , h = null
  12014. , u = null
  12015. , d = null
  12016. , p = null
  12017. , f = null
  12018. , g = null
  12019. , m = null
  12020. , v = null
  12021. , y = !1
  12022. , A = null
  12023. , C = null
  12024. , I = null
  12025. , E = null
  12026. , _ = null
  12027. , b = null
  12028. , w = null
  12029. , T = null
  12030. , x = null
  12031. , S = null
  12032. , M = null
  12033. , R = null
  12034. , P = null
  12035. , O = null
  12036. , L = null
  12037. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  12038. , N = void 0
  12039. , F = {}
  12040. , B = new z.Vector4
  12041. , V = null
  12042. , k = null
  12043. , U = new z.Vector4
  12044. , H = new z.Vector4;
  12045. this.init = function() {
  12046. this.clearColor(0, 0, 0, 1),
  12047. this.clearDepth(1),
  12048. this.clearStencil(0),
  12049. this.enable(l.DEPTH_TEST),
  12050. l.depthFunc(l.LEQUAL),
  12051. l.frontFace(l.CCW),
  12052. l.cullFace(l.BACK),
  12053. this.enable(l.CULL_FACE),
  12054. this.enable(l.BLEND),
  12055. l.blendEquation(l.FUNC_ADD),
  12056. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  12057. }
  12058. ,
  12059. this.initAttributes = function() {
  12060. for (var e = 0, t = o.length; e < t; e++)
  12061. o[e] = 0
  12062. }
  12063. ,
  12064. this.enableAttribute = function(e) {
  12065. o[e] = 1,
  12066. 0 === a[e] && (l.enableVertexAttribArray(e),
  12067. a[e] = 1),
  12068. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  12069. s[e] = 0)
  12070. }
  12071. ,
  12072. this.enableAttributeAndDivisor = function(e, t, i) {
  12073. o[e] = 1,
  12074. 0 === a[e] && (l.enableVertexAttribArray(e),
  12075. a[e] = 1),
  12076. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  12077. s[e] = t)
  12078. }
  12079. ,
  12080. this.disableUnusedAttributes = function() {
  12081. for (var e = 0, t = a.length; e < t; e++)
  12082. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  12083. a[e] = 0)
  12084. }
  12085. ,
  12086. this.enable = function(e) {
  12087. !0 !== t[e] && (l.enable(e),
  12088. t[e] = !0)
  12089. }
  12090. ,
  12091. this.disable = function(e) {
  12092. !1 !== t[e] && (l.disable(e),
  12093. t[e] = !1)
  12094. }
  12095. ,
  12096. this.getCompressedTextureFormats = function() {
  12097. if (null === h && (h = [],
  12098. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  12099. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  12100. h.push(e[t]);
  12101. return h
  12102. }
  12103. ,
  12104. this.setBlending = function(e, t, i, n, r, o, a, s) {
  12105. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  12106. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12107. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  12108. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12109. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  12110. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12111. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  12112. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12113. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12114. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  12115. u = e,
  12116. y = s),
  12117. e === z.CustomBlending ? (r = r || t,
  12118. o = o || i,
  12119. a = a || n,
  12120. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  12121. d = t,
  12122. g = r),
  12123. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  12124. p = i,
  12125. f = n,
  12126. m = o,
  12127. v = a)) : v = m = g = f = p = d = null
  12128. }
  12129. ,
  12130. this.setDepthFunc = function(e) {
  12131. if (A !== e) {
  12132. if (e)
  12133. switch (e) {
  12134. case z.NeverDepth:
  12135. l.depthFunc(l.NEVER);
  12136. break;
  12137. case z.AlwaysDepth:
  12138. l.depthFunc(l.ALWAYS);
  12139. break;
  12140. case z.LessDepth:
  12141. l.depthFunc(l.LESS);
  12142. break;
  12143. case z.LessEqualDepth:
  12144. l.depthFunc(l.LEQUAL);
  12145. break;
  12146. case z.EqualDepth:
  12147. l.depthFunc(l.EQUAL);
  12148. break;
  12149. case z.GreaterEqualDepth:
  12150. l.depthFunc(l.GEQUAL);
  12151. break;
  12152. case z.GreaterDepth:
  12153. l.depthFunc(l.GREATER);
  12154. break;
  12155. case z.NotEqualDepth:
  12156. l.depthFunc(l.NOTEQUAL);
  12157. break;
  12158. default:
  12159. l.depthFunc(l.LEQUAL)
  12160. }
  12161. else
  12162. l.depthFunc(l.LEQUAL);
  12163. A = e
  12164. }
  12165. }
  12166. ,
  12167. this.setDepthTest = function(e) {
  12168. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  12169. }
  12170. ,
  12171. this.setDepthWrite = function(e) {
  12172. C !== e && (l.depthMask(e),
  12173. C = e)
  12174. }
  12175. ,
  12176. this.setColorWrite = function(e) {
  12177. I !== e && (l.colorMask(e, e, e, e),
  12178. I = e)
  12179. }
  12180. ,
  12181. this.setStencilFunc = function(e, t, i) {
  12182. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  12183. _ = e,
  12184. b = t,
  12185. w = i)
  12186. }
  12187. ,
  12188. this.setStencilOp = function(e, t, i) {
  12189. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  12190. T = e,
  12191. x = t,
  12192. S = i)
  12193. }
  12194. ,
  12195. this.setStencilTest = function(e) {
  12196. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  12197. }
  12198. ,
  12199. this.setStencilWrite = function(e) {
  12200. E !== e && (l.stencilMask(e),
  12201. E = e)
  12202. }
  12203. ,
  12204. this.setFlipSided = function(e) {
  12205. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  12206. M = e)
  12207. }
  12208. ,
  12209. this.setLineWidth = function(e) {
  12210. e !== R && (l.lineWidth(e),
  12211. R = e)
  12212. }
  12213. ,
  12214. this.setPolygonOffset = function(e, t, i) {
  12215. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  12216. !e || P === t && O === i || (l.polygonOffset(t, i),
  12217. P = t,
  12218. O = i)
  12219. }
  12220. ,
  12221. this.getScissorTest = function() {
  12222. return L
  12223. }
  12224. ,
  12225. this.setScissorTest = function(e) {
  12226. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  12227. }
  12228. ,
  12229. this.activeTexture = function(e) {
  12230. void 0 === e && (e = l.TEXTURE0 + D - 1),
  12231. N !== e && (l.activeTexture(e),
  12232. N = e)
  12233. }
  12234. ,
  12235. this.bindTexture = function(e, t) {
  12236. void 0 === N && n.activeTexture();
  12237. var i = F[N];
  12238. void 0 === i && (i = {
  12239. type: void 0,
  12240. texture: void 0
  12241. },
  12242. F[N] = i),
  12243. i.type === e && i.texture === t || (l.bindTexture(e, t),
  12244. i.type = e,
  12245. i.texture = t)
  12246. }
  12247. ,
  12248. this.compressedTexImage2D = function() {
  12249. try {
  12250. l.compressedTexImage2D.apply(l, arguments)
  12251. } catch (e) {
  12252. console.error(e)
  12253. }
  12254. }
  12255. ,
  12256. this.texImage2D = function() {
  12257. try {
  12258. l.texImage2D.apply(l, arguments)
  12259. } catch (e) {
  12260. console.error(e)
  12261. }
  12262. }
  12263. ,
  12264. this.clearColor = function(e, t, i, n) {
  12265. r.set(e, t, i, n),
  12266. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  12267. B.copy(r))
  12268. }
  12269. ,
  12270. this.clearDepth = function(e) {
  12271. V !== e && (l.clearDepth(e),
  12272. V = e)
  12273. }
  12274. ,
  12275. this.clearStencil = function(e) {
  12276. k !== e && (l.clearStencil(e),
  12277. k = e)
  12278. }
  12279. ,
  12280. this.scissor = function(e) {
  12281. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  12282. U.copy(e))
  12283. }
  12284. ,
  12285. this.viewport = function(e) {
  12286. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  12287. H.copy(e))
  12288. }
  12289. ,
  12290. this.reset = function() {
  12291. for (var e = 0; e < a.length; e++)
  12292. 1 === a[e] && (l.disableVertexAttribArray(e),
  12293. a[e] = 0);
  12294. t = {},
  12295. N = void 0,
  12296. F = {},
  12297. M = E = C = I = u = h = null
  12298. }
  12299. }
  12300. }
  12301. , {
  12302. three: 217
  12303. }],
  12304. 104: [function(a, h, e) {
  12305. (function(i, e) {
  12306. "use strict";
  12307. function t(e) {
  12308. this.urls = e;
  12309. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12310. this.builder = n.loadProto(t),
  12311. this.decoder = this.builder.build("binary_mesh")
  12312. }
  12313. var s = a("three")
  12314. , n = a("protobufjs")
  12315. , r = a("../util/logger")
  12316. , o = (a("../util/common"),
  12317. a("../util/ajax"))
  12318. , l = a("../objects/Chunk")
  12319. , c = new r(e);
  12320. t.prototype = {
  12321. constructor: t,
  12322. load: function(t, i, n, r) {
  12323. return c.time("download"),
  12324. o.get(t, {
  12325. responseType: "arraybuffer"
  12326. }).done(function(e) {
  12327. c.timeEnd("download"),
  12328. this.parse(e, t, i, n, r)
  12329. }
  12330. .bind(this)).fail(r)
  12331. },
  12332. parse: function(e, t, i, n, r) {
  12333. var o = this.readProtobuf(e);
  12334. if (!o)
  12335. return r();
  12336. try {
  12337. c.time("convert to webgl"),
  12338. this.convertProtobufToSceneObject(o, t, i, n, r),
  12339. c.timeEnd("convert to webgl")
  12340. } catch (e) {
  12341. return c.error("failed parsing .dam"),
  12342. c.error(e.message),
  12343. r()
  12344. }
  12345. },
  12346. readProtobuf: function(e) {
  12347. var t;
  12348. try {
  12349. c.time("parse proto"),
  12350. t = this.decoder.decode(e),
  12351. c.timeEnd("parse proto")
  12352. } catch (e) {
  12353. return c.error("failed parsing proto for .dam"),
  12354. c.error(e.message),
  12355. null
  12356. }
  12357. return t
  12358. },
  12359. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12360. if (0 === e.chunk.length)
  12361. return c.warn("No chunks in damfile..."),
  12362. t([]);
  12363. var o = new s.Matrix4;
  12364. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12365. var a = e.chunk.map(function(e) {
  12366. var t = new s.BufferGeometry;
  12367. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12368. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12369. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12370. t.applyMatrix(o),
  12371. t.computeBoundingBox(),
  12372. new l({
  12373. geometry: t,
  12374. textureName: e.material_name,
  12375. name: e.chunk_name,
  12376. meshUrl: i
  12377. })
  12378. });
  12379. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12380. r())
  12381. }
  12382. },
  12383. h.exports = t
  12384. }
  12385. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12386. }
  12387. , {
  12388. "../objects/Chunk": 144,
  12389. "../util/ajax": 181,
  12390. "../util/common": 185,
  12391. "../util/logger": 189,
  12392. buffer: 198,
  12393. protobufjs: 214,
  12394. three: 217
  12395. }],
  12396. 105: [function(n, r, e) {
  12397. (function(e) {
  12398. "use strict";
  12399. var t = (n("three"),
  12400. n("../settings"),
  12401. n("../util/browser"),
  12402. n("./DamLoader"))
  12403. , i = n("../util/logger")
  12404. , u = (n("../ab"),
  12405. new i(e));
  12406. r.exports = {
  12407. getLoaders: function() {
  12408. return [["_50k", ".dam", t], ["", ".dam", t]]
  12409. },
  12410. load: function(e, t, i, n, r, o) {
  12411. var a = this.getLoaders()[o = o || 0];
  12412. if (a) {
  12413. var s = a[0]
  12414. , l = a[1]
  12415. , c = new a[2](t)
  12416. , h = t.get(e + s + l);
  12417. h ? (u.debug("Trying " + s + l),
  12418. c.load(h, i, n, function() {
  12419. this.load(e, t, i, n, r, ++o)
  12420. }
  12421. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12422. this.load(e, t, i, n, r, ++o))
  12423. } else
  12424. r && r("No suitable model file found...")
  12425. }
  12426. }
  12427. }
  12428. ).call(this, "/js/loaders/ModelLoader.js")
  12429. }
  12430. , {
  12431. "../ab": 3,
  12432. "../settings": 166,
  12433. "../util/browser": 182,
  12434. "../util/logger": 189,
  12435. "./DamLoader": 104,
  12436. three: 217
  12437. }],
  12438. 106: [function(i, n, e) {
  12439. (function(e) {
  12440. "use strict";
  12441. var l = i("../util/common")
  12442. , c = i("../util/texture")
  12443. , h = i("../util/browser")
  12444. , t = i("../util/logger")
  12445. , u = i("../settings")
  12446. , d = new t(e);
  12447. n.exports = {
  12448. load: function(i, n) {
  12449. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12450. return $.when();
  12451. var r = l.countUnique(i.chunks.map(function(e) {
  12452. return e.textureName
  12453. }))
  12454. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12455. , t = "_50k" == e ? "high" : "low";
  12456. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12457. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12458. t = "low"));
  12459. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12460. , a = $.Deferred()
  12461. , s = 0;
  12462. return i.chunks.forEach(function(e) {
  12463. if (!e.material.map && e.textureName) {
  12464. var t = i.urls.get(o + e.textureName);
  12465. e.setTextureMap(c.load(t, function(e, t) {
  12466. e || (n.push(t),
  12467. s++,
  12468. a.notify(s, r),
  12469. s === r && a.resolve())
  12470. }
  12471. .bind(this, c.isLoaded(t))))
  12472. }
  12473. }),
  12474. a.promise()
  12475. }
  12476. }
  12477. }
  12478. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12479. }
  12480. , {
  12481. "../settings": 166,
  12482. "../util/browser": 182,
  12483. "../util/common": 185,
  12484. "../util/logger": 189,
  12485. "../util/texture": 194
  12486. }],
  12487. 107: [function(s, l, e) {
  12488. (function(n, e) {
  12489. "use strict";
  12490. function t(e) {
  12491. this.model = e,
  12492. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12493. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12494. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12495. , i = r.loadProto(t);
  12496. this.decoder = i.build("VisionModeldata")
  12497. }
  12498. var r = s("protobufjs")
  12499. , i = s("../util/ajax")
  12500. , o = (s("../util/common"),
  12501. s("../util/math"))
  12502. , a = new (s("../util/logger"))(e);
  12503. t.prototype.load = function() {
  12504. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12505. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12506. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12507. $.when([]))
  12508. }
  12509. ,
  12510. t.prototype.loadVisionModelData = function() {
  12511. return i.get(this.modelDataPath, {
  12512. responseType: "arraybuffer"
  12513. }).then(function(e) {
  12514. var t;
  12515. try {
  12516. t = this.decoder.decode(e)
  12517. } catch (e) {
  12518. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12519. this.loadSweepLocationsCSV()
  12520. }
  12521. var i = t.sweepLocations.map(function(e) {
  12522. return {
  12523. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12524. position: {
  12525. x: e.pose.translation.x,
  12526. y: e.pose.translation.y,
  12527. z: e.pose.translation.z
  12528. },
  12529. quaternion: {
  12530. x: e.pose.rotation.x,
  12531. y: e.pose.rotation.y,
  12532. z: e.pose.rotation.z,
  12533. w: e.pose.rotation.w
  12534. },
  12535. puck: {
  12536. x: e.puck.x,
  12537. y: e.puck.y,
  12538. z: e.puck.z
  12539. },
  12540. floor: e.group,
  12541. neighbours: e.visibles,
  12542. alignmentType: e.alignment_type
  12543. }
  12544. }).map(function(e) {
  12545. return e.position = o.convertVisionVector(e.position),
  12546. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12547. e.puck = o.convertVisionVector(e.puck),
  12548. e
  12549. });
  12550. return i.forEach(function(e) {
  12551. e.neighbours = e.neighbours.map(function(e) {
  12552. return i[e].uuid
  12553. })
  12554. }),
  12555. i
  12556. }
  12557. .bind(this), function() {
  12558. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12559. this.loadSweepLocationsCSV()
  12560. }
  12561. .bind(this))
  12562. }
  12563. ,
  12564. t.prototype.loadSweepLocationsCSV = function() {
  12565. return i.get(this.sweepLocationsPath).then(function(e) {
  12566. return e.split("\n").map(function(e) {
  12567. return e.split(", ")
  12568. }).filter(function(e) {
  12569. return 1 < e.length
  12570. }).map(function(e) {
  12571. return {
  12572. uuid: e[0],
  12573. position: {
  12574. x: parseFloat(e[1]),
  12575. y: parseFloat(e[2]),
  12576. z: parseFloat(e[3])
  12577. },
  12578. quaternion: {
  12579. x: parseFloat(e[4]),
  12580. y: parseFloat(e[5]),
  12581. z: parseFloat(e[6]),
  12582. w: parseFloat(e[7])
  12583. }
  12584. }
  12585. }).map(function(e) {
  12586. return e.position = o.convertVisionVector(e.position),
  12587. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12588. e
  12589. })
  12590. }).fail(function() {
  12591. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12592. })
  12593. }
  12594. ,
  12595. l.exports = t
  12596. }
  12597. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12598. }
  12599. , {
  12600. "../util/ajax": 181,
  12601. "../util/common": 185,
  12602. "../util/logger": 189,
  12603. "../util/math": 190,
  12604. buffer: 198,
  12605. protobufjs: 214
  12606. }],
  12607. 108: [function(s, l, e) {
  12608. (function(e) {
  12609. "use strict";
  12610. function t() {
  12611. this.locale = null
  12612. }
  12613. var i = s("../settings")
  12614. , n = s("../util/common")
  12615. , r = s("../util/logger")
  12616. , o = s("../enum/Locale")
  12617. , a = new r(e);
  12618. t.prototype.init = function() {
  12619. var e;
  12620. switch (i.languageTag) {
  12621. case null:
  12622. case "en":
  12623. case o.EN_US:
  12624. this.locale = o.EN_US,
  12625. e = s("./strings-en-US");
  12626. break;
  12627. case "es":
  12628. case o.ES_MX:
  12629. this.locale = o.ES_MX,
  12630. e = s("./strings-es-MX");
  12631. break;
  12632. case "fr":
  12633. case o.FR_FR:
  12634. this.locale = o.FR_FR,
  12635. e = s("./strings-fr-FR");
  12636. break;
  12637. case "de":
  12638. case o.DE_DE:
  12639. this.locale = o.DE_DE,
  12640. e = s("./strings-de-DE");
  12641. break;
  12642. case "ru":
  12643. case o.RU_RU:
  12644. this.locale = o.RU_RU,
  12645. e = s("./strings-ru-RU");
  12646. break;
  12647. case "cn":
  12648. case o.CN_CN:
  12649. this.locale = o.CN_CN,
  12650. e = s("./strings-cn-CN");
  12651. break;
  12652. case "jp":
  12653. case o.JP_JP:
  12654. this.locale = o.JP_JP,
  12655. e = s("./strings-jp-JP");
  12656. break;
  12657. default:
  12658. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12659. this.locale = o.EN_US,
  12660. e = s("./strings-en-US")
  12661. }
  12662. a.info("Using locale '" + this.locale + "'"),
  12663. n.extendObject(this, e)
  12664. }
  12665. ,
  12666. t.prototype.localizeGUI = function() {
  12667. var e = document.querySelector("#gui-parent");
  12668. this.localizeTree(e),
  12669. this.localizeLoadingText()
  12670. }
  12671. ,
  12672. t.prototype.localizeLoadingText = function() {
  12673. document.querySelector("#help-dialog").classList.add(this.locale),
  12674. document.querySelector("#interaction-modal").classList.add(this.locale),
  12675. document.querySelector("#gui").classList.add(this.locale)
  12676. }
  12677. ,
  12678. t.prototype.localizeTree = function(e) {
  12679. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12680. if (e.nodeType === Node.TEXT_NODE)
  12681. (t = e.data.match(n)) && (i = t[1],
  12682. e.data = this.localizeText(i) || i);
  12683. else if (e.nodeType === Node.ELEMENT_NODE) {
  12684. var r = e.getAttribute("title");
  12685. r && ((t = r.match(n)) && (i = t[1],
  12686. e.setAttribute("title", this.localizeText(i) || i)))
  12687. }
  12688. for (e = e.firstChild; e; )
  12689. this.localizeTree(e),
  12690. e = e.nextSibling
  12691. }
  12692. ,
  12693. t.prototype.localizeText = function(e) {
  12694. var t = this[e];
  12695. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12696. t = s("./strings-en-US")[e]),
  12697. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12698. t
  12699. }
  12700. ,
  12701. l.exports = new t
  12702. }
  12703. ).call(this, "/js/localization/localize.js")
  12704. }
  12705. , {
  12706. "../enum/Locale": 31,
  12707. "../settings": 166,
  12708. "../util/common": 185,
  12709. "../util/logger": 189,
  12710. "./strings-cn-CN": 109,
  12711. "./strings-de-DE": 110,
  12712. "./strings-en-US": 111,
  12713. "./strings-es-MX": 112,
  12714. "./strings-fr-FR": 113,
  12715. "./strings-jp-JP": 114,
  12716. "./strings-ru-RU": 115
  12717. }],
  12718. 109: [function(e, t, i) {
  12719. "use strict";
  12720. t.exports = {
  12721. PAGE_TITLE: "",
  12722. LOADING: "正在加载",
  12723. PRESENTED_BY_CAPS: "呈现者:",
  12724. POWERED_BY: "技术支持:",
  12725. POWERED_BY_CAPS: "技术支持:",
  12726. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12727. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12728. PRESENTED_BY: "呈现者:",
  12729. MORE: "更多 ",
  12730. LESS: "更少 ",
  12731. TAG_CONTENT: "tag™ 内容",
  12732. SHOW: "显示",
  12733. HIDE: "隐藏",
  12734. DOLLHOUSE: "场景屋",
  12735. FLOOR_PLAN: "楼层平面图",
  12736. OPEN_HIGHLIGHTS: "打开精彩片段",
  12737. CLOSE_HIGHLIGHTS: "关闭",
  12738. PREVIOUS: "上一个",
  12739. PLAY: "播放",
  12740. PAUSE: "暂停",
  12741. NEXT: "下一个",
  12742. EXPLORE_3D_SPACE: "探索 3D 空间",
  12743. VIEW_DOLLHOUSE: "观看场景屋",
  12744. SOCIAL_SHARING: "分享这个空间",
  12745. VIEW_IN_VR: "以 VR 观看",
  12746. VIEW_FULLSCREEN: "全屏观看",
  12747. EXIT_FULLSCREEN: " 退出全屏",
  12748. ZOOM_IN: "放大",
  12749. ZOOM_OUT: "缩小",
  12750. FLOOR_NAME: "楼层",
  12751. FLOOR_ALL: "ALL",
  12752. FLOOR_Lang: ["Floor", ""],
  12753. TERMS: "条款",
  12754. PORT_TERMS: "port 条款",
  12755. TERMS_OF_USE: "使用条款",
  12756. CLOSE_TERMS: "关闭",
  12757. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12758. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12759. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12760. WEBVR_ENTER_WEBVR: "进入 VR",
  12761. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12762. WEBVR_LEARN_MORE: "了解更多",
  12763. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12764. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12765. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12766. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12767. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12768. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12769. VR_LEARN_MORE_CAPS: "了解更多",
  12770. VR_PREVIOUS_CAPS: "上一个’,",
  12771. VR_NEXT_CAPS: "下一个",
  12772. VR_GOT_IT_CAPS: "明白了",
  12773. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12774. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12775. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12776. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12777. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12778. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12779. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12780. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12781. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12782. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12783. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12784. VR_APP: "port VR 应用程序",
  12785. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12786. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12787. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12788. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12789. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12790. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12791. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12792. VR_ANDROID_DVICES: "Android 设备",
  12793. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12794. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12795. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12796. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12797. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12798. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12799. VR_DOWNLOAD_HERE: "在此下载",
  12800. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12801. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12802. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12803. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12804. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12805. SHARE_TO: "分享到",
  12806. SHARE_LINK: "直接链接",
  12807. SHARE_EXPLORE: "探索",
  12808. SHARE_AT: "在",
  12809. SHARE_WITH: "使用",
  12810. SHARE_3D: "以 3D",
  12811. SHARE_COPIED: "已复制!",
  12812. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12813. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12814. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12815. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12816. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12817. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12818. ERROR_GENERIC_ACTIONS_3: " 或",
  12819. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12820. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12821. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12822. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12823. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12824. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12825. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12826. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12827. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12828. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12829. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12830. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12831. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12832. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12833. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12834. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12835. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12836. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12837. LINK_TO_LOCATION: "地点链接",
  12838. MENU_COPY: "复制",
  12839. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12840. ROTATE: "旋转",
  12841. MOVE: "移动",
  12842. INSIDE: "内部",
  12843. ZOOM: "缩放",
  12844. HELP: "小帮手",
  12845. HELP_NAVIGATION_TAB: "导航",
  12846. HELP_MORE_HELP_TAB: "更多帮助",
  12847. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12848. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12849. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12850. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12851. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12852. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12853. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12854. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12855. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12856. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12857. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12858. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12859. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12860. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12861. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12862. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12863. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12864. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12865. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12866. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12867. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12868. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12869. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12870. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12871. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12872. HELP_MORE_HLR_A: "精彩片段集锦",
  12873. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12874. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12875. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12876. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12877. HELP_MORE_FLOORS_A: "楼层选择器",
  12878. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12879. HELP_MORE_TAG_A: "tag™ 贴文",
  12880. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12881. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12882. HELP_MORE_ZOOM_A: "缩放控件",
  12883. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12884. HELP_MORE_TOUR_A: "导览控件",
  12885. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12886. HELP_MORE_INSIDE_A: "内部视图",
  12887. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12888. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12889. HELP_MORE_VR_A: "VR 模式",
  12890. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12891. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12892. HELP_MORE_360_A: "360° 视图",
  12893. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12894. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12895. HELP_MORE_FULLSCREEN_A: "全屏",
  12896. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12897. CLOSE: "关闭"
  12898. }
  12899. }
  12900. , {}],
  12901. 110: [function(e, t, i) {
  12902. "use strict";
  12903. t.exports = {
  12904. PAGE_TITLE: "",
  12905. LOADING: "Lädt",
  12906. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12907. POWERED_BY: "Angetrieben von",
  12908. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12909. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12910. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12911. PRESENTED_BY: "Präsentiert von ",
  12912. MORE: "Mehr ",
  12913. LESS: "Weniger ",
  12914. TAG_CONTENT: "tag™ Inhalt",
  12915. SHOW: "Anzeigen",
  12916. HIDE: "Verbergen",
  12917. DOLLHOUSE: "Puppenhaus",
  12918. FLOOR_PLAN: "Grundriss",
  12919. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12920. CLOSE_HIGHLIGHTS: "Schließen",
  12921. PREVIOUS: "Vorheriges",
  12922. PLAY: "Abspielen",
  12923. PAUSE: "Pausieren",
  12924. NEXT: "Nächstes",
  12925. EXPLORE_3D_SPACE: "Innenraum betreten",
  12926. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12927. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12928. VIEW_IN_VR: "In VR ansehen",
  12929. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12930. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12931. ZOOM_IN: "Vergrößern",
  12932. ZOOM_OUT: "Verkleinern",
  12933. FLOOR_NAME: "Etage ",
  12934. FLOOR_ALL: "Alle",
  12935. TERMS: "Bedingungen",
  12936. PORT_TERMS: "port Bedingungen",
  12937. TERMS_OF_USE: "Nutzungsbedingungen",
  12938. TERMS_TEXT_FILE: "terms-de-DE.html",
  12939. CLOSE_TERMS: "Schließen",
  12940. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12941. HELP: "Hilfe",
  12942. HELP_NAVIGATION_TAB: "Navigation",
  12943. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12944. CLOSE: "Schließen",
  12945. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12946. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12947. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12948. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12949. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12950. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12951. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12952. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12953. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12954. 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.",
  12955. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12956. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12957. 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.",
  12958. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12959. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12960. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12961. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12962. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12963. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12964. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12965. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12966. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12967. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12968. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12969. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12970. HELP_MORE_HLR_A: "Liste das Highlight",
  12971. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12972. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12973. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12974. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12975. HELP_MORE_FLOORS_A: "Etage auswählen",
  12976. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12977. HELP_MORE_TAG_A: "tag™ Posts",
  12978. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12979. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12980. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12981. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12982. HELP_MORE_TOUR_A: "Tour Steuerung",
  12983. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12984. HELP_MORE_INSIDE_A: "Innenansicht",
  12985. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12986. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12987. HELP_MORE_VR_A: "VR Modus",
  12988. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12989. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12990. HELP_MORE_360_A: "360° Views Ansicht ",
  12991. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12992. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12993. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12994. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12995. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12996. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12997. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12998. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12999. WEBVR_LEARN_MORE: "Mehr Infos",
  13000. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13001. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13002. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13003. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13004. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13005. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13006. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13007. VR_APP: "port VR App",
  13008. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13009. 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",
  13010. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13011. VR_APP_FOR_ANDROID: "port VR app für Android",
  13012. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13013. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13014. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13015. VR_PREVIOUS_CAPS: "ZURÜCK",
  13016. VR_NEXT_CAPS: "WEITER",
  13017. VR_GOT_IT_CAPS: "VERSTANDEN",
  13018. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13019. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13020. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13021. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13022. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13023. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13024. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13025. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13026. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13027. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13028. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13029. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13030. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13031. VR_ANDROID_DVICES: "Android Geräte",
  13032. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13033. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13034. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13035. VR_DOWNLOAD_HERE: "Hier runterladen",
  13036. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13037. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13038. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13039. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13040. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13041. SHARE_TO: "Teilen auf",
  13042. SHARE_LINK: "Direkter Link",
  13043. SHARE_EXPLORE: "Umsehen",
  13044. SHARE_AT: "auf",
  13045. SHARE_WITH: "mit",
  13046. SHARE_3D: "in 3D",
  13047. SHARE_COPIED: "Kopiert!",
  13048. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13049. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13050. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13051. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13052. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13053. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13054. ERROR_GENERIC_ACTIONS_3: " oder ",
  13055. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13056. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13057. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13058. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13059. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13060. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13061. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13062. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13063. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13064. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13065. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13066. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13067. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13068. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13069. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13070. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13071. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13072. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13073. LINK_TO_LOCATION: "Link zu",
  13074. MENU_COPY: "Kopieren",
  13075. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13076. ROTATE: "Drehen",
  13077. INSIDE: "Drinnen",
  13078. MOVE: "Bewegen",
  13079. ZOOM: "Vergrößern"
  13080. }
  13081. }
  13082. , {}],
  13083. 111: [function(e, t, i) {
  13084. "use strict";
  13085. t.exports = {
  13086. PAGE_TITLE: "",
  13087. LOADING: "Loading",
  13088. PRESENTED_BY_CAPS: "PRESENTED BY",
  13089. POWERED_BY: "powered by ",
  13090. POWERED_BY_CAPS: "POWERED BY",
  13091. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13092. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13093. PRESENTED_BY: "Presented by ",
  13094. MORE: "More ",
  13095. LESS: "Less ",
  13096. TAG_CONTENT: "tag™ Content",
  13097. SHOW: "Show",
  13098. HIDE: "Hide",
  13099. DOLLHOUSE: "Dollhouse",
  13100. FLOOR_PLAN: "Floor plan",
  13101. OPEN_HIGHLIGHTS: "Open Highlights",
  13102. CLOSE_HIGHLIGHTS: "Close",
  13103. PREVIOUS: "Previous",
  13104. PLAY: "Play",
  13105. PAUSE: "Pause",
  13106. NEXT: "Next",
  13107. EXPLORE_3D_SPACE: "Explore 3D Space",
  13108. VIEW_DOLLHOUSE: "View dollhouse",
  13109. SOCIAL_SHARING: "Share this Space",
  13110. VIEW_IN_VR: "View in VR",
  13111. VIEW_FULLSCREEN: "全屏",
  13112. EXIT_FULLSCREEN: "退出全屏",
  13113. ZOOM_IN: "Zoom in",
  13114. ZOOM_OUT: "Zoom out",
  13115. FLOOR_NAME: "Floor ",
  13116. FLOOR_ALL: "全部",
  13117. TERMS: "Terms",
  13118. PORT_TERMS: "port terms",
  13119. TERMS_OF_USE: "Terms of Use",
  13120. TERMS_TEXT_FILE: "terms-en-US.html",
  13121. CLOSE_TERMS: "Close",
  13122. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13123. HELP: "Help",
  13124. HELP_NAVIGATION_TAB: "Navigation",
  13125. HELP_MORE_HELP_TAB: "More Help",
  13126. CLOSE: "Close",
  13127. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13128. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13129. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13130. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13131. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13132. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13133. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13134. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13135. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13136. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13137. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13138. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13139. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13140. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13141. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13142. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13143. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13144. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13145. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13146. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13147. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13148. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13149. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13150. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13151. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13152. HELP_MORE_HLR_A: "Highlight Reel",
  13153. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13154. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13155. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13156. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13157. HELP_MORE_FLOORS_A: "Floor Selector",
  13158. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13159. HELP_MORE_TAG_A: "tag™ Posts",
  13160. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13161. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13162. HELP_MORE_ZOOM_A: "Zoom Controls",
  13163. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13164. HELP_MORE_TOUR_A: "Tour Controls",
  13165. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13166. HELP_MORE_INSIDE_A: "Inside View",
  13167. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13168. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13169. HELP_MORE_VR_A: "VR Mode",
  13170. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13171. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13172. HELP_MORE_360_A: "360° Views",
  13173. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13174. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13175. HELP_MORE_FULLSCREEN_A: "Full screen",
  13176. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13177. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13178. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13179. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13180. WEBVR_ENTER_WEBVR: "ENTER VR",
  13181. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13182. WEBVR_LEARN_MORE: "Learn more",
  13183. WEBVR_VIEW_SPACE: "View Space in VR",
  13184. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13185. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13186. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13187. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13188. VR_PREVIOUS_CAPS: "PREVIOUS",
  13189. VR_NEXT_CAPS: "NEXT",
  13190. VR_GOT_IT_CAPS: "GOT IT",
  13191. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13192. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13193. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13194. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13195. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13196. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13197. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13198. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13199. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13200. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13201. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13202. VR_APP: "port VR App",
  13203. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13204. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13205. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13206. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13207. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13208. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13209. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13210. VR_ANDROID_DVICES: "Android Devices",
  13211. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13212. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13213. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13214. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13215. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13216. VR_APP_OPEN: "Open with the port VR app instead",
  13217. VR_DOWNLOAD_HERE: "Download here",
  13218. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13219. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13220. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13221. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13222. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13223. SHARE_TO: "Share to",
  13224. SHARE_LINK: "Direct Link",
  13225. SHARE_EXPLORE: "Explore ",
  13226. SHARE_AT: "at",
  13227. SHARE_WITH: "with",
  13228. SHARE_3D: " in 3D",
  13229. SHARE_COPIED: "Copied!",
  13230. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13231. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13232. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13233. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13234. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13235. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13236. ERROR_GENERIC_ACTIONS_3: " or ",
  13237. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13238. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13239. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13240. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13241. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13242. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13243. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13244. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13245. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13246. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13247. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13248. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13249. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13250. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13251. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13252. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13253. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13254. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13255. LINK_TO_LOCATION: "Link to location",
  13256. MENU_COPY: "Copy",
  13257. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13258. ROTATE: "Rotate",
  13259. INSIDE: "Inside",
  13260. MOVE: "Move",
  13261. ZOOM: "Zoom"
  13262. }
  13263. }
  13264. , {}],
  13265. 112: [function(e, t, i) {
  13266. "use strict";
  13267. t.exports = {
  13268. PAGE_TITLE: "",
  13269. LOADING: "Cargando",
  13270. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13271. POWERED_BY: "potenciando por ",
  13272. POWERED_BY_CAPS: "POTENCIADO POR ",
  13273. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13274. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13275. PRESENTED_BY: "Presentado por ",
  13276. MORE: "Más ",
  13277. LESS: "Menos ",
  13278. TAG_CONTENT: "Contenido de tag™",
  13279. SHOW: "Mostrar",
  13280. HIDE: "Ocultar",
  13281. DOLLHOUSE: "Dollhouse",
  13282. FLOOR_PLAN: "Planos",
  13283. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13284. CLOSE_HIGHLIGHTS: "Cerrar",
  13285. PREVIOUS: "Anterior",
  13286. PLAY: "Play",
  13287. PAUSE: "Pausa",
  13288. NEXT: "Siguiente",
  13289. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13290. VIEW_DOLLHOUSE: "Ver dollhouse",
  13291. SOCIAL_SHARING: "Compartir este espacio",
  13292. VIEW_IN_VR: "Ver en realidad virtual",
  13293. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13294. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13295. ZOOM_IN: "Acercar",
  13296. ZOOM_OUT: "Alejar",
  13297. FLOOR_NAME: "Piso ",
  13298. FLOOR_ALL: "Todas",
  13299. TERMS: "Condiciones",
  13300. PORT_TERMS: "port términos de uso",
  13301. TERMS_OF_USE: "Términos de uso",
  13302. TERMS_TEXT_FILE: "terms-es-MX.html",
  13303. CLOSE_TERMS: "Cerrar",
  13304. 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.",
  13305. HELP: "Ayuda",
  13306. HELP_NAVIGATION_TAB: "Navegación",
  13307. HELP_MORE_HELP_TAB: "Más Ayuda",
  13308. CLOSE: "Cerrar",
  13309. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13310. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13311. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13312. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13313. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13314. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13315. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13316. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13317. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13318. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13319. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13320. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13321. 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.",
  13322. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13323. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13324. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13325. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13326. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13327. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13328. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13329. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13330. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13331. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13332. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13333. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13334. HELP_MORE_HLR_A: "Galería destacada",
  13335. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13336. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13337. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13338. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13339. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13340. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13341. HELP_MORE_TAG_A: "tag™ Posts",
  13342. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13343. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13344. HELP_MORE_ZOOM_A: "Controles de zoom",
  13345. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13346. HELP_MORE_TOUR_A: "Controles de recorrido",
  13347. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13348. HELP_MORE_INSIDE_A: "Vista interior",
  13349. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13350. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13351. HELP_MORE_VR_A: "Modo de realidad virtual",
  13352. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13353. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13354. HELP_MORE_360_A: "360° Views",
  13355. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13356. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13357. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13358. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13359. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13360. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13361. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13362. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13363. WEBVR_LEARN_MORE: "Más información",
  13364. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13365. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13366. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13367. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13368. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13369. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13370. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13371. VR_APP: "port VR App",
  13372. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13373. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13374. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13375. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13376. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13377. VR_PREVIOUS_CAPS: "ANTERIOR",
  13378. VR_NEXT_CAPS: "SIGUIENTE",
  13379. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13380. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13381. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13382. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13383. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13384. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13385. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13386. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13387. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13388. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13389. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13390. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13391. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13392. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13393. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13394. VR_ANDROID_DVICES: "Dispositivos Android",
  13395. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13396. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13397. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13398. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13399. VR_DOWNLOAD_HERE: "Descargar aquí",
  13400. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13401. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13402. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13403. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13404. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13405. SHARE_TO: "Compartir en",
  13406. SHARE_LINK: "Enlace directo",
  13407. SHARE_EXPLORE: "Explorar ",
  13408. SHARE_AT: "en",
  13409. SHARE_WITH: "con",
  13410. SHARE_3D: " en 3D",
  13411. SHARE_COPIED: "¡Copiado!",
  13412. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13413. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13414. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13415. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13416. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13417. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13418. ERROR_GENERIC_ACTIONS_3: " o ",
  13419. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13420. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13421. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13422. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13423. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13424. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13425. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13426. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13427. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13428. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13429. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13430. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13431. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13432. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13433. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13434. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13435. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13436. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13437. LINK_TO_LOCATION: "Enlace a la ubicación",
  13438. MENU_COPY: "Copiar",
  13439. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13440. ROTATE: "Girar",
  13441. INSIDE: "Interior",
  13442. MOVE: "Moverse",
  13443. ZOOM: "Acercar o alejar"
  13444. }
  13445. }
  13446. , {}],
  13447. 113: [function(e, t, i) {
  13448. "use strict";
  13449. t.exports = {
  13450. PAGE_TITLE: "",
  13451. LOADING: "Chargement",
  13452. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13453. POWERED_BY: "alimenté par ",
  13454. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13455. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13456. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13457. PRESENTED_BY: "Présenté par ",
  13458. MORE: "Plus ",
  13459. LESS: "Moins ",
  13460. TAG_CONTENT: "Contenu tag™",
  13461. SHOW: "Montrer",
  13462. HIDE: "Cacher",
  13463. DOLLHOUSE: "Dollhouse",
  13464. FLOOR_PLAN: "Plan de sol",
  13465. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13466. CLOSE_HIGHLIGHTS: "Fermer",
  13467. PREVIOUS: "Précédent",
  13468. PLAY: "Lecture",
  13469. PAUSE: "Pause",
  13470. NEXT: "Suivant",
  13471. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13472. VIEW_DOLLHOUSE: "Voir dollhouse",
  13473. SOCIAL_SHARING: "Partager cet espace",
  13474. VIEW_IN_VR: "Voir en VR",
  13475. VIEW_FULLSCREEN: "Plein écran",
  13476. EXIT_FULLSCREEN: "Fermer plein écran",
  13477. ZOOM_IN: "Zoom avant",
  13478. ZOOM_OUT: "Zoom arrière",
  13479. FLOOR_NAME: "Étage ",
  13480. FLOOR_ALL: "Tous",
  13481. TERMS: "Mentions légales",
  13482. PORT_TERMS: "port mentions légales",
  13483. TERMS_OF_USE: "Conditions d'utilisation",
  13484. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13485. CLOSE_TERMS: "Fermer",
  13486. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13487. HELP: "Aide",
  13488. HELP_NAVIGATION_TAB: "Navigation",
  13489. HELP_MORE_HELP_TAB: "Aide",
  13490. CLOSE: "Fermer",
  13491. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13492. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13493. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13494. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13495. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13496. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13497. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13498. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13499. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13500. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13501. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13502. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13503. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13504. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13505. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13506. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13507. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13508. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13509. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13510. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13511. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13512. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13513. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13514. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13515. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13516. HELP_MORE_HLR_A: "Carrousel",
  13517. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13518. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13519. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13520. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13521. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13522. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13523. HELP_MORE_TAG_A: "tag™ Posts",
  13524. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13525. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13526. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13527. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13528. HELP_MORE_TOUR_A: "Commandes de la visite",
  13529. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13530. HELP_MORE_INSIDE_A: "Vue intérieure",
  13531. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13532. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13533. HELP_MORE_VR_A: "Mode RV",
  13534. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13535. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13536. HELP_MORE_360_A: "Vues 360°",
  13537. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13538. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13539. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13540. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13541. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13542. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13543. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13544. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13545. WEBVR_LEARN_MORE: "En savoir plus",
  13546. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13547. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13548. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13549. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13550. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13551. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13552. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13553. VR_NEXT_CAPS: "SUIVANT",
  13554. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13555. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13556. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13557. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13558. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13559. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13560. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13561. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13562. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13563. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13564. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13565. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13566. VR_APP: "port VR App",
  13567. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13568. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13569. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13570. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13571. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13572. 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",
  13573. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13574. VR_ANDROID_DVICES: "Appareils Android",
  13575. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13576. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13577. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13578. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13579. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13580. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13581. VR_DOWNLOAD_HERE: "Télécharger ici",
  13582. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13583. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13584. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13585. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13586. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13587. SHARE_TO: "Partager sur",
  13588. SHARE_LINK: "Lien direct",
  13589. SHARE_EXPLORE: "Explorer ",
  13590. SHARE_AT: "à",
  13591. SHARE_WITH: "avec",
  13592. SHARE_3D: " en 3D",
  13593. SHARE_COPIED: "Copié!",
  13594. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13595. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13596. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13597. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13598. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13599. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13600. ERROR_GENERIC_ACTIONS_3: " ou ",
  13601. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13602. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13603. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13604. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13605. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13606. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13607. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13608. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13609. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13610. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13611. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13612. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13613. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13614. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13615. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13616. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13617. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13618. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13619. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13620. MENU_COPY: "Copie",
  13621. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13622. ROTATE: "Faire pivoter",
  13623. INSIDE: "Intérieure",
  13624. MOVE: "Se déplacer",
  13625. ZOOM: "Zoom"
  13626. }
  13627. }
  13628. , {}],
  13629. 114: [function(e, t, i) {
  13630. "use strict";
  13631. t.exports = {
  13632. PAGE_TITLE: "",
  13633. LOADING: "読み込み中",
  13634. PRESENTED_BY_CAPS: "PRESENTED BY",
  13635. POWERED_BY: "powered by",
  13636. POWERED_BY_CAPS: "POWERED BY",
  13637. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13638. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13639. PRESENTED_BY: "Presented by ",
  13640. MORE: "全て表示 ",
  13641. LESS: "閉じる ",
  13642. TAG_CONTENT: "tag™コンテンツ ",
  13643. SHOW: "表示",
  13644. HIDE: "非表示",
  13645. DOLLHOUSE: "ドールハウス",
  13646. FLOOR_PLAN: "フロアプラン",
  13647. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13648. CLOSE_HIGHLIGHTS: "閉じる",
  13649. PREVIOUS: "前へ",
  13650. PLAY: "再生",
  13651. PAUSE: "一時停止",
  13652. NEXT: "次へ",
  13653. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13654. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13655. SOCIAL_SHARING: "このSpaceを共有する",
  13656. VIEW_IN_VR: "VRで表示",
  13657. VIEW_FULLSCREEN: "フルスクリーン表示",
  13658. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13659. ZOOM_IN: "ズームイン",
  13660. ZOOM_OUT: "ズームアウト",
  13661. FLOOR_NAME: "フロア ",
  13662. FLOOR_ALL: "すべて",
  13663. TERMS: "規約",
  13664. PORT_TERMS: "port規約",
  13665. TERMS_OF_USE: "利用規約",
  13666. CLOSE_TERMS: "閉じる",
  13667. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13668. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13669. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13670. WEBVR_ENTER_WEBVR: "VRに入る",
  13671. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13672. WEBVR_LEARN_MORE: "もっと詳しく",
  13673. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13674. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13675. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13676. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13677. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13678. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13679. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13680. VR_PREVIOUS_CAPS: "前へ",
  13681. VR_NEXT_CAPS: "次へ",
  13682. VR_GOT_IT_CAPS: "了解",
  13683. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13684. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13685. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13686. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13687. VR_WHAT_YOU_NEED: "必要なもの",
  13688. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13689. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13690. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13691. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13692. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13693. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13694. VR_APP: "port VRアプリ",
  13695. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13696. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13697. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13698. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13699. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13700. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13701. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13702. VR_ANDROID_DVICES: "Androidデバイス",
  13703. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13704. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13705. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13706. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13707. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13708. VR_APP_OPEN: "port VRアプリで開く",
  13709. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13710. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13711. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13712. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13713. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13714. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13715. SHARE_TO: "共有先",
  13716. SHARE_LINK: "ダイレクトリンク",
  13717. SHARE_EXPLORE: "探索",
  13718. SHARE_AT: "場所",
  13719. SHARE_WITH: "使用アプリ",
  13720. SHARE_3D: "3Dで",
  13721. SHARE_COPIED: "コピーされました!",
  13722. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13723. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13724. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13725. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13726. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13727. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13728. ERROR_GENERIC_ACTIONS_3: "または",
  13729. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13730. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13731. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13732. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13733. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13734. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13735. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13736. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13737. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13738. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13739. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13740. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13741. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13742. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13743. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13744. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13745. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13746. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13747. LINK_TO_LOCATION: "ロケーションへのリンク",
  13748. MENU_COPY: "コピー",
  13749. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13750. ROTATE: "回転",
  13751. MOVE: "移動",
  13752. INSIDE: "内側",
  13753. ZOOM: "ズーム",
  13754. HELP: "ヘルプ",
  13755. HELP_NAVIGATION_TAB: "ナビゲーション",
  13756. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13757. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13758. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13759. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13760. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13761. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13762. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13763. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13764. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13765. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13766. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13767. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13768. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13769. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13770. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13771. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13772. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13773. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13774. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13775. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13776. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13777. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13778. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13779. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13780. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13781. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13782. HELP_MORE_HLR_A: "ハイライト",
  13783. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13784. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13785. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13786. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13787. HELP_MORE_FLOORS_A: "フロアセレクター",
  13788. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13789. HELP_MORE_TAG_A: "tag™ Posts",
  13790. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13791. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13792. HELP_MORE_ZOOM_A: "ズームコントロール",
  13793. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13794. HELP_MORE_TOUR_A: "ツアーコントロール",
  13795. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13796. HELP_MORE_INSIDE_A: "内側ビュー",
  13797. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13798. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13799. HELP_MORE_VR_A: "VRモード",
  13800. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13801. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13802. HELP_MORE_360_A: "360° Views",
  13803. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13804. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13805. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13806. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13807. CLOSE: "閉じる"
  13808. }
  13809. }
  13810. , {}],
  13811. 115: [function(e, t, i) {
  13812. "use strict";
  13813. t.exports = {
  13814. PAGE_TITLE: "",
  13815. LOADING: "Загрузка",
  13816. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13817. POWERED_BY: "разработано на платформе ",
  13818. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13819. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13820. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13821. PRESENTED_BY: "Представлено ",
  13822. MORE: "Больше ",
  13823. LESS: "Меньше ",
  13824. TAG_CONTENT: "tag™ Контент",
  13825. SHOW: "Показать",
  13826. HIDE: "Скрыть",
  13827. DOLLHOUSE: "Dollhouse",
  13828. FLOOR_PLAN: "Планировка",
  13829. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13830. CLOSE_HIGHLIGHTS: "Закрыть",
  13831. PREVIOUS: "Предыдущий",
  13832. PLAY: "Воспроизвести",
  13833. PAUSE: "Пауза",
  13834. NEXT: "Следующий",
  13835. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13836. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13837. SOCIAL_SHARING: "Поделиться этой моделью",
  13838. VIEW_IN_VR: "Посмотреть в VR",
  13839. VIEW_FULLSCREEN: "Полный экран",
  13840. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13841. ZOOM_IN: "Увеличить",
  13842. ZOOM_OUT: "Уменьшить",
  13843. FLOOR_NAME: "Этаж ",
  13844. FLOOR_ALL: "Все",
  13845. TERMS: "Условия",
  13846. PORT_TERMS: "Правила пользования",
  13847. TERMS_OF_USE: "Условия использования",
  13848. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13849. CLOSE_TERMS: "Закрыть",
  13850. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13851. HELP: "Помощь",
  13852. HELP_NAVIGATION_TAB: "Навигация",
  13853. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13854. CLOSE: "Закрыть",
  13855. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13856. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13857. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13858. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13859. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13860. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13861. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13862. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13863. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13864. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13865. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13866. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13867. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13868. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13869. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13870. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13871. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13872. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13873. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13874. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13875. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13876. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13877. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13878. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13879. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13880. HELP_MORE_HLR_A: "Фотоколлаж",
  13881. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13882. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13883. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13884. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13885. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13886. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13887. HELP_MORE_TAG_A: "tag™ Posts",
  13888. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13889. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13890. HELP_MORE_ZOOM_A: "Масштаб",
  13891. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13892. HELP_MORE_TOUR_A: "Управление Туром",
  13893. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13894. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13895. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13896. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13897. HELP_MORE_VR_A: "Режим VR",
  13898. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13899. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13900. HELP_MORE_360_A: "360° Views",
  13901. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13902. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13903. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13904. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13905. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13906. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13907. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13908. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13909. WEBVR_LEARN_MORE: "Узнать больше",
  13910. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13911. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13912. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13913. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13914. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13915. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13916. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13917. VR_APP: "port VR App",
  13918. VR_APP_OPEN: "Или открыть через приложение port VR",
  13919. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13920. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13921. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13922. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13923. VR_VIEW_SPACE: "Запустить модель в VR",
  13924. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13925. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13926. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13927. VR_GOT_IT_CAPS: "ЯСНО",
  13928. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13929. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13930. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13931. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13932. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13933. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13934. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13935. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13936. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13937. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13938. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13939. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13940. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13941. VR_ANDROID_DVICES: "Android устройства",
  13942. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13943. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13944. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13945. VR_DOWNLOAD_HERE: "Скачать здесь",
  13946. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13947. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13948. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13949. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13950. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13951. SHARE_TO: "Поделиться",
  13952. SHARE_LINK: "Прямая ссылка",
  13953. SHARE_EXPLORE: "просмотреть",
  13954. SHARE_AT: "на",
  13955. SHARE_WITH: "с",
  13956. SHARE_3D: "в 3D",
  13957. SHARE_COPIED: "Скопировано!",
  13958. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13959. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13960. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13961. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13962. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13963. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13964. ERROR_GENERIC_ACTIONS_3: " или ",
  13965. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13966. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13967. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13968. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13969. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13970. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13971. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13972. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13973. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13974. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13975. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13976. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13977. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13978. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13979. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13980. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13981. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13982. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13983. LINK_TO_LOCATION: "Ссылка на местоположение",
  13984. MENU_COPY: "Копировать",
  13985. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13986. ROTATE: "Вращать",
  13987. MOVE: "Передвигаться",
  13988. INSIDE: "Вид изнутри",
  13989. ZOOM: "Масштаб"
  13990. }
  13991. }
  13992. , {}],
  13993. 116: [function(r, e, t) {
  13994. (function(i) {
  13995. "use strict";
  13996. function re(e) {
  13997. console.log("e1:" + e),
  13998. e = Math.round(.4 * e * 100),
  13999. console.log("e2:" + e);
  14000. var t = $(".progressbar");
  14001. t.find(".bar").css("width", e + "%"),
  14002. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  14003. t.find(".perc").text(e + "%")
  14004. }
  14005. $("#gui-loading").fadeIn(200),
  14006. re(.1);
  14007. var e = g_version ? "modeldata.js" : "someData.json";
  14008. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  14009. dataType: "json"
  14010. }).done(function(e) {
  14011. var t = matcher(e);
  14012. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  14013. t.user = {
  14014. is_authenticated: !1,
  14015. 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"]
  14016. }
  14017. /* t.model.images = [
  14018. {
  14019. "metadata": "{\"camera_position\":{\"x\":0.8559,\"y\":-0.1097,\"z\":0.6656},\"camera_quaternion\":{\"x\":-0.1975,\"y\":-0.0952,\"z\":-0.0193,\"w\":0.9755},\"scan_id\":\"11\",\"zoom\":1}",
  14020. "name": "1",
  14021. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20201210_175837426.",
  14022. "sid": "20201210_175837426"
  14023. },
  14024. {
  14025. "metadata": "{\"camera_position\":{\"x\":1.1559,\"y\":-0.1083,\"z\":1.9191},\"camera_quaternion\":{\"x\":-0.0396,\"y\":0.1251,\"z\":0.005,\"w\":0.9913},\"scan_id\":\"12\",\"zoom\":1}",
  14026. "name": "2",
  14027. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20201210_175835333.",
  14028. "sid": "20201210_175835333"
  14029. },
  14030. {
  14031. "name": "区域1 hasmusic",
  14032. "momentTour": "black",
  14033. "musicInfo": {
  14034. "name": "一段音乐.mp3",
  14035. "music": "///super.4dage.com/data/LYW/edit/20210425_152844547.mp3",
  14036. "time": 7818
  14037. },
  14038. "locations": [
  14039. {
  14040. "metadata": "{\"camera_position\":{\"x\":-2.4032,\"y\":-0.1215,\"z\":-0.882},\"camera_quaternion\":{\"x\":-0.0898,\"y\":0.9081,\"z\":0.2552,\"w\":0.3196},\"scan_id\":\"5\",\"zoom\":1}",
  14041. "sid": "20210425_152818526",
  14042. "name": "20210425_152818526",
  14043. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152818526."
  14044. }
  14045. ]
  14046. },
  14047. {
  14048. "name": "区域2",
  14049. "momentTour": "black",
  14050. "locations": [
  14051. {
  14052. "metadata": "{\"camera_position\":{\"x\":-1.2063,\"y\":-0.1163,\"z\":0.4791},\"camera_quaternion\":{\"x\":0.0326,\"y\":0.9667,\"z\":0.1605,\"w\":-0.1966},\"scan_id\":\"2\",\"zoom\":1}",
  14053. "sid": "20210425_152857293",
  14054. "name": "20210425_152857293",
  14055. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152857293."
  14056. },
  14057. {
  14058. "metadata": "{\"camera_position\":{\"x\":-0.2906,\"y\":-0.1122,\"z\":-0.2226},\"camera_quaternion\":{\"x\":-0.258,\"y\":-0.3481,\"z\":-0.1003,\"w\":0.8956},\"scan_id\":\"1\",\"zoom\":1}",
  14059. "sid": "20210425_152900502",
  14060. "name": "20210425_152900502",
  14061. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152900502."
  14062. }
  14063. ]
  14064. },
  14065. {
  14066. "metadata": "{\"camera_position\":{\"x\":-1.2063,\"y\":-0.1163,\"z\":0.4791},\"camera_quaternion\":{\"x\":-0.0023,\"y\":-0.8326,\"z\":-0.0034,\"w\":0.5539},\"scan_id\":\"2\",\"zoom\":1}",
  14067. "sid": "20210425_152929593",
  14068. "name": "5",
  14069. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152929593."
  14070. }
  14071. ] */
  14072. try{//处理一下导览数据
  14073. t.model.images = t.model.images.filter(e=>{
  14074. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  14075. if(e.locations)e.locations = e.locations.filter(e=>e)
  14076. if(e.locations && e.locations.length == 0)return;
  14077. return e
  14078. })
  14079. }catch(e){console.log(e) }
  14080. window.editTool = new EditTools()
  14081. window.MP_PREFETCHED_MODELDATA = t
  14082. t.model.summary = t.summary
  14083. t.model.name = t.name
  14084. for(let i in t){
  14085. t[i] == "false" && (t[i] = false)
  14086. }
  14087. re(.7),
  14088. function() {
  14089. function y(e) {
  14090. t.update(e)
  14091. }
  14092. function A(e, t) {
  14093. ne.error(t),
  14094. n.error(t),
  14095. N.report(e, "error-" + t)
  14096. }
  14097. function C(e, t, i) {
  14098. try {
  14099. e.start(t)
  14100. } catch (e) {
  14101. throw ne.warn(e.message),
  14102. function(e) {
  14103. var t = O.details();
  14104. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  14105. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  14106. N.report(e, "error-webgl-generic"))
  14107. }(i.sid),
  14108. e
  14109. }
  14110. }
  14111. function I(e) {
  14112. e.stopPropagation(),
  14113. e.preventDefault()
  14114. }
  14115. window.MP_PREFETCHED_MODELDATA.hoticon && (g_HotImage = {
  14116. point: window.MP_PREFETCHED_MODELDATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  14117. point2: window.MP_PREFETCHED_MODELDATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  14118. });
  14119. /* window.MP_PREFETCHED_MODELDATA.backgroundMusic ? (g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic,
  14120. $("#volume").show()) : "one" === g_version && (g_bgAudio.src = g_Prefix + "/audio/audio" + window.number + "/background.mp3");
  14121. */
  14122. if (window.MP_PREFETCHED_MODELDATA.backgroundMusic) {
  14123. if(window.isLocal) g_bgAudio.src = manage.dealURL(window.MP_PREFETCHED_MODELDATA.backgroundMusic) ;
  14124. else g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic
  14125. $("#volume").show();
  14126. }else if (g_version === "one"){
  14127. g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
  14128. //g_bgAudio.src = manage.dealURL(src) ;
  14129. }
  14130. //隐藏公司logo
  14131. window.MP_PREFETCHED_MODELDATA.loadlogo && showLogo();
  14132. r("./lib/three75-shim"),
  14133. r("./lib/array-polyfill"),
  14134. r("./lib/performance-polyfill"),
  14135. r("./lib/shaders/CopyShader.js"),
  14136. r("./lib/shaders/HorizontalBlurShader.js"),
  14137. r("./lib/shaders/VerticalBlurShader.js"),
  14138. r("./lib/postprocessing/EffectComposer.js"),
  14139. r("./lib/postprocessing/RenderPass.js"),
  14140. r("./lib/postprocessing/MaskPass.js"),
  14141. r("./lib/postprocessing/ShaderPass.js"),
  14142. window.Promise || (window.Promise = r("promise-polyfill"));
  14143. var E = r("three")
  14144. , _ = r("three")
  14145. , b = (r("./util/sentry"),
  14146. r("./player"))
  14147. , w = r("./director")
  14148. , T = r("./controls/CameraControls")
  14149. , x = r("./model/ModelManager")
  14150. , S = r("./DisplayController")
  14151. , M = r("./label/LabelDisplayController")
  14152. , R = r("./enum/Viewmode")
  14153. , e = r("./util/logger")
  14154. , P = r("./showcase")
  14155. , O = r("./util/browser")
  14156. , L = r("./settings")
  14157. , D = r("./gui/gui")
  14158. , n = r("./gui/error")
  14159. , N = r("./analytics")
  14160. , F = r("./util/transitions")
  14161. , B = r("./effects")
  14162. , V = r("./objects/Skybox")
  14163. , k = (r("./util/common"),
  14164. r("./util/PanoramaCollection"),
  14165. r("./util/math"),
  14166. r("./util/showcase"))
  14167. , U = r("./util/camera")
  14168. , H = (r("./objects/Panorama"),
  14169. r("./cameras/PanoramaCamera"),
  14170. r("./preloaders"))
  14171. , z = r("events").EventEmitter
  14172. , G = r("./featureflags")
  14173. , W = (r("./util/lerp"),
  14174. r("./util/ajax"),
  14175. r("./ab"))
  14176. , j = r("./sdk/automation.js")
  14177. , Y = r("./scene/SceneRenderer")
  14178. , q = r("./scene/QuickstartManager")
  14179. , X = r("./tile/QualityManager.js")
  14180. , Z = r("./localization/localize")
  14181. , K = r("./tag/tagManager")
  14182. , Q = r("./tile/TileDownloader")
  14183. , J = r("./tile/PanoRenderer")
  14184. , ee = (r("./enum/PanoSizeClass"),
  14185. r("./enum/PanoramaEvents"),
  14186. r("./enum/SceneRendererEvents"))
  14187. , t = r("./gui/memoryUsage")
  14188. , te = r("./enum/RenderLayers")
  14189. , ie = r("./TimingData")
  14190. , ne = new e(i);
  14191. e.level = L.logLevel,
  14192. e.consoleEnabled = L.console,
  14193. function() {
  14194. var e = k.getModelIDFromQueryString();
  14195. if (!e)
  14196. return A(null, "loading-failed");
  14197. var t = k.parseSidUrl(e)
  14198. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  14199. , n = {
  14200. panoElementsToLoad: 6,
  14201. modelElementsToLoad: 0,
  14202. totalElementsLoaded: 0,
  14203. totalElementsToLoad: 0,
  14204. totalPercentageLoaded: 0,
  14205. progressCallback: null
  14206. }
  14207. , r = document.getElementById("player")
  14208. , o = L.quickstart.enabled
  14209. , a = null
  14210. , s = null
  14211. , l = null
  14212. , c = null
  14213. , h = null
  14214. , u = null
  14215. , d = null
  14216. , p = null
  14217. , f = null
  14218. , g = null
  14219. , m = null
  14220. , v = new ie;
  14221. !function(e) {
  14222. ne.info("Version", "2.25.6-0-gd87e5b1"),
  14223. z.defaultMaxListeners = 1e3,
  14224. function(e) {
  14225. e.addEventListener("dragenter", I, !1),
  14226. e.addEventListener("dragover", I, !1)
  14227. }(e),
  14228. O.valueFromHash("title", !0) || $(document).ready(function() {
  14229. $(".model-title").hide()
  14230. })
  14231. }(r),
  14232. function(e) {
  14233. return G.loadFeatureFlags(e).done(function(e) {
  14234. G.updateDependentSettings(e, L)
  14235. })
  14236. }({
  14237. urlBase: t.urlBase
  14238. }).then(function() {
  14239. return Z.init(),
  14240. function(e, t) {
  14241. var i = P.getModel({
  14242. url: t,
  14243. floors: O.valueFromHash("f", !0),
  14244. autoload: !1
  14245. });
  14246. return $.when(i, y).then(null, function(e) {
  14247. return this
  14248. })
  14249. }(0, e)
  14250. }).then(function(e) {
  14251. return re(.9),
  14252. function(e, t, i, n, r) {
  14253. ne.info("Model data loaded"),
  14254. ne.debug("UUID: " + e.data.job.uuid),
  14255. W.init(G.getFlags()),
  14256. i && N.initKeen({
  14257. token: i,
  14258. appId: n
  14259. }),
  14260. N.initSegment({
  14261. model: e.sid,
  14262. version: "2.25.6-0-gd87e5b1",
  14263. startSource: r.startSource,
  14264. token: t,
  14265. autoplay: r.autoplay,
  14266. quickstart: r.quickstart
  14267. })
  14268. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  14269. startSource: i,
  14270. autoplay: L.autoplay,
  14271. quickstart: o
  14272. }),
  14273. g.urls.init()
  14274. }).then(function() {
  14275. return g.loadPanos()
  14276. }).then(function() {
  14277. s = U.getStartCameraOptions(g, g.panos);
  14278. //初始画面
  14279. window.MP_PREFETCHED_MODELDATA.camera_start && window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg && function(e) {
  14280. $("<img/>").attr("src", e).on("load", function() {
  14281. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14282. $(this).remove()
  14283. $(".shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  14284. })
  14285. }(window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg);
  14286. d = function(e) {
  14287. var t = new E.PerspectiveCamera;
  14288. t.layers.enable(te.PANOMARKERS),
  14289. t.layers.enable(te.RETICULE),
  14290. t.layers.enable(te.TAG);
  14291. var o = new E.Scene
  14292. , i = new E.AmbientLight(16777215);
  14293. return o.add(i),
  14294. o.skybox = new V,
  14295. o.add(o.skybox),
  14296. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  14297. side: E.DoubleSide
  14298. })),
  14299. o.plane.position.y = 0,
  14300. o.plane.rotateX(-Math.PI / 2),
  14301. o.plane.material.visible = !1,
  14302. o.add(o.plane),
  14303. o.updateMatrixWorld(),
  14304. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  14305. if (e.metadata && e.metadata.camera_position) {
  14306. var t = e.metadata.camera_position
  14307. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  14308. i.position = t.clone(),
  14309. o.add(i);
  14310. var n = e.metadata.camera_quaternion
  14311. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  14312. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  14313. }
  14314. }),
  14315. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  14316. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  14317. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  14318. new Y(o,t,B)
  14319. }(g),
  14320. m = function(e, t) {
  14321. var i = e ? 1 : 1e3
  14322. , n = W.tilegen || W.imgopt ? 6 : 2;
  14323. n = O.valueFromHash("tileconc", n);
  14324. var r = new X
  14325. , o = new Q({
  14326. concurrentDownloads: n
  14327. })
  14328. , a = new J
  14329. , s = new x
  14330. , l = new w
  14331. , c = new b(t)
  14332. , h = new T
  14333. , u = new S(i)
  14334. , d = new M
  14335. , p = new K;
  14336. return {
  14337. qualityManager: r,
  14338. panoRenderer: a,
  14339. tileDownloader: o,
  14340. player: c,
  14341. director: l,
  14342. modelManager: s,
  14343. tagManager: p,
  14344. displayController: u,
  14345. labelDisplayController: d,
  14346. controls: h
  14347. }
  14348. }(o, s.mode),
  14349. l = m.controls,
  14350. c = m.player,
  14351. h = m.director,
  14352. u = m.tagManager,
  14353. p = m.tileDownloader,
  14354. f = m.qualityManager,
  14355. m.panoRenderer,
  14356. function(e, t, i, n) {
  14357. var r = i.controls
  14358. , o = i.qualityManager
  14359. , a = i.panoRenderer
  14360. , s = i.tileDownloader
  14361. , l = i.modelManager;
  14362. r.init(n, l),
  14363. j.init(i.director, r, i.player, l, t),
  14364. o.init(l),
  14365. s.init(o),
  14366. a.init(t, s, o),
  14367. l.init(s, a, o),
  14368. l.addModel(e),
  14369. t.addComponent(F)
  14370. }(g, d, m, r),
  14371. c.director = h,
  14372. g.supportsTiles && p.start(),
  14373. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14374. o = !1);
  14375. var e = null;
  14376. if (o) {
  14377. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14378. var t = l.controls[R.PANORAMA];
  14379. a = new q(f,d.scene,d.camera,t,r),
  14380. C(d, r, g),
  14381. e = a.load(s).then(function() {
  14382. d.addComponent(a),
  14383. d.once(ee.AfterRender, function() {
  14384. ne.warn("First render after quickstart load finished.")
  14385. })
  14386. })
  14387. }
  14388. return window.flyToFirst = function() {
  14389. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14390. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14391. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14392. c.flyToPano({
  14393. pano: e,
  14394. lookAtPoint: i
  14395. })
  14396. }
  14397. ,
  14398. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14399. }).then(function() {
  14400. return function(e, t, i, n, r) {
  14401. return r.progressCallback = t,
  14402. N.sessionStart(),
  14403. e.load(n).progress(function(e, t) {
  14404. e.modelElementsToLoad = t[1],
  14405. function(e) {
  14406. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14407. }(e),
  14408. function(e) {
  14409. e.totalElementsLoaded++,
  14410. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14411. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14412. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14413. console.log("pro:" + e.totalPercentageLoaded),
  14414. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14415. }(e)
  14416. }
  14417. .bind(this, r))
  14418. }(g, D.onProgress, 0, !o, n)
  14419. }).then(function() {
  14420. s.quickstart = o,
  14421. function(e, t, i, n) {
  14422. var r = i.qualityManager
  14423. , o = i.panoRenderer
  14424. , a = i.tileDownloader
  14425. , s = i.modelManager
  14426. , l = i.player
  14427. , c = i.director
  14428. , h = i.tagManager
  14429. , u = i.displayController
  14430. , d = i.labelDisplayController
  14431. , p = i.controls;
  14432. t.scene.add(e),
  14433. t.qualityManager = r;
  14434. var f = {
  14435. camera: t.camera,
  14436. director: c,
  14437. modelManager: s,
  14438. tileDownloader: a,
  14439. panoRenderer: o,
  14440. qualityManager: r,
  14441. tagManager: h,
  14442. container: n,
  14443. controls: p
  14444. };
  14445. l.init(f),
  14446. l.setScene(t.scene),
  14447. h.init(s, l),
  14448. c.init(l, s),
  14449. u.init(c, l, s, h, n),
  14450. d.init(l, s, n),
  14451. B.bindEvents(l),
  14452. t.addComponent(h),
  14453. t.addComponent(l),
  14454. t.addComponent(o),
  14455. l.sceneRenderer = t
  14456. }(g, d, m, r),
  14457. d.started || C(d, r, g),
  14458. N.modelLoaded(g, c, l, L.autoplay),
  14459. function(e, t, i, n) {
  14460. return ne.info("Starting player in " + i.mode),
  14461. N.report(t.sid, "started-playing", n, i.quickstart),
  14462. e.start(i)
  14463. }(c, g, s, L.autoplay).done(function() {
  14464. h.autoTour()
  14465. }),
  14466. g.supportsTiles || new H(g,c).start();
  14467. o && (d.removeComponent(a),
  14468. a.destroy(),
  14469. s.pano.enter()),
  14470. D.init(g, h, c, l, d, s, N.getSessionId()),
  14471. D.endLoading(g, h, u),
  14472. d.once(ee.AfterRender, function() {
  14473. v.setAppReadyTime();
  14474. var e = v.calcFullLoadingTime();
  14475. ne.warn("Total load time: " + e / 1e3),
  14476. N.loadComplete(e),
  14477. ne.warn("First render after model load finished.");
  14478. editTool.loadDone('data', window.MP_PREFETCHED_MODELDATA)
  14479. }),
  14480. d.on(ee.MemoryUsageUpdated, y)
  14481. }).fail(A.bind(this, e))
  14482. }()
  14483. }()
  14484. })
  14485. }
  14486. ).call(this, "/js/main.js")
  14487. }
  14488. , {
  14489. "./DisplayController": 1,
  14490. "./TimingData": 2,
  14491. "./ab": 3,
  14492. "./analytics": 4,
  14493. "./cameras/PanoramaCamera": 7,
  14494. "./controls/CameraControls": 9,
  14495. "./director": 15,
  14496. "./effects": 16,
  14497. "./enum/PanoSizeClass": 36,
  14498. "./enum/PanoramaEvents": 37,
  14499. "./enum/RenderLayers": 41,
  14500. "./enum/SceneRendererEvents": 43,
  14501. "./enum/Viewmode": 51,
  14502. "./featureflags": 59,
  14503. "./gui/error": 64,
  14504. "./gui/gui": 65,
  14505. "./gui/memoryUsage": 73,
  14506. "./label/LabelDisplayController": 91,
  14507. "./lib/array-polyfill": 92,
  14508. "./lib/performance-polyfill": 95,
  14509. "./lib/postprocessing/EffectComposer.js": 96,
  14510. "./lib/postprocessing/MaskPass.js": 97,
  14511. "./lib/postprocessing/RenderPass.js": 98,
  14512. "./lib/postprocessing/ShaderPass.js": 99,
  14513. "./lib/shaders/CopyShader.js": 100,
  14514. "./lib/shaders/HorizontalBlurShader.js": 101,
  14515. "./lib/shaders/VerticalBlurShader.js": 102,
  14516. "./lib/three75-shim": 103,
  14517. "./localization/localize": 108,
  14518. "./tag/tagManager": 124,
  14519. "./model/ModelManager": 140,
  14520. "./objects/Panorama": 148,
  14521. "./objects/Skybox": 152,
  14522. "./player": 155,
  14523. "./preloaders": 156,
  14524. "./scene/QuickstartManager": 157,
  14525. "./scene/SceneRenderer": 158,
  14526. "./sdk/automation.js": 164,
  14527. "./settings": 166,
  14528. "./showcase": 168,
  14529. "./tile/PanoRenderer": 169,
  14530. "./tile/QualityManager.js": 170,
  14531. "./tile/TileDownloader": 171,
  14532. "./util/PanoramaCollection": 178,
  14533. "./util/ajax": 181,
  14534. "./util/browser": 182,
  14535. "./util/camera": 183,
  14536. "./util/common": 185,
  14537. "./util/lerp": 188,
  14538. "./util/logger": 189,
  14539. "./util/math": 190,
  14540. "./util/sentry": 192,
  14541. "./util/showcase": 193,
  14542. "./util/transitions": 195,
  14543. events: 202,
  14544. "promise-polyfill": 213,
  14545. three: 217
  14546. }],
  14547. 117: [function(e, t, i) {
  14548. "use strict";
  14549. function n(e) {
  14550. e = e || {},
  14551. r.RawShaderMaterial.call(this, a.extendObject({
  14552. fragmentShader: o.cube.fragmentShader,
  14553. vertexShader: o.cube.vertexShader,
  14554. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14555. name: "CubemapMaterial"
  14556. }, e))
  14557. }
  14558. var r = e("three")
  14559. , o = e("../shaders")
  14560. , a = e("../util/common");
  14561. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14562. t.exports = n
  14563. }
  14564. , {
  14565. "../shaders": 167,
  14566. "../util/common": 185,
  14567. three: 217
  14568. }],
  14569. 118: [function(e, t, i) {
  14570. "use strict";
  14571. function n(e) {
  14572. e = e || {},
  14573. r.RawShaderMaterial.call(this, a.extendObject({
  14574. fragmentShader: o.model.fragmentShader,
  14575. vertexShader: o.model.vertexShader,
  14576. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14577. name: "ModelTextureMaterial"
  14578. }, e))
  14579. }
  14580. var r = e("three")
  14581. , o = e("../shaders")
  14582. , a = e("../util/common");
  14583. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14584. i && (this.uniforms.progress.value = 0),
  14585. e.ensureSkyboxReadyForRender(),
  14586. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14587. this.uniforms.pano0Position.value.copy(e.position),
  14588. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14589. t.ensureSkyboxReadyForRender(),
  14590. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14591. this.uniforms.pano1Position.value.copy(t.position),
  14592. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14593. }
  14594. ,
  14595. t.exports = n
  14596. }
  14597. , {
  14598. "../shaders": 167,
  14599. "../util/common": 185,
  14600. three: 217
  14601. }],
  14602. 119: [function(m, v, e) {
  14603. (function(e) {
  14604. "use strict";
  14605. function t(e, t, i, n) {
  14606. this.div = null,
  14607. this.body = null,
  14608. this.label = e,
  14609. this.description = t,
  14610. this.parsedDescription = [],
  14611. this.media = i || {
  14612. type: null
  14613. },
  14614. this.loadingSpinner = null,
  14615. this.parser = new r({
  14616. supportLinks: !c.valueFromHash("mls"),
  14617. keepLinkLabels: !0
  14618. }),
  14619. this.state = g.CLOSED,
  14620. this.orientation = "",
  14621. this.initialTransform = "",
  14622. this.hovering = !1,
  14623. this.openTransition = null,
  14624. this.closeTransition = null,
  14625. this.openPromise = null,
  14626. this.closePromise = null,
  14627. this.animationTransition = null,
  14628. this.animationScale = 0
  14629. }
  14630. var r = m("../Parser/DescriptionParser")
  14631. , i = m("../Media/Link")
  14632. , n = m("../Media/Image")
  14633. , o = m("../Media/EmbedlyPlayer")
  14634. , a = m("../Media/EmbedlyEmbed")
  14635. , s = m("../../util/transitions")
  14636. , l = m("../../util/lerp")
  14637. , c = m("../../util/browser")
  14638. , b = m("./BillboardEvent")
  14639. , w = m("../Media/MediaEvent")
  14640. , h = m("../Parser/DescriptionChunkType")
  14641. , u = m("events").EventEmitter
  14642. , d = m("./billboardSettings")
  14643. , T = m("./overlaySettings")
  14644. , p = new (m("../../util/logger"))(e)
  14645. , f = document.getElementById("tag-billboards");
  14646. f.addEventListener("touchend", function(e) {
  14647. f.style.pointerEvents = "none"
  14648. }),
  14649. f.addEventListener("touchcancel", function(e) {
  14650. f.style.pointerEvents = "none"
  14651. });
  14652. var g = {
  14653. CLOSED: "closed",
  14654. OPENING: "opening",
  14655. OPEN: "open",
  14656. CLOSING: "closing",
  14657. ACTIVE: "active"
  14658. };
  14659. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14660. this.parsedDescription = this.parser.parse(this.description);
  14661. var t = document.createElement("div");
  14662. t.className = "tag-container has-hotzone",
  14663. this.div = t,
  14664. this.body = document.createElement("div"),
  14665. this.body.className = "tag-body";
  14666. var i = document.createElement("div");
  14667. i.classList.add("tag-content");
  14668. var n = document.createElement("div");
  14669. n.classList.add("tag-text-content");
  14670. var r = document.createElement("div");
  14671. r.className = "tag-label",
  14672. r.textContent = this.label,
  14673. n.appendChild(r);
  14674. var o = document.createElement("div");
  14675. o.className = "tag-desc",
  14676. n.appendChild(o),
  14677. i.appendChild(n),
  14678. this.body.appendChild(i),
  14679. this.appendDescriptionElements(this.parsedDescription, o),
  14680. this.appendMedia(),
  14681. t.appendChild(this.body),
  14682. f.appendChild(t),
  14683. this.bindEvents(t, this.body)
  14684. }
  14685. ,
  14686. t.prototype.bindEvents = function(i, e) {
  14687. function t(n) {
  14688. return function(e) {
  14689. if (!this.div.classList.contains("overlay")) {
  14690. var t, i = document.getElementById("player");
  14691. try {
  14692. t = new MouseEvent(n,e)
  14693. } catch (i) {
  14694. (t = document.createEvent("MouseEvents")).initMouseEvent(n, 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)
  14695. }
  14696. i.dispatchEvent(t)
  14697. }
  14698. }
  14699. }
  14700. e.addEventListener("mousedown", function(e) {
  14701. e.stopPropagation()
  14702. }),
  14703. e.addEventListener("mouseup", function(e) {
  14704. e.stopPropagation()
  14705. }),
  14706. i.addEventListener("touchstart", function(e) {
  14707. f.style.pointerEvents = "auto"
  14708. }),
  14709. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14710. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14711. e.addEventListener("mouseover", function(e) {
  14712. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14713. }
  14714. .bind(this)),
  14715. i.addEventListener("mouseenter", function(e) {
  14716. this.state !== g.CLOSING && (this.hovering = !0,
  14717. this.emit(b.ENTER))
  14718. }
  14719. .bind(this)),
  14720. i.addEventListener("mouseleave", function(e) {
  14721. this.hovering = !1,
  14722. this.emit(b.LEAVE)
  14723. }
  14724. .bind(this)),
  14725. i.addEventListener("gesturestart", function(e) {
  14726. e.preventDefault()
  14727. });
  14728. var n = i.querySelector(".tag-text-content")
  14729. , r = 0;
  14730. n.addEventListener("touchstart", function(e) {
  14731. r = e.changedTouches[0].clientY
  14732. }),
  14733. n.addEventListener("touchmove", function(t) {
  14734. function e(e) {
  14735. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14736. }
  14737. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14738. }),
  14739. i.addEventListener("touchmove", function(e) {
  14740. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14741. })
  14742. }
  14743. ,
  14744. t.prototype.appendDescriptionElements = function(e, i) {
  14745. 0 < e.length && this.div.classList.add("has-text"),
  14746. e.forEach(function(e, t) {
  14747. switch (e.type) {
  14748. case h.TEXT:
  14749. i.appendChild(this.createTextElement(e.text));
  14750. break;
  14751. case h.LINK:
  14752. i.appendChild(this.createLinkElement(e.link))
  14753. }
  14754. }
  14755. .bind(this))
  14756. }
  14757. ,
  14758. t.prototype.appendLoadingSpinner = function() {
  14759. this.loadingSpinner = document.createElement("div"),
  14760. this.loadingSpinner.classList.add("loading-spinner");
  14761. var e = document.createElement("div");
  14762. e.classList.add("gui-spinner-icon"),
  14763. this.loadingSpinner.appendChild(e),
  14764. this.body.appendChild(this.loadingSpinner)
  14765. }
  14766. ,
  14767. t.prototype.onMediaLoadFinished = function() {
  14768. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14769. this.applyOrientation(this.orientation),
  14770. this.loadingSpinner = null)
  14771. }
  14772. ,
  14773. t.prototype.appendMedia = function() {
  14774. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14775. this.appendLoadingSpinner();
  14776. var e = document.createElement("div");
  14777. e.classList.add("tag-media-content");
  14778. var t = document.createElement("i");
  14779. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14780. t.classList.add(e)
  14781. }),
  14782. this.body.appendChild(t),
  14783. this.body.appendChild(e),
  14784. this.media.type) {
  14785. case h.IMAGE:
  14786. e.appendChild(this.createImageElement(this.media, this.body));
  14787. break;
  14788. case h.VIDEO:
  14789. e.appendChild(this.createVideoElement(this.media, this.body));
  14790. break;
  14791. case h.RICH:
  14792. e.appendChild(this.createEmbedElement(this.media, this.body))
  14793. }
  14794. }
  14795. }
  14796. ,
  14797. t.prototype.createTextElement = function(e) {
  14798. var t = document.createElement("span");
  14799. return t.textContent = e,
  14800. t
  14801. }
  14802. ,
  14803. t.prototype.createLinkElement = function(e) {
  14804. var t = new i(e);
  14805. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14806. t.createDomElement()
  14807. }
  14808. ,
  14809. t.prototype.createImageElement = function(t, C) {
  14810. function e() {
  14811. function e() {
  14812. p || (E.classList.remove("view-image"),
  14813. a.classList.add("overlay"),
  14814. t(),
  14815. window.addEventListener("resize", A),
  14816. a.addEventListener("click", i),
  14817. c.addEventListener("click", r),
  14818. o.addEventListener("click", n),
  14819. p = !0,
  14820. _.emit(w.IMAGE_OPENED))
  14821. }
  14822. function t() {
  14823. C.classList.add("show-info"),
  14824. s.classList.remove("collapsible"),
  14825. s.style.height = "";
  14826. var e = parseFloat(getComputedStyle(v).lineHeight)
  14827. , t = g + e
  14828. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14829. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14830. , r = n
  14831. , o = r * I.aspect;
  14832. i < o && (r = (o = i) / I.aspect),
  14833. n < r && (o = (r = n) * I.aspect),
  14834. o += m,
  14835. r += m + t,
  14836. C.style.width = o + "px",
  14837. C.style.height = r + "px",
  14838. l.style.paddingTop = e + m + "px",
  14839. 0 < _.description.length && (s.classList.add("collapsible"),
  14840. s.style.height = s.clientHeight + 12 + "px",
  14841. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14842. }
  14843. function i(e) {
  14844. e.target === a && n()
  14845. }
  14846. function n() {
  14847. p && (p = !1,
  14848. E.classList.add("view-image"),
  14849. a.classList.remove("overlay"),
  14850. s.style.height = "",
  14851. l.style.paddingTop = "",
  14852. C.style.width = "",
  14853. C.style.height = "",
  14854. window.removeEventListener("resize", A),
  14855. a.removeEventListener("click", i),
  14856. c.removeEventListener("click", r),
  14857. o.removeEventListener("click", n),
  14858. _.emit(w.IMAGE_CLOSED),
  14859. _.close(!0))
  14860. }
  14861. function r(e) {
  14862. C.classList.toggle("show-info")
  14863. }
  14864. var a = _.div
  14865. , s = a.getElementsByClassName("tag-content")[0]
  14866. , l = a.getElementsByClassName("tag-media-content")[0]
  14867. , o = C.getElementsByClassName("close")[0]
  14868. , c = s.getElementsByClassName("tag-label")[0];
  14869. a.classList.add("has-image"),
  14870. E.classList.add("view-image"),
  14871. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14872. _.applyOrientation(_.orientation);
  14873. var h, u, d, p = !1, f = getComputedStyle(s), g = parseFloat(f.paddingTop) + parseFloat(f.paddingBottom), m = 2 * parseFloat(getComputedStyle(l).paddingLeft), v = s.querySelector(".tag-label"), y = s.querySelector(".tag-desc"), A = (d = 0,
  14874. function() {
  14875. clearInterval(h),
  14876. clearTimeout(u),
  14877. h = setInterval(function() {
  14878. var e = a.clientHeight;
  14879. d !== e && (t(),
  14880. d = e)
  14881. }, 100),
  14882. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14883. }
  14884. );
  14885. I.on(w.IMAGE_OPENING, e),
  14886. _.on(b.ACTIVATE, e),
  14887. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14888. _.on(b.CLOSING, n)
  14889. }
  14890. var I = new n
  14891. , E = I.createDomElement();
  14892. this.once(b.OPENED, function() {
  14893. I.load(t.src).then(e).catch(function(e) {
  14894. p.warn("Failed to load image:", t.src),
  14895. p.warn("with error:", e)
  14896. }).then(this.onMediaLoadFinished.bind(this))
  14897. });
  14898. var _ = this;
  14899. return E
  14900. }
  14901. ,
  14902. t.prototype.createVideoElement = function(t, e) {
  14903. var i = new o({
  14904. autoPlay: !0,
  14905. autoResume: !0,
  14906. startMuted: !1,
  14907. loop: !1
  14908. })
  14909. , n = i.createDomElement();
  14910. return this.once(b.OPENED, function() {
  14911. i.load(t.src).then(function() {
  14912. this.div.classList.add("has-video"),
  14913. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14914. i.play()),
  14915. this.on(b.OPENING, i.show.bind(i)),
  14916. this.on(b.OPENED, i.play.bind(i)),
  14917. this.on(b.CLOSING, i.pause.bind(i)),
  14918. this.on(b.CLOSED, i.hide.bind(i))
  14919. }
  14920. .bind(this)).catch(function(e) {
  14921. p.warn("Failed to embed video:", t.src),
  14922. p.warn("with error:", e)
  14923. }).then(this.onMediaLoadFinished.bind(this))
  14924. }
  14925. .bind(this)),
  14926. n
  14927. }
  14928. ,
  14929. t.prototype.createEmbedElement = function(t, e) {
  14930. var i = new a
  14931. , n = i.createDomElement();
  14932. return this.once(b.OPENED, function() {
  14933. i.load(t.src).then(function() {
  14934. this.div.classList.add("has-embed"),
  14935. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14936. this.applyOrientation(this.orientation),
  14937. this.on(b.OPENING, i.show.bind(i)),
  14938. this.on(b.CLOSED, i.hide.bind(i))
  14939. }
  14940. .bind(this)).catch(function(e) {
  14941. p.warn("Failed to embed:", t.src),
  14942. p.warn("with error:", e)
  14943. }).then(this.onMediaLoadFinished.bind(this))
  14944. }
  14945. .bind(this)),
  14946. n
  14947. }
  14948. ,
  14949. t.prototype.open = function(e) {
  14950. return this.openPromise = $.Deferred(),
  14951. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14952. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14953. this.state !== g.OPEN && (this.emit(b.OPENING),
  14954. e && this.emit(b.ACTIVATING),
  14955. this.state = g.OPENING,
  14956. this.animateOpen(function() {
  14957. e && this.setActiveState(),
  14958. this.openPromise.resolve()
  14959. }
  14960. .bind(this)))
  14961. }
  14962. .bind(this), d.animation.openDelay),
  14963. s.cancel(this.closeTransition),
  14964. this.closePromise && this.closePromise.reject(),
  14965. this.closeTransition = void 0,
  14966. this.openPromise.promise())
  14967. }
  14968. ,
  14969. t.prototype.close = function(e) {
  14970. return this.closePromise = $.Deferred(),
  14971. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14972. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14973. this.state = g.CLOSING,
  14974. this.animateClose())
  14975. }
  14976. .bind(this), d.animation.closeDelay)),
  14977. s.cancel(this.openTransition),
  14978. this.openPromise && this.openPromise.reject(),
  14979. this.openTransition = void 0,
  14980. this.closePromise.resolve(),
  14981. this.closePromise.promise())
  14982. }
  14983. ,
  14984. t.prototype.setActiveState = function() {
  14985. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14986. this.emit(b.ACTIVATE),
  14987. this.div.classList.remove("has-hotzone"))
  14988. }
  14989. ,
  14990. t.prototype.animateOpen = function(e) {
  14991. if (this.state === g.OPENING) {
  14992. if (s.cancel(this.animationTransition),
  14993. c.detectSamsungNative())
  14994. return this.boardOrientation = null,
  14995. this.div.style.visibility = "visible",
  14996. this.emit(b.OPENED),
  14997. this.state = g.OPEN,
  14998. void (e && e());
  14999. this.div.style.webkitTransform = "scale(0)",
  15000. this.div.style.transform = "scale(0)",
  15001. this.div.style.visibility = "visible",
  15002. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  15003. this.emit(b.OPENED),
  15004. this.state = g.OPEN,
  15005. e && e()
  15006. }
  15007. .bind(this))
  15008. }
  15009. }
  15010. ,
  15011. t.prototype.animateClose = function(e) {
  15012. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  15013. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  15014. this.emit(b.CLOSED),
  15015. this.state = g.CLOSED,
  15016. this.div.style.visibility = "hidden",
  15017. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15018. e && e()
  15019. }
  15020. .bind(this)))
  15021. }
  15022. ,
  15023. t.prototype.needsUpdate = function() {
  15024. return this.state !== g.CLOSED
  15025. }
  15026. ,
  15027. t.prototype.update = function(e, t) {
  15028. if (this.needsUpdate()) {
  15029. var i = (this.updateOrientation(e),
  15030. this.calcScale(t))
  15031. , n = {
  15032. x: (e.x + 1) * $("#player").width() / 2,
  15033. y: (e.y + 1) * $("#player").height() / 2
  15034. };
  15035. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15036. this.div.style.webkitTransform = this.div.screenTransform,
  15037. this.div.style.transform = this.div.screenTransform
  15038. }
  15039. }
  15040. ,
  15041. t.prototype.getDimensions = function() {
  15042. return this.div.getBoundingClientRect()
  15043. }
  15044. ,
  15045. t.prototype.calcScale = function(e) {
  15046. return Math.sqrt(e / 40) * d.boardToDiscRatio
  15047. }
  15048. ,
  15049. t.prototype.updateOrientation = function(e) {
  15050. if (this.state !== g.ACTIVE) {
  15051. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  15052. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  15053. , n = "";
  15054. n += 0 == i ? "right" : 2 == i ? "left" : "",
  15055. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  15056. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  15057. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15058. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  15059. }
  15060. }
  15061. ,
  15062. t.prototype.applyOrientation = function(e) {
  15063. this.div.style.transform = this.div.style.webkitTransform = "",
  15064. this.div.classList.remove("tag-container-" + this.orientation),
  15065. this.div.classList.add("tag-container-" + e);
  15066. var t = window.getComputedStyle(this.div);
  15067. this.initialTransform = t.transform || t.webkitTransform,
  15068. "none" === this.initialTransform && (this.initialTransform = "");
  15069. var i = t.transform.slice(7, -1).split(",")
  15070. , n = -i[4]
  15071. , r = -i[5];
  15072. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15073. this.div.style.transformOrigin = n + "px " + r + "px",
  15074. this.orientation = e
  15075. }
  15076. ,
  15077. v.exports = t
  15078. }
  15079. ).call(this, "/js/tag/Billboard/Billboard.js")
  15080. }
  15081. , {
  15082. "../../util/browser": 182,
  15083. "../../util/lerp": 188,
  15084. "../../util/logger": 189,
  15085. "../../util/transitions": 195,
  15086. "../Media/EmbedlyEmbed": 125,
  15087. "../Media/EmbedlyPlayer": 126,
  15088. "../Media/Image": 128,
  15089. "../Media/Link": 129,
  15090. "../Media/MediaEvent": 131,
  15091. "../Parser/DescriptionChunkType": 133,
  15092. "../Parser/DescriptionParser": 134,
  15093. "./BillboardEvent": 120,
  15094. "./billboardSettings": 121,
  15095. "./overlaySettings": 122,
  15096. events: 202
  15097. }],
  15098. 120: [function(e, t, i) {
  15099. "use strict";
  15100. t.exports = Object.freeze({
  15101. ENTER: "billboard.enter",
  15102. LEAVE: "billboard.leave",
  15103. OPENING: "billboard.opening",
  15104. OPENED: "billboard.open",
  15105. CLOSING: "billboard.closing",
  15106. CLOSED: "billboard.closed",
  15107. ACTIVATING: "billboard.activating",
  15108. ACTIVATE: "billboard.activate"
  15109. })
  15110. }
  15111. , {}],
  15112. 121: [function(e, t, i) {
  15113. "use strict";
  15114. t.exports = Object.freeze({
  15115. animation: Object.freeze({
  15116. hoverOnClosing: !1,
  15117. openDelay: 100,
  15118. closeDelay: 50,
  15119. openDuration: 200,
  15120. closeDuration: 100
  15121. }),
  15122. boardToDiscRatio: 1.2
  15123. })
  15124. }
  15125. , {}],
  15126. 122: [function(e, t, i) {
  15127. "use strict";
  15128. t.exports = Object.freeze({
  15129. boundaryWidth: 30,
  15130. boundaryHeight: 0
  15131. })
  15132. }
  15133. , {}],
  15134. hot: [function(e, t, i) {
  15135. "use strict";
  15136. function n(e, t, i) {
  15137. this.sid = e,
  15138. this.position = this.convertValue(t.position, g.Vector3)
  15139. if(t.quaternion){
  15140. this.quaternion = this.convertValue(t.quaternion, g.Quaternion)
  15141. }else{
  15142. this.rotation = new g.Euler().setFromVector3(this.convertValue(t.rotation, g.Vector3 ))
  15143. }
  15144. this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
  15145. this.isSprite = t.isSprite || 0
  15146. this.actionType = (t.noAction ? 'noAction' : t.actionType ) || "common"
  15147. this.linkType = t.linkType || "common"
  15148. this.link = t.link,
  15149. this.model = i,
  15150. this.size = t.size;
  15151. this.styleImg = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img,会经常改变
  15152. this.infoAttribute = t.infoAttribute || {};
  15153. this.transformAtPanos = t.transformAtPanos || {}
  15154. for (let i in this.transformAtPanos) {
  15155. this.transformAtPanos[i].pos = new THREE.Vector3().fromArray(this.transformAtPanos[i].pos)
  15156. this.transformAtPanos[i].qua && (this.transformAtPanos[i].qua = new THREE.Quaternion().fromArray(this.transformAtPanos[i].qua))
  15157. }
  15158. this.build()
  15159. this.setFromInfo()
  15160. this.changeTex()
  15161. this.visibleData = t.visiblePanos
  15162. //this.setVisiblePanos(t.visiblePanos );
  15163. }
  15164. var g = e("three")
  15165. , r = e("../shaders")
  15166. , m = e("../settings")
  15167. , v = e("../enum/Viewmode")
  15168. , d = e("../objects/Panorama")
  15169. , o = e("../util/texture")
  15170. , math = e("../util/math")
  15171. , p = new g.Raycaster
  15172. , a = new g.PlaneBufferGeometry(g_HotMeshSize.g_HotMeshWidth,g_HotMeshSize.g_HotMeshHeight,1,1)
  15173. var defaultTex1 = o.load(g_HotImage.point);
  15174. var defaultTex2 = o.load(g_HotImage.point2)
  15175. dealMap(defaultTex1)
  15176. dealMap(defaultTex2)
  15177. n.prototype.setFromInfo = function(){ //初始化或恢复
  15178. var info = this.infoAttribute
  15179. this.setTitleElem(info.title)
  15180. this.transformAtPanos = info.transformAtPanos || this.transformAtPanos
  15181. var curPanoTransform = this.transformAtPanos[ getTransformSid()] || {}
  15182. var pos = curPanoTransform.pos || info.position
  15183. pos && this.mesh.position.copy(pos)
  15184. info.position && this.position.copy(info.position) //this.position记录全局position
  15185. var isSprite = info.isSprite != void 0 ? info.isSprite : this.isSprite
  15186. if(!isSprite){
  15187. var qua = curPanoTransform.qua || info.quaternion
  15188. qua && this.mesh.quaternion.copy(qua)
  15189. }
  15190. info.quaternion && this.quaternion.copy(info.quaternion) //this.quaternion记录全局quaternion
  15191. var s = parseFloat(info.hotIconScale || window.MP_PREFETCHED_MODELDATA.hotIconScale )
  15192. s && this.mesh.scale.set(s, s, s)
  15193. this.isSprite = isSprite
  15194. this.actionType = info.actionType != void 0 ? info.actionType : this.actionType
  15195. this.linkType = info.linkType != void 0 ? info.linkType : this.linkType
  15196. this.initStyleImg()
  15197. }
  15198. n.prototype.changeTex = function(styleImg){
  15199. var u = this.mesh.material.uniforms
  15200. var styleImg = styleImg || this.styleImg
  15201. if(styleImg.length){
  15202. u.texture1.value = o.load(styleImg[0].src);
  15203. u.texture2.value = o.load(styleImg[1]&&styleImg[1].src || styleImg[0].src);
  15204. }else{
  15205. u.texture1.value = defaultTex1;
  15206. u.texture2.value = defaultTex2;
  15207. }
  15208. this.styleImg = styleImg
  15209. }
  15210. n.prototype.initStyleImg = function(){
  15211. var t = this.infoAttribute;
  15212. this.styleImg = []
  15213. t.styleImg = t.styleImg || [];
  15214. t.styleImg.forEach((src)=>{
  15215. //src = src.src || src
  15216. this.styleImg.push({src:manage.dealURL(src)})
  15217. })
  15218. this.changeTex()
  15219. }
  15220. n.prototype.update = function(camera) {
  15221. if(this.isSprite){
  15222. this.mesh.quaternion.copy(camera.quaternion)
  15223. }
  15224. }
  15225. n.prototype.setVisiblePanos = function(visibleData ){
  15226. if(visibleData == "get"){
  15227. this.visiblePanos = player.model.panos.list.map((pano)=>{return pano.id})
  15228. }else if(visibleData){
  15229. this.visiblePanos = visibleData;
  15230. }
  15231. /* this.visiblePanos = [];
  15232. this.model.panos.list.forEach((pano)=>{//考虑到热点可以移动,不好重新设置,还是不根据模型遮挡来初始化了,默认全部可见
  15233. if(visibleData && !visibleData.includes(pano.id))return;
  15234. var isShelter = convertTool.ifIntersectChunks(pano.position, this.position, {model: this.model.colliders});
  15235. if(!isShelter){
  15236. this.visiblePanos.push(pano.id)
  15237. }
  15238. }) */
  15239. }
  15240. n.prototype.build = function() {
  15241. var t = g.UniformsUtils.clone(r.hot.uniforms);
  15242. var e = new g.Mesh(a, new g.ShaderMaterial({
  15243. uniforms: t,
  15244. vertexShader: r.hot.vertexShader,
  15245. fragmentShader: r.hot.fragmentShader,
  15246. transparent: !0
  15247. }))
  15248. e.dynamic = !0,
  15249. e.position.copy(this.position);
  15250. e.quaternion.copy(this.quaternion)
  15251. e.name = this.sid,
  15252. e.type = "hotSprite",
  15253. (e.belongHot = this).link && (e.hotLink = this.link),
  15254. this.mesh = e,
  15255. this.model.add(e),
  15256. g_HotMeshes.push(e);
  15257. }
  15258. n.prototype.setTitleElem = function(){
  15259. var root = $("#hot");
  15260. var title = this.infoAttribute.title;
  15261. if(title){
  15262. if(!this.titleElem){
  15263. var elem = $(`<div></div>`)
  15264. root.append(elem);
  15265. this.titleElem = elem;
  15266. }
  15267. this.titleElem.text(title)
  15268. }else{
  15269. if(this.titleElem){
  15270. this.titleElem.remove()
  15271. this.titleElem = null;
  15272. }
  15273. }
  15274. }
  15275. n.prototype.showTitle = function(){
  15276. if(!this.titleElem)return;
  15277. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  15278. if(pos.trueSide){//inSight
  15279. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  15280. this.titleElem.css("display","block");
  15281. }else{
  15282. this.titleElem.css("display","none");
  15283. }
  15284. }
  15285. n.prototype.hideTitle = function(){
  15286. if(!this.titleElem)return;
  15287. this.titleElem.css("display","none");
  15288. }
  15289. ,
  15290. n.prototype.closestPanoTowardTag = function(e, t) {
  15291. var i = []
  15292. , n = []
  15293. , r = this.mesh.position;
  15294. if (e === v.PANORAMA) {
  15295. var o = t.position.clone().sub(r).normalize();
  15296. n.push(d.scoreFunctions.direction(r, o))
  15297. }
  15298. var a = new g.Vector3;
  15299. i.push(function(e) {
  15300. return Math.abs(e.position.x - r.x) > m.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > m.tags.visibility.cameraClearance
  15301. }, function(e) {
  15302. a.copy(r).sub(e.position);
  15303. var t = -g.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15304. , i = m.tags.navigate.tiltTolerance;
  15305. return m.insideLookLimitDown - i < t && t < m.insideLookLimitUp + i
  15306. },
  15307. (pano)=>{ // add
  15308. return player.checkHasNeighbor(pano)
  15309. }
  15310. ),
  15311. n.push(d.scoreFunctions.distanceSquared(this.mesh, -2));
  15312. var s = t.model.panos.sortByScore(i, n);
  15313. if (s && m.tags.navigate.lineOfSight) {
  15314. for (var l = 0; l < s.length; l++) {
  15315. var c = s[l].pano
  15316. , h = c.position.distanceTo(r);
  15317. p.set(c.position, r.clone().sub(c.position).normalize());
  15318. var u = p.intersectObjects(t.model.colliders);
  15319. if (0 === u.length || u[0].distance > h)
  15320. return console.log(l),
  15321. c
  15322. }
  15323. return null
  15324. }
  15325. return s && 0 < s.length && s[0].pano
  15326. }
  15327. var getLink = function(link){
  15328. var src = '';
  15329. var r = link.substring(link.indexOf("html") + 4)
  15330. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";
  15331. -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
  15332. return src
  15333. }
  15334. n.prototype.examine = function(e, options) {
  15335. options = options || {}
  15336. if(this.actionType == 'noAction')return
  15337. if(this.linkType!="common" && this.infoAttribute.iframe && this.infoAttribute.iframe[0] && !options.dontOpen){
  15338. var src = getLink(this.infoAttribute.iframe[0]);
  15339. if(this.linkType=="jumpLink"){
  15340. var newPage = window.open(src, "_blank" );
  15341. newPage.focus();
  15342. }else if(this.linkType=="iframeDiv"){
  15343. var div = document.createElement("div");
  15344. $("body").append(div);
  15345. div.style.position = 'fixed';
  15346. div.style.width = div.style.height = "100%";
  15347. div.style.left = div.style.top = '0';
  15348. div.style["z-index"] = "999"
  15349. var exit = document.createElement("div");
  15350. exit.style["background-image"] = "url(images/vrOffImg.png)";
  15351. exit.style.position = 'absolute';
  15352. exit.style.width = exit.style.height = "50px";
  15353. exit.style.left = '17px'; exit.style.top = "20px"
  15354. exit.style.cursor = "pointer";
  15355. exit.style["background-repeat"] = "no-repeat";
  15356. exit.style["background-size"] = "25%";
  15357. exit.style["background-position"] = "center center";
  15358. exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
  15359. exit.style["border-radius"] = "50%";
  15360. exit.style["z-index"] = "3"
  15361. exit.onclick = ()=>{
  15362. $(div).remove()
  15363. if(g_bgAudio && g_bgAudio.pauseByHot){
  15364. manage.switchBgmState(true)
  15365. }
  15366. }
  15367. var myElement = document.createElement("iframe");
  15368. myElement.style.position = 'absolute';
  15369. myElement.style.width = myElement.style.height = "100%";
  15370. myElement.style.left = myElement.style.top = '0';
  15371. myElement.src = src
  15372. div.appendChild(exit);
  15373. div.appendChild(myElement)
  15374. if(g_bgAudio && !g_bgAudio.paused){
  15375. manage.switchBgmState(false);
  15376. g_bgAudio.pauseByHot = true
  15377. }
  15378. if(g_tourAudio)g_tourAudio.pause()
  15379. }
  15380. return;
  15381. }
  15382. if(settings.dontExamHot || this.actionType == 'dontExam'){
  15383. o();
  15384. return;
  15385. }
  15386. if(!player.currentPano)return;
  15387. var i = document.getElementById("popup");
  15388. if (this.link && !options.dontOpen) {
  15389. g_currentHot = this,
  15390. i.style.display = "block",
  15391. i.classList.add("wait");
  15392. var n = document.createElement("iframe");
  15393. if(g_bgAudio && !g_bgAudio.paused){
  15394. manage.switchBgmState(false);
  15395. g_bgAudio.pauseByHot = true
  15396. }
  15397. if(g_tourAudio)g_tourAudio.pause()
  15398. var src = getLink(this.link )
  15399. n.src = src;
  15400. n.id = "id1",
  15401. n.allowTransparency = "true";
  15402. var a = document.getElementById("id1");
  15403. if (void 0 === a || null == a) {
  15404. document.querySelector(".popup-content").appendChild(n);
  15405. var s = !1;
  15406. window.loaddingSuccess = function() {
  15407. s = !0
  15408. }
  15409. ,
  15410. setTimeout(function e() {
  15411. if (s) {
  15412. var t = document.querySelector("#id1").contentWindow.document;
  15413. t.querySelector("video") && (t.querySelector("video").play(),
  15414. !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")),
  15415. t.querySelector("audio") && t.querySelector("audio").play()
  15416. } else
  15417. setTimeout(e, 300)
  15418. }, 800)
  15419. }
  15420. }
  15421. var l = e.mode
  15422. , c = m.tags.navigate.nearestPano && this.closestPanoTowardTag(l, e.currentPano) || e.currentPano
  15423. , h = this.mesh.position;
  15424. e.flyingToTag = !0;
  15425. var u = function() {
  15426. e.flyingToTag = !1;
  15427. options.dontOpen || this.link && i.classList.remove("wait")
  15428. }
  15429. .bind(this);
  15430. if (l === v.PANORAMA) {
  15431. var d = {
  15432. pano: c,
  15433. lookAtPoint: h,
  15434. duration: options.duration,
  15435. maxDistanceOverride: null,
  15436. skipWarpingCheck: !1,
  15437. aimDuration: options.aimDuration,
  15438. };
  15439. e.flyToPano(d, u)
  15440. } else {
  15441. var p = {
  15442. pano: c
  15443. };
  15444. if (h) {
  15445. var f = (new g.Matrix4).lookAt(c.position, h, new g.Vector3(0,1,0));
  15446. p.quaternion = (new g.Quaternion).setFromRotationMatrix(f)
  15447. }
  15448. p.callback = u,
  15449. p.duration = options.duration || 1500,
  15450. p.mode = v.PANORAMA,
  15451. p.aimDuration = options.aimDuration
  15452. e.flyToNewMode(p)
  15453. }
  15454. }
  15455. ,
  15456. n.prototype.dispose = function(){
  15457. this.mesh.parent.remove(this.mesh);
  15458. var index = g_HotMeshes.indexOf(this.mesh);
  15459. g_HotMeshes.splice(index,1)
  15460. }
  15461. /* n.prototype.conversionArray = function(e) {
  15462. if ("[object Array]" == Object.prototype.toString.call(e))
  15463. return e;
  15464. var t = [];
  15465. for (var i in e)
  15466. t.push(parseFloat(e[i]));
  15467. return t
  15468. } */
  15469. n.prototype.convertValue = function(v ,Type){
  15470. var value;
  15471. if(v instanceof Array){
  15472. v.forEach((v1)=>{v1 = parseFloat(v1)})
  15473. value = new Type().fromArray(v);
  15474. }else{
  15475. for(let i in v){v[i] = parseFloat(v[i])}
  15476. value = new Type().copy(v);
  15477. }
  15478. return value
  15479. }
  15480. ,
  15481. t.exports = n
  15482. }
  15483. , {
  15484. three: 217,
  15485. "../shaders": 167,
  15486. "../enum/Viewmode": 51,
  15487. "../objects/Panorama": 148,
  15488. "../util/texture": 194,
  15489. "../settings": 166,
  15490. "../util/math": 190,
  15491. }],
  15492. 123: [function(M, R, e) {
  15493. (function(e) {
  15494. "use strict";
  15495. function d(e, t, i) {
  15496. var n = i.version || "0";
  15497. "0" !== n && w.info("tag defined using version " + n),
  15498. this.model = e,
  15499. this.sid = t,
  15500. this.color = (new f.Color).set(i.color || o.tagDefault),
  15501. this.hoverColor = o._darken(this.color, .2),
  15502. this.floor = null,
  15503. this.floorIndex = i.floor,
  15504. this.mode = m.PANORAMA,
  15505. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15506. this.obj3d = null,
  15507. this.disc = null,
  15508. this.materials = {
  15509. disc: null,
  15510. pole: null
  15511. },
  15512. this.position = (new f.Vector3).copy(i.position),
  15513. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  15514. this.discWorldPosition = null,
  15515. this.discScale = .05,
  15516. this.poleEnabled = i.stem.enabled,
  15517. this.billboard = new r(i.label,i.description,i.media,this),
  15518. this.visibleTransition = null,
  15519. this.hoveringDisc = !1
  15520. }
  15521. var i, l, c, h, u, p, n, f = M("three"), r = M("./Billboard/Billboard"), g = M("../settings"), m = M("../enum/Viewmode"), o = M("../enum/Colors"), a = M("../enum/RenderLayers"), s = M("../enum/RenderOrder"), v = (M("../util/common"),
  15522. M("../util/math")), t = M("../util/texture"), y = M("../objects/Panorama"), A = M("../shaders"), C = M("../util/transitions"), I = M("../util/lerp"), E = M("../util/easing"), _ = M("./Billboard/BillboardEvent"), b = M("events").EventEmitter, w = new (M("../util/logger"))(e), T = t.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=="), x = t.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"), S = new f.PlaneBufferGeometry(1,1);
  15523. d.prototype = Object.create(b.prototype),
  15524. d.raycaster = new f.Raycaster,
  15525. d.prototype.bindEvents = function() {
  15526. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  15527. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15528. }
  15529. ,
  15530. d.prototype.build = function() {
  15531. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15532. this.floor && (this.billboard.build(this.model.sid),
  15533. this.obj3d = this.buildObject3D(),
  15534. this.floor.add(this.obj3d)),
  15535. this
  15536. }
  15537. ,
  15538. d.prototype.buildObject3D = function() {
  15539. var e = new f.Object3D;
  15540. e.position.copy(this.position);
  15541. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15542. t.bg.value = x,
  15543. t.mask.value = T,
  15544. t.color.value.copy(this.color),
  15545. this.materials.disc = new f.RawShaderMaterial({
  15546. transparent: !0,
  15547. vertexShader: A.tagDisc.vertexShader,
  15548. fragmentShader: A.tagDisc.fragmentShader,
  15549. uniforms: t
  15550. }),
  15551. this.disc = new f.Mesh(S,this.materials.disc),
  15552. this.disc.layers.set(a.TAG),
  15553. this.disc.position.copy(this.discPosition),
  15554. this.disc.renderOrder = s.tagDisc;
  15555. var i = (this.disc.tag = this).buildPole();
  15556. return i.layers.set(a.TAG),
  15557. i.renderOrder = s.tagStem,
  15558. e.add(i),
  15559. e.layers.set(a.TAG),
  15560. e.add(this.disc)
  15561. }
  15562. ,
  15563. d.prototype.buildPole = function() {
  15564. var e = new f.BufferGeometry
  15565. , t = new Float32Array(6);
  15566. return t[0] = t[1] = t[2] = 0,
  15567. t[3] = this.discPosition.x,
  15568. t[4] = this.discPosition.y,
  15569. t[5] = this.discPosition.z,
  15570. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15571. this.materials.pole = new f.LineBasicMaterial({
  15572. linewidth: g.tags.pole.width,
  15573. color: g.tags.pole.color,
  15574. opacity: 0,
  15575. visible: this.poleEnabled,
  15576. transparent: !0,
  15577. depthWrite: !1
  15578. }),
  15579. new f.Line(e,this.materials.pole)
  15580. }
  15581. ,
  15582. d.prototype.setFreeState = function(e) {
  15583. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15584. this.materials.disc.uniforms.color.value = this.color
  15585. }
  15586. .bind(this))
  15587. }
  15588. ,
  15589. d.prototype.setHoverState = function(e) {
  15590. this.billboard.open(e),
  15591. this.materials.disc.uniforms.color.value = this.hoverColor
  15592. }
  15593. ,
  15594. d.prototype.hide = function(e, t) {
  15595. var i = $.Deferred();
  15596. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15597. return i.resolve().promise();
  15598. e = e || 0,
  15599. t = t || 0,
  15600. C.cancel(this.visibleTransition);
  15601. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15602. return this.visibleTransition = C.start((n = this,
  15603. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15604. o = I.property(n.materials.pole, "opacity", 0),
  15605. function(e) {
  15606. r(e),
  15607. n.materials.pole && o(e)
  15608. }
  15609. ), s * a, function() {
  15610. i.resolve()
  15611. }, l, E[g.warp.blendEasing]),
  15612. i.promise()
  15613. }
  15614. ,
  15615. d.prototype.show = function(e, t) {
  15616. var i = $.Deferred();
  15617. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15618. return i.resolve().promise();
  15619. e = e || 0,
  15620. t = t || 0,
  15621. C.cancel(this.visibleTransition);
  15622. var n, r, o, a = (g.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / g.tags.disc.opacity, s = t + e, l = t / s;
  15623. return this.visibleTransition = C.start((n = this,
  15624. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15625. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15626. function(e) {
  15627. r(e),
  15628. n.materials.pole && o(e)
  15629. }
  15630. ), s * a, function() {
  15631. i.resolve()
  15632. }, l, E[g.warp.blendEasing]),
  15633. i.promise()
  15634. }
  15635. ,
  15636. d.prototype.closestPanoTowardTag = function(e, t) {
  15637. var i = []
  15638. , n = []
  15639. , r = this.disc.getWorldPosition();
  15640. if (e === m.PANORAMA) {
  15641. var o = t.position.clone().sub(r).normalize();
  15642. i.push(y.filters.isPanoAligned()),
  15643. i.push(y.filters.inPanoDirection(r, o, .5)),
  15644. i.push(y.filters.isNeighbourPanoTo(t)),
  15645. n.push(y.scoreFunctions.direction(r, o))
  15646. }
  15647. var a = new f.Vector3;
  15648. i.push(function(e) {
  15649. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15650. }, function(e) {
  15651. a.copy(r).sub(e.position);
  15652. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15653. , i = g.tags.navigate.tiltTolerance;
  15654. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15655. }),
  15656. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15657. var s = this.model.panos.sortByScore(i, n);
  15658. if (g.tags.navigate.lineOfSight) {
  15659. for (var l = 0; l < s.length; l++) {
  15660. var c = s[l].pano
  15661. , h = c.position.distanceTo(r);
  15662. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15663. return null;
  15664. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15665. var u = d.raycaster.intersectObjects(this.model.colliders);
  15666. if (0 === u.length || u[0].distance > h)
  15667. return c
  15668. }
  15669. return null
  15670. }
  15671. return 0 < s.length && s[0].pano
  15672. }
  15673. ,
  15674. d.prototype.examine = function(i) {
  15675. if(!player.currentPano)return;
  15676. var e = i.mode
  15677. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15678. , t = this.disc.getWorldPosition();
  15679. this.billboard.setActiveState();
  15680. var r = function() {
  15681. var e = this.billboard.getDimensions()
  15682. , t = new f.Vector3;
  15683. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15684. t.unproject(i.camera),
  15685. i.flyToPano({
  15686. pano: n,
  15687. lookAtPoint: t
  15688. })
  15689. }
  15690. .bind(this);
  15691. if (e === m.PANORAMA)
  15692. if (n !== i.currentPano) {
  15693. var o = {
  15694. pano: n,
  15695. lookAtPoint: t,
  15696. duration: null,
  15697. maxDistanceOverride: null,
  15698. skipWarpingCheck: !1
  15699. };
  15700. i.flyToPano(o, r)
  15701. } else
  15702. setTimeout(function() {
  15703. this.billboard.open().then(function() {
  15704. r()
  15705. })
  15706. }
  15707. .bind(this), 0);
  15708. else {
  15709. var a = {
  15710. pano: n
  15711. };
  15712. if (t) {
  15713. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15714. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15715. }
  15716. a.callback = r,
  15717. a.duration = 1500,
  15718. a.mode = m.PANORAMA,
  15719. i.flyToNewMode(a)
  15720. }
  15721. }
  15722. ,
  15723. d.prototype.update = (n = new f.Vector3,
  15724. function(e, t) {
  15725. this.discWorldPosition = this.disc.getWorldPosition(),
  15726. this.updateDisc(e, t),
  15727. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15728. n.z < 1 && (n.y *= -1,
  15729. this.billboard.update(n, this.getDiscRadius(n, t))))
  15730. }
  15731. ),
  15732. d.prototype.updateDisc = (l = new f.Vector3,
  15733. c = new f.Vector3,
  15734. h = new f.Vector3,
  15735. u = new f.Vector3,
  15736. p = new f.Vector3,
  15737. function(e, t) {
  15738. var i = g.tags.visibility
  15739. , n = g.tags.disc.scale
  15740. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15741. if (this.obj3d.visible = 0 !== this.disc.material.opacity && (i.anyDistance || r <= i.visibleDistance || e === m.TRANSITIONING) && (!i.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) && (!i.hideOffScreenDisc || !this.offScreen(this.disc, t)) && (!i.hideOffScreenObject || !this.offScreen(this.obj3d, t)),
  15742. this.obj3d.visible) {
  15743. this.disc.quaternion.copy(t.quaternion);
  15744. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15745. l.copy(this.discWorldPosition).project(t),
  15746. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15747. h.set(o / 2, 0, 0).add(c),
  15748. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15749. p.copy(u).unproject(t);
  15750. var a = p.distanceTo(this.discWorldPosition)
  15751. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15752. this.discScale = a * s,
  15753. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15754. }
  15755. }
  15756. ),
  15757. d.prototype.getDiscRadius = (i = new f.Vector3,
  15758. function(e, t) {
  15759. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15760. Math.abs(e.x - i.x) * $("#player").width()
  15761. }
  15762. ),
  15763. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15764. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15765. }
  15766. ,
  15767. d.prototype.offScreen = function(e, t) {
  15768. var i = e.getWorldPosition().project(t);
  15769. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15770. }
  15771. ,
  15772. d.viewportScale = function() {
  15773. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15774. d.viewportHeight = $("#player").height(),
  15775. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15776. d.currentViewportScale
  15777. }
  15778. ,
  15779. R.exports = d
  15780. }
  15781. ).call(this, "/js/tag/tag.js")
  15782. }
  15783. , {
  15784. "../enum/Colors": 19,
  15785. "../enum/RenderLayers": 41,
  15786. "../enum/RenderOrder": 42,
  15787. "../enum/Viewmode": 51,
  15788. "../objects/Panorama": 148,
  15789. "../settings": 166,
  15790. "../shaders": 167,
  15791. "../util/common": 185,
  15792. "../util/easing": 186,
  15793. "../util/lerp": 188,
  15794. "../util/logger": 189,
  15795. "../util/math": 190,
  15796. "../util/texture": 194,
  15797. "../util/transitions": 195,
  15798. "./Billboard/Billboard": 119,
  15799. "./Billboard/BillboardEvent": 120,
  15800. events: 202,
  15801. three: 217
  15802. }],
  15803. 124: [function(M, R, e) {
  15804. (function(e) {
  15805. "use strict";
  15806. function t() {
  15807. this.tagState = T.IDLE,
  15808. this.intersectTag = null,
  15809. this.hoveredTag = null,
  15810. this.activeTag = null,
  15811. this.tagDiscs = [],
  15812. this.raycaster = new i.Raycaster,
  15813. this.modelManager = null,
  15814. this.player = null,
  15815. this.totaltags = 0,
  15816. this.navigatingViaTag = !1,
  15817. this.enabled = !1
  15818. }
  15819. var o, h, u, d, p, f, s, l, c, i = M("three"), n = M("../util/logger"), r = M("../util/common"), a = M("../controls/serializer"), g = M("../objects/Snapshot"), m = M("../settings"), v = M("./Billboard/BillboardEvent"), y = M("./Media/MediaEvent"), A = M("./Media/LinkType"), C = M("../enum/Viewmode"), I = M("../enum/WarpStyle"), E = M("../enum/BlackoutStyle"), _ = M("../enum/ModelManagerEvents"), b = M("../enum/tagEvents"), w = M("../enum/PlayerEvents"), T = (M("../util/lerp"),
  15820. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15821. r.extend(t, x),
  15822. t.prototype.init = function(e, t) {
  15823. this.modelManager = e,
  15824. this.player = t,
  15825. this.updateModel(),
  15826. this.bindEvents()
  15827. }
  15828. ,
  15829. t.prototype.update = function(e) {
  15830. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15831. }
  15832. ,
  15833. t.prototype.updateTags = function(e, t, i, n) {
  15834. for (var r in this.model.tags)
  15835. this.model.tags[r].update(e, t, i, n)
  15836. }
  15837. ,
  15838. t.prototype.updateModel = function() {
  15839. this.model = this.modelManager.getActiveModel(),
  15840. this.gettagsFromModel(),
  15841. this.totaltags = Object.keys(this.model.tags).length
  15842. }
  15843. ,
  15844. t.prototype.gettagsFromModel = function() {
  15845. for (var e in this.tagDiscs = [],
  15846. this.model.tags) {
  15847. var t = this.model.tags[e].disc;
  15848. t && this.tagDiscs.push(t)
  15849. }
  15850. }
  15851. ,
  15852. t.prototype.bindEvents = function() {
  15853. function e() {
  15854. Object.keys(this.model.tags).forEach(function(e) {
  15855. var t = this.model.tags[e];
  15856. t.bindEvents(),
  15857. t.billboard.on(y.LINK_CLICK, function(e) {
  15858. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15859. }
  15860. .bind(this)),
  15861. t.billboard.on(y.IMAGE_OPENED, function() {
  15862. this.tagState = T.EXAMINE,
  15863. this.emit(y.IMAGE_OPENED)
  15864. }
  15865. .bind(this)),
  15866. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15867. }
  15868. .bind(this))
  15869. }
  15870. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15871. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15872. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15873. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15874. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15875. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15876. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15877. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15878. e.call(this)
  15879. }
  15880. ,
  15881. t.prototype.navigateViaLink = function(e) {
  15882. var t = a.deserialize(e);
  15883. if (t)
  15884. if (t.mode === C.PANORAMA) {
  15885. try {
  15886. this.player.model.panos.get(t.panoId)
  15887. } catch (e) {
  15888. return void S.warn("Unable to find panorama location", t.panoId)
  15889. }
  15890. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15891. } else {
  15892. var i = {
  15893. cameraMode: t.mode,
  15894. position: t.position,
  15895. quaternion: t.quaternion,
  15896. scanId: t.panoId,
  15897. orthoZoom: t.zoom,
  15898. floorVisibility: t.floorVisibility,
  15899. thumbUrl: null,
  15900. name: null
  15901. };
  15902. this.player.flyToNewMode({
  15903. mode: t.mode,
  15904. duration: m.warp.outsideTime,
  15905. warpDest: new g(i),
  15906. force: !0
  15907. })
  15908. }
  15909. }
  15910. ,
  15911. t.prototype.handleWarpStart = function(e, t, i, n) {
  15912. this.dismissExaminedTag(),
  15913. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15914. e && (i = E.END),
  15915. this.hideShowTagsForBlackoutStyle(i, n))
  15916. }
  15917. ,
  15918. t.prototype.handleWarpInterruption = function(e, t, i) {
  15919. null != i || (i = m.warp.teleportTime),
  15920. this.hideShowTagsForBlackoutStyle(t, i)
  15921. }
  15922. ,
  15923. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15924. var i = 0
  15925. , n = 0
  15926. , r = t / 2;
  15927. switch (null != e || (e = E.MIDDLE),
  15928. e) {
  15929. case E.END:
  15930. this.hideAlltags(r);
  15931. break;
  15932. case E.BEGINNING:
  15933. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15934. break;
  15935. case E.NONE:
  15936. break;
  15937. case E.MIDDLE:
  15938. n = i = r,
  15939. this.hideAlltags(n),
  15940. setTimeout(function() {
  15941. this.showAlltags(i)
  15942. }
  15943. .bind(this), n);
  15944. break;
  15945. case E.FADEIN:
  15946. setTimeout(function() {
  15947. this.showAlltags(r)
  15948. }
  15949. .bind(this), r)
  15950. }
  15951. }
  15952. ,
  15953. t.prototype.onPlayerModeChanging = function(e, t) {
  15954. t !== C.PANORAMA && this.dismissExaminedTag(),
  15955. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15956. var i = t !== C.OUTDOOR;
  15957. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15958. }
  15959. ,
  15960. t.prototype.onPanoChange = function(e, t) {
  15961. var i = this.navigatingViaTag;
  15962. if (this.navigatingViaTag = !1,
  15963. !i) {
  15964. this.dismissExaminedTag();
  15965. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15966. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15967. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15968. }
  15969. }
  15970. ,
  15971. t.prototype.onPlayerReady = function(e, t, i) {
  15972. this.startAlltags(e, t ? i : null)
  15973. }
  15974. ,
  15975. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15976. this.updateClosestTags(e)
  15977. }
  15978. ,
  15979. t.prototype.dismissExaminedTag = function() {
  15980. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15981. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15982. this.hoveredTag = null)
  15983. }
  15984. ,
  15985. t.prototype.startAlltags = function(e, t) {
  15986. this.model.shouldShowtags = m.tags.enabled,
  15987. this.enabled = !0,
  15988. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15989. t && setTimeout(function() {
  15990. this.activateTag(this.model.getTagBySid(t))
  15991. }
  15992. .bind(this), m.tags.startup.fadeInDuration / 2))
  15993. }
  15994. ,
  15995. t.prototype.showAlltags = function(e, t, i) {
  15996. function n() {
  15997. ++o === this.totaltags && (this.model.tagsShown = !0,
  15998. r.resolve())
  15999. }
  16000. var r = $.Deferred();
  16001. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  16002. return r.resolve().promise();
  16003. var o = 0;
  16004. for (var a in this.model.tags) {
  16005. this.model.tags[a].show(e, t).done(n.bind(this))
  16006. }
  16007. return r.promise()
  16008. }
  16009. ,
  16010. t.prototype.hideAlltags = function(e, t) {
  16011. function i() {
  16012. ++r === this.totaltags && (this.model.tagsShown = !1,
  16013. n.resolve())
  16014. }
  16015. var n = $.Deferred()
  16016. , r = 0;
  16017. for (var o in this.model.tags) {
  16018. var a = this.model.tags[o];
  16019. a.hide(e, t).done(i.bind(this)),
  16020. a === this.activeTag && this.dismissActiveTag()
  16021. }
  16022. return n.promise()
  16023. }
  16024. ,
  16025. t.prototype.enableHovering = function() {
  16026. this.enabled = !0
  16027. }
  16028. ,
  16029. t.prototype.disableHovering = function() {
  16030. this.enabled = !1
  16031. }
  16032. ,
  16033. t.prototype.activateTag = function(e, t) {
  16034. t = t || T.EXAMINE,
  16035. this.activeTag = e,
  16036. this.activeTag.hoveringDisc = !0,
  16037. this.activeTag.setHoverState(t === T.EXAMINE),
  16038. this.tagState = t,
  16039. this.emit(b.TagActivated, e)
  16040. }
  16041. ,
  16042. t.prototype.dismissActiveTag = function() {
  16043. this.activeTag.hoveringDisc = !1,
  16044. this.activeTag.setFreeState(!0);
  16045. var e = this.activeTag;
  16046. this.activeTag = null,
  16047. this.tagState = T.IDLE,
  16048. this.emit(b.TagDismissed, e)
  16049. }
  16050. ,
  16051. t.prototype.clickedOnTag = function(e) {
  16052. var t = function() {
  16053. this.navigatingViaTag = !0,
  16054. this.activeTag.examine(this.player),
  16055. this.emit(b.TagNavigation, this.activeTag)
  16056. }
  16057. .bind(this);
  16058. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  16059. this.activeTag = this.intersectTag,
  16060. t(),
  16061. !0) : (this.dismissActiveTag(),
  16062. !1)
  16063. }
  16064. ,
  16065. t.prototype.intersecttag = (s = new i.Vector3,
  16066. l = new i.Vector3,
  16067. c = new i.Vector3,
  16068. function(e, t, i) {
  16069. if (!this.enabled)
  16070. return null;
  16071. var n = null
  16072. , r = this.tagDiscs.filter(function(e) {
  16073. return e.parent.visible
  16074. });
  16075. if (0 < r.length) {
  16076. var o = this.model.floors.reduce(function(e, t) {
  16077. return t.hidden ? e : e.concat(t.collider.children)
  16078. }, r);
  16079. s.set(e.x, e.y, -1).unproject(i),
  16080. l.set(e.x, e.y, 1).unproject(i),
  16081. c.copy(l).sub(s).normalize(),
  16082. this.raycaster.set(s, c);
  16083. var a = this.raycaster.intersectObjects(o);
  16084. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  16085. }
  16086. return this.intersectTag = n,
  16087. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  16088. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  16089. this.hoveredTag = n
  16090. }
  16091. .bind(this)),
  16092. n.billboard.on(v.LEAVE, function() {
  16093. this.hoveredTag = null
  16094. }
  16095. .bind(this))),
  16096. this.activateTag(n, T.BROWSE))),
  16097. n
  16098. }
  16099. ),
  16100. t.prototype.rankedtagInDirection = (h = [],
  16101. u = [],
  16102. d = new i.Vector3,
  16103. p = new i.Vector3,
  16104. f = new i.Vector3,
  16105. function(e, t, i, n) {
  16106. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  16107. var a = this.closesttags[o];
  16108. p.copy(a.position),
  16109. p.add(a.discPosition),
  16110. d.copy(t),
  16111. d.sub(p).negate(),
  16112. d.normalize();
  16113. var s = d.dot(n);
  16114. if (0 <= s && (f.copy(p),
  16115. f.project(i),
  16116. this.intersecttag(f, !1, i))) {
  16117. if (r >= h.length)
  16118. for (var l = 0; l < 64; l++)
  16119. h.push({
  16120. tag: a,
  16121. dot: s
  16122. });
  16123. var c = h[r];
  16124. c.tag = a,
  16125. c.dot = s,
  16126. c.position = math.projectPositionToCanvas(p, i),
  16127. u.push(c),
  16128. r++
  16129. }
  16130. }
  16131. return u.sort(function(e, t) {
  16132. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16133. }),
  16134. e < u.length ? u[e].tag : null
  16135. }
  16136. ),
  16137. t.prototype.updateClosestTags = (o = new i.Vector3,
  16138. function(e) {
  16139. this.closesttags || (this.closesttags = []),
  16140. this.closesttags.length = 0;
  16141. var t = this.model.tags;
  16142. if (t)
  16143. for (var i in t)
  16144. if (t.hasOwnProperty(i)) {
  16145. var n = t[i]
  16146. , r = n.position;
  16147. o.copy(e),
  16148. o.sub(r).negate(),
  16149. o.lengthSq() < 30 && this.closesttags.push(n)
  16150. }
  16151. }
  16152. ),
  16153. R.exports = t
  16154. }
  16155. ).call(this, "/js/tag/tagManager.js")
  16156. }
  16157. , {
  16158. "../controls/serializer": 14,
  16159. "../enum/BlackoutStyle": 18,
  16160. "../enum/tagEvents": 32,
  16161. "../enum/ModelManagerEvents": 33,
  16162. "../enum/PlayerEvents": 40,
  16163. "../enum/TagStates": 44,
  16164. "../enum/Viewmode": 51,
  16165. "../enum/WarpStyle": 52,
  16166. "../objects/Snapshot": 153,
  16167. "../settings": 166,
  16168. "../util/common": 185,
  16169. "../util/lerp": 188,
  16170. "../util/logger": 189,
  16171. "./Billboard/BillboardEvent": 120,
  16172. "./Media/LinkType": 130,
  16173. "./Media/MediaEvent": 131,
  16174. events: 202,
  16175. three: 217
  16176. }],
  16177. 125: [function(r, o, e) {
  16178. (function(e) {
  16179. "use strict";
  16180. function t() {
  16181. this.embedWrapper = null,
  16182. this.embedElement = null
  16183. }
  16184. var i = r("../../util/ajax")
  16185. , a = r("./mediaSettings")
  16186. , n = r("../../settings")
  16187. , s = new (r("../../util/logger"))(e);
  16188. t.prototype.createDomElement = function() {
  16189. return this.embedWrapper = document.createElement("div"),
  16190. this.embedWrapper.classList.add("tag-embed"),
  16191. this.embedWrapper.classList.add("hidden"),
  16192. this.embedWrapper
  16193. }
  16194. ,
  16195. t.prototype.load = function(e) {
  16196. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  16197. return new Promise(function(r, o) {
  16198. i.get(t).then(function(e) {
  16199. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  16200. this.embedWrapper.innerHTML = e.html;
  16201. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  16202. if (this.embedWrapper.style.width = t + "px",
  16203. e.height) {
  16204. var i = e.height / e.width;
  16205. this.embedWrapper.style.height = t * i + "px"
  16206. }
  16207. this.embedElement = this.embedWrapper.firstChild;
  16208. var n = [];
  16209. try {
  16210. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  16211. } catch (e) {
  16212. s.debug("Error getting `a` elements for embed; was it an iframe?")
  16213. }
  16214. n.forEach(function(e) {
  16215. e.setAttribute("target", "_blank")
  16216. }),
  16217. this.embedElement.classList.add("hidden"),
  16218. this.embedWrapper.classList.remove("hidden"),
  16219. r()
  16220. } else
  16221. o("Not a valid embed")
  16222. }
  16223. .bind(this), function(e) {
  16224. o(e.response)
  16225. })
  16226. }
  16227. .bind(this))
  16228. }
  16229. ,
  16230. t.prototype.show = function() {
  16231. this.embedElement && this.embedElement.classList.remove("hidden")
  16232. }
  16233. ,
  16234. t.prototype.hide = function() {
  16235. this.embedElement && this.embedElement.classList.add("hidden")
  16236. }
  16237. ,
  16238. o.exports = t
  16239. }
  16240. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16241. }
  16242. , {
  16243. "../../settings": 166,
  16244. "../../util/ajax": 181,
  16245. "../../util/logger": 189,
  16246. "./mediaSettings": 132
  16247. }],
  16248. 126: [function(a, s, e) {
  16249. (function(e) {
  16250. "use strict";
  16251. function t(e) {
  16252. r.call(this),
  16253. this.options = e,
  16254. this.playerControls = null,
  16255. this.state = o.NOT_READY
  16256. }
  16257. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  16258. Object.freeze({
  16259. NOT_READY: "player.not.ready",
  16260. CUED: "player.cued",
  16261. PLAYING: "player.playing",
  16262. PAUSED: "player.paused"
  16263. }));
  16264. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  16265. return this.embedWrapper = document.createElement("div"),
  16266. this.embedWrapper.classList.add("tag-video"),
  16267. this.embedWrapper.classList.add("hidden"),
  16268. this.embedWrapper
  16269. }
  16270. ,
  16271. t.prototype.load = function(e) {
  16272. var t = function() {
  16273. function e(e) {
  16274. this.playerState = e
  16275. }
  16276. this.playerControls = new playerjs.Player(this.embedElement),
  16277. this.playerControls.on("ready", function(e) {
  16278. this.playerState = o.CUED,
  16279. this.options.startMuted && this.playerControls.mute()
  16280. }
  16281. .bind(this)),
  16282. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  16283. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  16284. this.playerControls.on("ended", function(e) {
  16285. this.playerControls.setCurrentTime(0),
  16286. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16287. }
  16288. .bind(this))
  16289. }
  16290. .bind(this);
  16291. return r.prototype.load.call(this, e).then(t.bind(this))
  16292. }
  16293. ,
  16294. t.prototype.play = (i = n.isMobile(),
  16295. function() {
  16296. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16297. }
  16298. ),
  16299. t.prototype.pause = function() {
  16300. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  16301. }
  16302. ,
  16303. s.exports = t
  16304. }
  16305. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16306. }
  16307. , {
  16308. "../../util/browser": 182,
  16309. "../../util/logger": 189,
  16310. "./EmbedlyEmbed": 125
  16311. }],
  16312. 127: [function(t, i, e) {
  16313. (function(e) {
  16314. "use strict";
  16315. var r = t("../../util/ajax")
  16316. , o = new (t("./mediaSettings"),
  16317. t("../../util/logger"))(e)
  16318. , a = Promise.resolve();
  16319. i.exports.enqueue = function(i) {
  16320. function n() {}
  16321. return a = new Promise(function(e, t) {
  16322. a.catch(n).then(function() {
  16323. (o.debug("requesting file from embedly:", i.href),
  16324. r.get(i.href, {
  16325. responseType: i.responseType
  16326. }).then(function(e) {
  16327. return o.debug("requesting file finished:", i.href),
  16328. e
  16329. })).then(e, t)
  16330. })
  16331. }
  16332. )
  16333. }
  16334. }
  16335. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16336. }
  16337. , {
  16338. "../../util/ajax": 181,
  16339. "../../util/logger": 189,
  16340. "./mediaSettings": 132
  16341. }],
  16342. 128: [function(s, l, e) {
  16343. (function(e) {
  16344. "use strict";
  16345. function t() {
  16346. this.imageWrapper = null,
  16347. this.width = 0,
  16348. this.height = 0,
  16349. this.aspect = 1
  16350. }
  16351. var i = s("./MediaEvent")
  16352. , n = s("./EmbedlyQueue")
  16353. , r = s("events").EventEmitter
  16354. , o = s("../../util/logger")
  16355. , a = s("../../settings");
  16356. new o(e),
  16357. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  16358. return this.imageWrapper = document.createElement("div"),
  16359. this.imageWrapper.classList.add("tag-image"),
  16360. this.imageWrapper.classList.add("hidden"),
  16361. this.imageWrapper.addEventListener("click", function(e) {
  16362. e.stopPropagation(),
  16363. this.emit(i.IMAGE_OPENING),
  16364. this.imageWrapper.style.pointerEvents = "none"
  16365. }
  16366. .bind(this)),
  16367. this.imageWrapper
  16368. }
  16369. ,
  16370. t.prototype.onClosed = function() {
  16371. this.imageWrapper.style.pointerEvents = "auto"
  16372. }
  16373. ,
  16374. t.prototype.load = function(e) {
  16375. var t = Math.max(window.screen.height, window.screen.width)
  16376. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16377. return new Promise(function(o, e) {
  16378. n.enqueue({
  16379. href: i,
  16380. responseType: "arraybuffer"
  16381. }).then(function(e) {
  16382. var t = new Uint8Array(e)
  16383. , i = new Blob([t])
  16384. , n = new window.Image;
  16385. n.addEventListener("load", function(e) {
  16386. var t = e.target;
  16387. this.width = t.naturalWidth,
  16388. this.height = t.naturalHeight,
  16389. this.aspect = this.width / this.height;
  16390. var i = e.target.src;
  16391. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  16392. this.imageWrapper.style.width = this.width + "px",
  16393. this.imageWrapper.style.height = this.height + "px",
  16394. this.imageWrapper.classList.remove("hidden"),
  16395. o()
  16396. }
  16397. .bind(this));
  16398. var r = URL.createObjectURL(i);
  16399. n.src = r
  16400. }
  16401. .bind(this), e)
  16402. }
  16403. .bind(this))
  16404. }
  16405. ,
  16406. l.exports = t
  16407. }
  16408. ).call(this, "/js/tag/Media/Image.js")
  16409. }
  16410. , {
  16411. "../../settings": 166,
  16412. "../../util/logger": 189,
  16413. "./EmbedlyQueue": 127,
  16414. "./MediaEvent": 131,
  16415. events: 202
  16416. }],
  16417. 129: [function(e, t, i) {
  16418. "use strict";
  16419. function n(e) {
  16420. this.label = e.label,
  16421. this.href = e.url,
  16422. this.type = this.updateLinkForType(),
  16423. this.domElement = null,
  16424. this.id = c++
  16425. }
  16426. var r = e("./LinkType")
  16427. , o = e("./MediaEvent")
  16428. , a = e("../../util/browser")
  16429. , s = e("../../analytics")
  16430. , l = e("events").EventEmitter
  16431. , c = 0;
  16432. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  16433. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  16434. return -1 !== this.href.indexOf("port.com/show") || -1 !== this.href.indexOf(window.location.host + "/show") ? -1 !== this.href.indexOf(t) && -1 !== this.href.indexOf("start=") ? (this.href = (e = this.href,
  16435. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  16436. r.NAVIGATION) : (this.href = this.href + "&play=1",
  16437. r.MODEL) : r.EXT_LINK
  16438. }
  16439. ;
  16440. var h = {};
  16441. n.prototype.createDomElement = function() {
  16442. if (this.domElement = document.createElement("a"),
  16443. this.domElement.classList.add("tag-link"),
  16444. this.domElement.textContent = this.label,
  16445. this.type === r.EXT_LINK) {
  16446. this.domElement.textContent += " ";
  16447. var e = document.createElement("i");
  16448. e.classList.add("icon-ext-link"),
  16449. e.title = "Link to external web site",
  16450. this.domElement.appendChild(e)
  16451. }
  16452. return this.domElement.addEventListener("click", function(e) {
  16453. switch (e.stopPropagation(),
  16454. h[this.id] = !0,
  16455. s.trackAlways("click_tag_link", {
  16456. link_type: this.type,
  16457. link_count: c,
  16458. links_clicked: Object.keys(h).length
  16459. }),
  16460. this.type) {
  16461. case r.MODEL:
  16462. window.location.replace(this.href);
  16463. break;
  16464. case r.EXT_LINK:
  16465. window.open(this.href, "_blank")
  16466. }
  16467. this.emit(o.LINK_CLICK, {
  16468. type: this.type,
  16469. url: this.href
  16470. })
  16471. }
  16472. .bind(this)),
  16473. this.domElement
  16474. }
  16475. ,
  16476. t.exports = n
  16477. }
  16478. , {
  16479. "../../analytics": 4,
  16480. "../../util/browser": 182,
  16481. "./LinkType": 130,
  16482. "./MediaEvent": 131,
  16483. events: 202
  16484. }],
  16485. 130: [function(e, t, i) {
  16486. "use strict";
  16487. t.exports = {
  16488. NAVIGATION: "navigation",
  16489. MODEL: "model",
  16490. EXT_LINK: "ext-link"
  16491. }
  16492. }
  16493. , {}],
  16494. 131: [function(e, t, i) {
  16495. "use strict";
  16496. t.exports = Object.freeze({
  16497. LINK_CLICK: "mtmedia.link",
  16498. IMAGE_LOADED: "mtmedia.image.loaded",
  16499. IMAGE_OPENING: "mtmedia.image.opening",
  16500. IMAGE_OPENED: "mtmedia.image.opened",
  16501. IMAGE_CLOSING: "mtmedia.image.closing",
  16502. IMAGE_CLOSED: "mtmedia.image.closed",
  16503. VIDEO_START: "mtmedia.video.start",
  16504. VIDEO_PAUSE: "mtmedia.video.pause",
  16505. VIDEO_ENDED: "mtmedia.video.end"
  16506. })
  16507. }
  16508. , {}],
  16509. 132: [function(e, t, i) {
  16510. "use strict";
  16511. t.exports = Object.freeze({
  16512. maxEmbedWidth: 350,
  16513. defaultAspectRatio: .75
  16514. })
  16515. }
  16516. , {}],
  16517. 133: [function(e, t, i) {
  16518. "use strict";
  16519. t.exports = Object.freeze({
  16520. TEXT: "text",
  16521. LINK: "link",
  16522. IMAGE: "photo",
  16523. VIDEO: "video",
  16524. RICH: "rich"
  16525. })
  16526. }
  16527. , {}],
  16528. 134: [function(e, t, i) {
  16529. "use strict";
  16530. function n(e) {
  16531. this.capabilities = {
  16532. links: {
  16533. enable: e.supportLinks,
  16534. keepLabels: e.keepLinkLabels
  16535. }
  16536. }
  16537. }
  16538. var r = e("./DescriptionChunkType");
  16539. n.prototype.parse = function(e, i) {
  16540. var n = [];
  16541. return e.split("[").map(function(e, t) {
  16542. return 0 === t ? e : "[" + e
  16543. }).forEach(function(e) {
  16544. var t = this.findMarkdown(e);
  16545. if (t) {
  16546. if (-1 !== t.url.indexOf("javascript:"))
  16547. return;
  16548. this.addLinkChunk(n, t, i),
  16549. this.addTextChunk(n, e.slice(t.markdown.length))
  16550. } else
  16551. this.addTextChunk(n, e)
  16552. }
  16553. .bind(this)),
  16554. n
  16555. }
  16556. ,
  16557. n.prototype.findMarkdown = function(e) {
  16558. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16559. if (t) {
  16560. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16561. 0 !== n); )
  16562. r++;
  16563. var o = i.length - r;
  16564. return {
  16565. markdown: t[0].substring(0, t[0].length - o),
  16566. label: t[1],
  16567. url: t[2].substring(0, r)
  16568. }
  16569. }
  16570. }
  16571. ,
  16572. n.prototype.addTextChunk = function(e, t) {
  16573. 0 !== t.length && e.push({
  16574. type: r.TEXT,
  16575. text: t
  16576. })
  16577. }
  16578. ,
  16579. n.prototype.addLinkChunk = function(e, t) {
  16580. if (this.capabilities.links.enable) {
  16581. var i = {
  16582. label: t.label,
  16583. url: t.url
  16584. };
  16585. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16586. e.push({
  16587. type: r.LINK,
  16588. link: i
  16589. })
  16590. } else
  16591. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16592. }
  16593. ,
  16594. t.exports = n
  16595. }
  16596. , {
  16597. "./DescriptionChunkType": 133
  16598. }],
  16599. 135: [function(t, r, e) {
  16600. (function(e) {
  16601. "use strict";
  16602. var i = new (t("../util/logger"))(e)
  16603. , n = {
  16604. parseIdsFromChunkName: function(e, t) {
  16605. t.floorId = n.parseFloor(e),
  16606. t.roomId = n.parseRoom(e)
  16607. },
  16608. parseFloor: function(e) {
  16609. var t = e.match(/_group([0-9]+)/);
  16610. if (!t)
  16611. return 0;
  16612. try {
  16613. return parseInt(t[1], 10)
  16614. } catch (e) {
  16615. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16616. 0
  16617. }
  16618. },
  16619. parseRoom: function(e) {
  16620. var t = e.match(/_sub([0-9]+)/);
  16621. if (!t)
  16622. return -1;
  16623. try {
  16624. return parseInt(t[1], 10)
  16625. } catch (e) {
  16626. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16627. 0
  16628. }
  16629. }
  16630. };
  16631. r.exports = n
  16632. }
  16633. ).call(this, "/js/model/Chunks.js")
  16634. }
  16635. , {
  16636. "../util/logger": 189
  16637. }],
  16638. 136: [function(a, c, e) {
  16639. (function(e) {
  16640. "use strict";
  16641. function t(e) {
  16642. r.call(this),
  16643. this.model = e,
  16644. this.exploded = !1
  16645. }
  16646. var i = a("../objects/Floor")
  16647. , n = (a("../settings"),
  16648. a("../util/logger"))
  16649. , s = a("../util/transitions")
  16650. , r = a("../util/IndexedCollection")
  16651. , o = a("../util/common")
  16652. , l = a("../util/easing");
  16653. new n(e),
  16654. o.inherit(t, r),
  16655. t.prototype.add = function(e) {
  16656. r.prototype.add.call(this, e),
  16657. this.model.add(e)
  16658. }
  16659. ,
  16660. t.prototype.getIndex = function(e) {
  16661. return e.floorIndex
  16662. }
  16663. ,
  16664. t.prototype.build = function() {
  16665. this.list.forEach(function(e) {
  16666. e.build()
  16667. })
  16668. }
  16669. ,
  16670. t.prototype.size = function() {
  16671. return this.length
  16672. }
  16673. ,
  16674. t.prototype.sort = function() {
  16675. r.prototype.sort.call(this, function(e, t) {
  16676. return e.floorIndex - t.floorIndex
  16677. })
  16678. }
  16679. ,
  16680. t.prototype.nextFloor = function(e, t) {
  16681. return this.index[e.floorIndex + t] || null
  16682. }
  16683. ,
  16684. t.prototype.getFloorAtPoint = function(e) {
  16685. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16686. var r = this.list[n]
  16687. , o = r.distanceToPoint(e);
  16688. (!t || o < i) && (i = o,
  16689. t = r)
  16690. }
  16691. return t
  16692. }
  16693. ,
  16694. t.prototype.getOrMakeFloor = function(e) {
  16695. var t = this.index[e];
  16696. return t || (t = new i(this.model,e),
  16697. this.add(t)),
  16698. t
  16699. }
  16700. ,
  16701. t.prototype.hide = function() {
  16702. this.list.forEach(function(e) {
  16703. e.hide()
  16704. })
  16705. }
  16706. ,
  16707. t.prototype.show = function() {
  16708. this.list.forEach(function(e) {
  16709. e.show()
  16710. })
  16711. }
  16712. ,
  16713. t.prototype.names = function() {
  16714. return this.list.reduce(function(e, t) {
  16715. return e.concat(t.name)
  16716. }, [])
  16717. }
  16718. ,
  16719. t.prototype.toggleExplodeHorizontal = function() {
  16720. function i(e, t) {
  16721. a.copy(e.position),
  16722. e.position.x = r[e.floorIndex] * t,
  16723. e.position.y = 1 * e.floorIndex * t,
  16724. a.sub(e.position).multiplyScalar(-1),
  16725. e.panos.forEach(function(e) {
  16726. e.translate(a)
  16727. })
  16728. }
  16729. var n, r = [], o = 0;
  16730. this.list.forEach(function(e, t, i) {
  16731. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16732. o += n,
  16733. r[t] = o
  16734. }),
  16735. r = r.map(function(e) {
  16736. return e - o / 2
  16737. });
  16738. var a = this.list[0].position.clone();
  16739. this.exploded ? this.list.forEach(function(t) {
  16740. s.start(function(e) {
  16741. i(t, 1 - e)
  16742. }, 1500, null, 0, l.easeOutExpo)
  16743. }) : this.list.forEach(function(t) {
  16744. s.start(function(e) {
  16745. i(t, e)
  16746. }, 1500, null, 0, l.easeOutExpo)
  16747. }),
  16748. this.exploded = !this.exploded
  16749. }
  16750. ,
  16751. t.prototype.toggleExplodeVertical = function() {
  16752. function i(e, t) {
  16753. var i = i.copy(e.position);
  16754. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16755. i.sub(e.position).multiplyScalar(-1),
  16756. e.panos.forEach(function(e) {
  16757. e.translate(i)
  16758. })
  16759. }
  16760. var n = this.model.size;
  16761. this.list[0].position.clone(),
  16762. this.exploded ? this.list.forEach(function(t) {
  16763. s.start(function(e) {
  16764. i(t, 1 - e)
  16765. }, 1500, null, 0, l.easeOutExpo)
  16766. }) : this.list.forEach(function(t) {
  16767. s.start(function(e) {
  16768. i(t, e)
  16769. }, 1500, null, 0, l.easeOutExpo)
  16770. }),
  16771. this.exploded = !this.exploded
  16772. }
  16773. ,
  16774. c.exports = t
  16775. }
  16776. ).call(this, "/js/model/FloorCollection.js")
  16777. }
  16778. , {
  16779. "../objects/Floor": 146,
  16780. "../settings": 166,
  16781. "../util/IndexedCollection": 175,
  16782. "../util/common": 185,
  16783. "../util/easing": 186,
  16784. "../util/logger": 189,
  16785. "../util/transitions": 195
  16786. }],
  16787. 137: [function(r, o, e) {
  16788. (function(e) {
  16789. "use strict";
  16790. function h() {
  16791. n.call(this)
  16792. }
  16793. var u = r("../settings")
  16794. , t = r("../util/logger")
  16795. , d = r("../enum/Viewmode")
  16796. , p = r("../objects/Snapshot")
  16797. , i = (r("../util/math"),
  16798. r("../util/common"))
  16799. , n = r("../util/IndexedCollection")
  16800. , l = new t(e);
  16801. i.inherit(h, n),
  16802. h.prototype.getImage = function(e) {
  16803. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16804. }
  16805. ,
  16806. h.prototype.filterByModesAndReel = function(e, t) {
  16807. for (var i = [], n = 0; n < t.length; n += 1) {
  16808. var r = t[n]
  16809. , o = this.index[r.sid];
  16810. o && i.push(o)
  16811. }
  16812. var a = e[d.DOLLHOUSE]
  16813. , s = e[d.FLOORPLAN];
  16814. (i = i.filter(function(e) {
  16815. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16816. return !0;
  16817. var t;
  16818. try {
  16819. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16820. } catch (e) {
  16821. return l.debug(e.message),
  16822. !1
  16823. }
  16824. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16825. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16826. this.list = i,
  16827. this.reIndex()
  16828. }
  16829. ,
  16830. h.prototype.getHeroLocations = function(panos) {//改 增加二级location
  16831. if (0 === this.list.length)
  16832. return [];
  16833. var locations = [];
  16834. var deal = (n, container)=>{
  16835. var r = n.thumbnail_signed_src,
  16836. o = n.name || "";
  16837. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16838. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16839. var a = panos.get(n.metadata.scan_id);
  16840. if (a && !a.isAligned()) return
  16841. }
  16842. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16843. if (s === d.MESH) return
  16844. if(window.isLocal)var src = manage.dealURL(r)
  16845. else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
  16846. var l = {
  16847. cameraMode: s,
  16848. position: n.metadata.camera_position,
  16849. quaternion: n.metadata.camera_quaternion,
  16850. zoom: n.metadata.zoom,
  16851. panoId: n.metadata.scan_id,
  16852. orthoZoom: n.metadata.ortho_zoom,
  16853. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16854. thumbUrl: src,
  16855. name: h.filterImageName(o),
  16856. sid: n.sid
  16857. }
  16858. var item = new p(l);
  16859. item.momentTour = n.momentTour
  16860. container.push(item)
  16861. return item
  16862. }
  16863. }
  16864. this.list.forEach(image=>{
  16865. if(image.images){
  16866. var folder = $.extend({}, image )
  16867. folder.heroLocations = [];
  16868. image.images.list.forEach(child=>{
  16869. deal(child, folder.heroLocations);
  16870. })
  16871. folder.musicInfo = folder.musicInfo || {}
  16872. locations.push(folder)
  16873. delete folder.images;
  16874. delete folder.locations;
  16875. }else{
  16876. var item = deal(image, locations);
  16877. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16878. }
  16879. })
  16880. return locations
  16881. }
  16882. ,
  16883. h.prototype.getIndex = function(e) {
  16884. return e.sid
  16885. }
  16886. ,
  16887. h.filterImageName = function(e) {
  16888. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16889. }
  16890. ,
  16891. o.exports = h
  16892. }
  16893. ).call(this, "/js/model/ImageCollection.js")
  16894. }
  16895. , {
  16896. "../enum/Viewmode": 51,
  16897. "../objects/Snapshot": 153,
  16898. "../settings": 166,
  16899. "../util/IndexedCollection": 175,
  16900. "../util/common": 185,
  16901. "../util/logger": 189,
  16902. "../util/math": 190
  16903. }],
  16904. 138: [function(h, u, e) {
  16905. (function(e) {
  16906. "use strict";
  16907. function n() {
  16908. c.call(this)
  16909. }
  16910. var r = h("../label/Label")
  16911. , i = h("../settings")
  16912. , t = h("../util/logger")
  16913. , o = h("../util/math")
  16914. , a = h("../util/ajax")
  16915. , s = h("./RoomCollection")
  16916. , l = h("../util/common")
  16917. , c = h("../util/IndexedCollection");
  16918. new t(e),
  16919. l.inherit(n, c),
  16920. n.prototype.getIndex = function(e) {
  16921. return e.labelId
  16922. }
  16923. ,
  16924. n.prototype.associateWithRooms = function(e) {
  16925. this.forEach(function(t) {
  16926. e.forEach(function(e) {
  16927. e.roomId === t.roomId && (t.room = e)
  16928. })
  16929. })
  16930. }
  16931. ,
  16932. n.prototype.createFromLabelData = function(e) {
  16933. e.forEach(function(e) {
  16934. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16935. t = s.generateRoomId(e.floorId, t);
  16936. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16937. i.position = o.convertWorkshopVector(i.position),
  16938. this.add(i),
  16939. i.build()
  16940. }
  16941. .bind(this))
  16942. }
  16943. ,
  16944. n.prototype.load = function(e, t) {
  16945. return a.get(e, {
  16946. responseType: "json",
  16947. auth: t ? i.authorizationHeader : null
  16948. }).done(function(e) {
  16949. var t = [];
  16950. for (var i in e) {
  16951. var n = e[i];
  16952. t.push(n)
  16953. }
  16954. this.createFromLabelData(t)
  16955. }
  16956. .bind(this))
  16957. }
  16958. ,
  16959. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16960. var t = -1;
  16961. if (e) {
  16962. if(typeof e == 'number'){
  16963. t = parseInt(e)
  16964. }else{
  16965. var i = e.split("_");
  16966. t = parseInt(i[0])
  16967. }
  16968. }
  16969. return t
  16970. }
  16971. ,
  16972. u.exports = n
  16973. }
  16974. ).call(this, "/js/model/LabelCollection.js")
  16975. }
  16976. , {
  16977. "../label/Label": 90,
  16978. "../settings": 166,
  16979. "../util/IndexedCollection": 175,
  16980. "../util/ajax": 181,
  16981. "../util/common": 185,
  16982. "../util/logger": 189,
  16983. "../util/math": 190,
  16984. "./RoomCollection": 141
  16985. }],
  16986. 139: [function(P, O, e) {
  16987. (function(e) {
  16988. "use strict";
  16989. function t(e, t) {
  16990. o.Object3D.call(this),
  16991. this.sid = window.number;//t.sid,
  16992. this.data = t,
  16993. this.options = e,
  16994. this.urls = new i(e.urlFiles),
  16995. this.isPublic = void 0 !== t.is_public && t.is_public,
  16996. //创建heroLocations
  16997. this.images = new E(this),
  16998. this.images.extend(t.images),
  16999. this.images.forEach((info)=>{
  17000. if(info.locations){
  17001. info.images = new E(this);
  17002. info.images.extend(info.locations)
  17003. }
  17004. })
  17005. this.heroLocations = []
  17006. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  17007. this.outdoorPanoLocations = [],
  17008. this.floors = new c(this),
  17009. this.floorsEnabled = void 0 === e.floors || e.floors,
  17010. this.changingFloor = !1,
  17011. this.chunks = [],
  17012. this.panos = new g,
  17013. this.colliders = [],
  17014. this.loadPanosPromise = null,
  17015. this.loadMeshTexturesPromise = null,
  17016. this.auxDataPromise = null,
  17017. this.meshTexturesLoaded = !1,
  17018. this.meshTextures = [],
  17019. this.tags = {},
  17020. this.tagsShown = !1,
  17021. this.shouldShowtags = !1,
  17022. this.has360Views = !1,
  17023. this.showingLabels = u.labels.enabled && t.player_options.labels,
  17024. this.supportedModes = {},
  17025. this.supportedModes[s.PANORAMA] = !0,
  17026. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  17027. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  17028. this.supportedModes[s.TRANSITIONING] = !0,
  17029. this.supportsTiles = this.configureTiling(),
  17030. this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || false//!0,
  17031. this.mode = s.DOLLHOUSE,
  17032. this.size = null,
  17033. this.center = null,
  17034. this.boundingBox = new o.Box3,
  17035. this.currentFloor = null,
  17036. this.allFloorsVisible = !0,
  17037. this.projectedPano0 = null,
  17038. this.projectedPano1 = null,
  17039. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  17040. this.addFloor(new r(this,t,e.trim()))
  17041. }
  17042. .bind(this)),
  17043. this.waitQueue = [],
  17044. this.on("load", function(e) {
  17045. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  17046. return !e.isLoadedCallback()
  17047. }),
  17048. 0 === this.waitQueue.length && this.emit("waiting-done"))
  17049. }
  17050. .bind(this)),
  17051. this.setupCustomProperties(),
  17052. this.hots = {}
  17053. }
  17054. var o = P("three")
  17055. , a = P("../util/ajax")
  17056. , i = P("../util/ModelUrls")
  17057. , n = P("../objects/BoundingTextureSkybox")
  17058. , s = P("../enum/Viewmode")
  17059. , l = P("../enum/RenderOrder")
  17060. , r = (P("../enum/AlignmentType"),
  17061. P("../objects/Floor"))
  17062. , c = P("./FloorCollection")
  17063. , h = P("../objects/Chunk")
  17064. , u = (P("../objects/Room"),
  17065. P("../objects/Snapshot"),
  17066. P("../label/Label"),
  17067. P("../util/math"),
  17068. P("../settings"))
  17069. , d = P("../shaders")
  17070. , p = P("../util/logger")
  17071. , f = (P("../tag/tag"),
  17072. P("../tag/tagManager"),
  17073. P("../objects/Panorama"))
  17074. , g = P("../util/PanoramaCollection")
  17075. , m = P("../loaders/ModelLoader")
  17076. , v = P("../loaders/ModelTextureLoader")
  17077. , y = P("../loaders/SweepDataLoader")
  17078. , A = P("../util/transitions")
  17079. , C = (P("../util/easing"),
  17080. P("../util/lerp"),
  17081. P("../util/common"))
  17082. , I = (P("../util/texture"),
  17083. P("./../util/browser"))
  17084. , E = P("./ImageCollection")
  17085. , _ = P("./RoomCollection")
  17086. , b = P("./LabelCollection")
  17087. , w = P("./Chunks")
  17088. , T = P("./../util/showcase")
  17089. , x = P("../exception/BasicException")
  17090. , S = (P("../constants"),
  17091. P("events").EventEmitter)
  17092. , M = P("hot")
  17093. , R = new p(e);
  17094. t.prototype = Object.create(o.Object3D.prototype),
  17095. C.extend(t, S),
  17096. t.prototype.setupCustomProperties = function() {
  17097. var t = u.modelAlpha;
  17098. Object.defineProperty(this, "alpha", {
  17099. get: function() {
  17100. return t
  17101. },
  17102. set: function(e) {
  17103. t = e,
  17104. this.chunks.forEach(function(e) {
  17105. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  17106. })
  17107. }
  17108. })
  17109. }
  17110. ,
  17111. t.prototype.configureTiling = function() {
  17112. var e = function() {
  17113. try {
  17114. var e = document.createElement("canvas")
  17115. , t = e.getContext("webgl");
  17116. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  17117. } catch (e) {
  17118. return 0
  17119. }
  17120. }();
  17121. if (e < 2048)
  17122. return !1;
  17123. R.warn("Max cube texture size: " + e);
  17124. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  17125. var i = u.tiling.tilingFlagNames[t];
  17126. if ("1" === I.valueFromHash(i, null))
  17127. return !0;
  17128. if ("0" === I.valueFromHash(i, null))
  17129. return !1
  17130. }
  17131. return !!T.modelDataPromisesTiles(this.data)
  17132. }
  17133. ,
  17134. t.prototype.toggleAlpha = function() {
  17135. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  17136. }
  17137. ,
  17138. t.prototype.load = function(e) {
  17139. var t = this.urls.init().then(function() {
  17140. return $.when(this.loadPanos(), this.loadMesh())
  17141. }
  17142. .bind(this));
  17143. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  17144. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  17145. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  17146. }
  17147. ,
  17148. t.prototype.loadMesh = function() {
  17149. var n = $.Deferred()
  17150. , r = this;
  17151. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  17152. if (0 === e.length) {
  17153. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17154. r.supportedModes[s.DOLLHOUSE] = !1,
  17155. r.supportedModes[s.FLOORPLAN] = !1;
  17156. var i = new h({
  17157. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17158. });
  17159. i.material.visible = !1,
  17160. i.rotateX(-Math.PI / 2),
  17161. i.geometry.computeBoundingBox(),
  17162. e = [i]
  17163. }
  17164. e.forEach(function(e) {
  17165. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  17166. r.addChunk(t, e)
  17167. }),
  17168. r.floors.sort(),
  17169. n.resolve(r)
  17170. }, function(e, t) {
  17171. n.notify(e, t)
  17172. }, function(e) {
  17173. R.error(e),
  17174. n.reject("loading-failed")
  17175. }),
  17176. n.promise()
  17177. }
  17178. ,
  17179. t.prototype.loadMeshTextures = function() {
  17180. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  17181. this.meshTexturesLoaded = !0
  17182. }
  17183. .bind(this))),
  17184. this.loadTexturesPromise
  17185. }
  17186. ,
  17187. t.prototype.shineHots = function() {
  17188. A.trigger({
  17189. func: function(e) {
  17190. var opa = e <= .5 ? 2 * e : -2 * e + 2
  17191. for(var i in this.hots){
  17192. this.hots[i].mesh.material.uniforms.opac.value = opa;
  17193. }
  17194. }
  17195. .bind(this),
  17196. cycling: !0,
  17197. duration: 3e3,
  17198. name: "hotShine"
  17199. })
  17200. }
  17201. ,
  17202. t.prototype.createHotItem = function(e, t) {
  17203. for (var i = document.createDocumentFragment(), n = Object.keys(e), r = 0; r < n.length; r++) {
  17204. var o = document.createElement("li")
  17205. , a = document.createElement("span");
  17206. a.innerHTML = e[n[r]].title || e[n[r]].infoAttribute && e[n[r]].infoAttribute.title || "热点",
  17207. o.hot = t[n[r]],
  17208. o.appendChild(a),
  17209. i.appendChild(o)
  17210. }
  17211. document.querySelector("#hotListContent ul").appendChild(i),
  17212. console.log(i)
  17213. }
  17214. ,
  17215. t.prototype.loadOverlays = function(overlays){
  17216. var overlays = window.data2 && window.data2.overlays
  17217. overlays && overlays.forEach((info)=>{
  17218. new Overlay(info)
  17219. })
  17220. Overlay.load()
  17221. }
  17222. ,
  17223. t.prototype.loadhots = function() {
  17224. var r = $.Deferred()
  17225. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  17226. return a.get(e, {
  17227. responseType: "json",
  17228. auth: this.isPublic ? null : u.authorizationHeader
  17229. }).done(function(e) {
  17230. window.data2 = e;
  17231. editTool.loadDone('data2', e)
  17232. if(!e){
  17233. console.error("data2 is null")
  17234. }else{
  17235. g_data2 = hotMatcher(e)
  17236. this.hotsCount = 0;
  17237. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17238. window.hotData = {}
  17239. if(e.hots){
  17240. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  17241. sids.forEach((sid)=>{
  17242. this.hotsCount++,
  17243. this.hots[sid] = new M(sid,e.hots[sid] ,this);
  17244. //e.hots[sid].infoAttribute || (e.hots[sid].infoAttribute = {})
  17245. //this.hots[sid].initStyleImg(e.hots[sid].infoAttribute);
  17246. window.hotData[sid] = e.hots[sid];
  17247. })
  17248. }
  17249. this.createHotItem(window.hotData, this.hots);
  17250. g_index = I.valueFromHash("m")
  17251. /* e.tourAudio && (g_tourAudio = new Audio,
  17252. g_tourAudio.loop = !1,
  17253. g_tourAudio.addEventListener("ended", function() {
  17254. var e = document.createEvent("MouseEvent");
  17255. e.initEvent("tourAudioEnded", !0, !0),
  17256. window.dispatchEvent(e)
  17257. })); */
  17258. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  17259. //window.wx && manage.weixinShare(),
  17260. }
  17261. /* var i = $.Deferred()
  17262. , n = g_Prefix + "data/" + this.sid + "/hot/js/data.js?" + randomTime().getTime();
  17263. a.get(n, {
  17264. responseType: "json",
  17265. auth: this.isPublic ? null : u.authorizationHeader
  17266. }).done(function(e) {
  17267. window.hotData = e,
  17268. this.createHotItem(e, this.hots);
  17269. for(let i in this.hots){
  17270. e[i] && this.hots[i].initStyleImg(e[i]);
  17271. }
  17272. i.resolve()
  17273. }
  17274. .bind(this)).fail(function() {
  17275. console.log("Data.js is empty");
  17276. i.resolve()
  17277. }),
  17278. */
  17279. r.resolve()
  17280. }
  17281. .bind(this)).fail(function() {
  17282. console.log("没有热点"),
  17283. editTool.loadDone('data2', null)
  17284. //window.wx && manage.weixinShare(),
  17285. r.resolve()
  17286. }),
  17287. r
  17288. }
  17289. ,
  17290. t.prototype.loadPanos = function() {
  17291. if (this.loadPanosPromise)
  17292. return this.loadPanosPromise;
  17293. var e = new y(this);
  17294. return this.loadPanosPromise = e.load().then(function(e) {
  17295. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  17296. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  17297. else console.log(e.uuid)
  17298. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  17299. }
  17300. .bind(this))),
  17301. this.panos.extend(e.map(function(e) {
  17302. return new f(this,e.uuid,e,this.supportsTiles)
  17303. }
  17304. .bind(this))),
  17305. this.panos.forEach(function(i) {
  17306. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  17307. var t = this.panos.get(e);
  17308. t && this.panos.setNeighbour(i, t, !0)
  17309. }
  17310. .bind(this)),
  17311. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  17312. }
  17313. .bind(this)),
  17314. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  17315. this.supportedModes[s.PANORAMA] = !1),
  17316. $.when(this)
  17317. }
  17318. .bind(this)),
  17319. this.loadPanosPromise
  17320. }
  17321. ,
  17322. t.prototype.loadHighlightReel = function() {
  17323. var t = $.Deferred()
  17324. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17325. return a.get(e, {
  17326. responseType: "json",
  17327. auth: this.isPublic ? null : u.authorizationHeader
  17328. }).done(function(e) {
  17329. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  17330. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  17331. t.resolve()
  17332. }
  17333. .bind(this)).fail(function() {
  17334. R.warn("Getting highlight reel failed, no highlights available"),
  17335. t.resolve()
  17336. }),
  17337. t
  17338. }
  17339. ,
  17340. t.prototype.waitForLoad = function(e, t) {
  17341. t() || (this.waitQueue.push({
  17342. object: e,
  17343. isLoadedCallback: t
  17344. }),
  17345. 1 === this.waitQueue.length && this.emit("waiting"))
  17346. }
  17347. ,
  17348. t.prototype.hide = function() {
  17349. this.floors.hide()
  17350. }
  17351. ,
  17352. t.prototype.show = function() {
  17353. this.floors.show()
  17354. }
  17355. ,
  17356. t.prototype.floorNames = function() {
  17357. return this.floors.names()
  17358. }
  17359. ,
  17360. t.prototype.warpDestFloors = function(e, t) {
  17361. if (e && this.floors.length === e.length) {
  17362. var i = e.findIndex(function(e) {
  17363. return e
  17364. }
  17365. .bind(this));
  17366. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  17367. } else
  17368. this.toggleAllFloors(!0)
  17369. }
  17370. ,
  17371. t.prototype.setFloor = function(e, t, i) {
  17372. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17373. this.allFloorsVisible = !1,
  17374. this._setFloor(e, t, i)
  17375. }
  17376. ,
  17377. t.prototype.toggleAllFloors = function(e) {
  17378. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17379. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17380. this._setFloor(this.currentFloor)
  17381. }
  17382. ,
  17383. t.prototype._setFloor = function(e, t, i) {
  17384. var n;
  17385. if (t = t || this.mode,
  17386. this.emit("floor.changed", e, t, this.currentFloor),
  17387. this.currentFloor = e,
  17388. t === s.PANORAMA) {
  17389. if (this.show(),
  17390. this.shouldShowtags && this.tagsShown)
  17391. for (n in this.tags)
  17392. this.tags[n].show(u.showFloorDuration)
  17393. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17394. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17395. }
  17396. .bind(this)),
  17397. this.shouldShowtags && this.tagsShown))
  17398. for (n in this.tags) {
  17399. var r = this.tags[n];
  17400. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  17401. }
  17402. var o = this
  17403. , a = e;
  17404. A.start(function() {}, u.showFloorDelay, function() {
  17405. o.floors.forEach(function(t) {
  17406. t.chunks.forEach(function(e) {
  17407. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  17408. })
  17409. })
  17410. }
  17411. .bind(this))
  17412. }
  17413. ,
  17414. t.prototype.toggleExplode = function() {
  17415. this.floors.toggleExplodeHorizontal()
  17416. }
  17417. ,
  17418. t.prototype.toggleExplodeUp = function() {
  17419. this.floors.toggleExplodeVertical()
  17420. }
  17421. ,
  17422. t.prototype.nextFloor = function(e) {
  17423. return this.floors.nextFloor(this.currentFloor, e)
  17424. }
  17425. ,
  17426. t.prototype.addFloor = function(e) {
  17427. this.floors.add(e)
  17428. }
  17429. ,
  17430. t.prototype.getFloorAtPoint = function(e) {
  17431. return this.floors.getFloorAtPoint(e)
  17432. }
  17433. ,
  17434. t.prototype.getTagBySid = function(e) {
  17435. return this.tags[e]
  17436. }
  17437. ,
  17438. t.prototype.addChunk = function(e, t) {
  17439. this.floors.getOrMakeFloor(e).addChunk(t),
  17440. this.chunks.push(t)
  17441. }
  17442. ,
  17443. t.prototype.setMode = function(t) {
  17444. if (!this.supportedModes[t])
  17445. throw new x("Mode not supported for this model: " + t);
  17446. this.mode = t
  17447. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17448. this.chunks.forEach(function(e) {
  17449. e.setMode(t)
  17450. })
  17451. }
  17452. ,
  17453. t.prototype.build = function() {
  17454. this.heroLocations = this.images.getHeroLocations(this.panos);
  17455. var e = function() {
  17456. 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()
  17457. }
  17458. .bind(this)();
  17459. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  17460. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17461. }
  17462. .bind(this)) || e,
  17463. null === this.heroImage && R.warn("No hero image defined."),
  17464. this.currentFloor = this.floors.last(),
  17465. this.floors.build(),
  17466. this.colliders = this.floors.reduce(function(e, t) {
  17467. return e.concat(t.collider.children)
  17468. }, []),
  17469. this.panos.forEach(function(e) {
  17470. e.build1(),
  17471. e.on("enter", function() {
  17472. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17473. }
  17474. .bind(this))
  17475. }
  17476. .bind(this)),
  17477. this.panos.forEach(function(e) {
  17478. e.build2()
  17479. }),
  17480. this.floors.forEach(function(e) {
  17481. this.boundingBox.union(e.boundingBox)
  17482. }
  17483. .bind(this)),
  17484. this.size = this.boundingBox.size(),
  17485. this.center = this.boundingBox.center(),
  17486. this.floors.forEach(function(e) {
  17487. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17488. }
  17489. .bind(this)),
  17490. this.panos.populate_path_graph(),
  17491. this.skybox = new n(this.boundingBox),
  17492. this.skybox.matrixWorldNeedsUpdate = !0,
  17493. this.add(this.skybox),
  17494. setTimeout(function() {
  17495. this.hotsCount && this.shineHots()
  17496. }
  17497. .bind(this), 1300),
  17498. this.tags)
  17499. this.tags[t].build();
  17500. //add-----
  17501. for(let i in this.hots){
  17502. this.hots[i].setVisiblePanos(this.hots[i].visibleData);
  17503. }
  17504. //---------
  17505. return R.debug("Done building model"),
  17506. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  17507. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  17508. this.buildRooms(),
  17509. this.labels.associateWithRooms(this.rooms),
  17510. $.when(this)
  17511. }
  17512. ,
  17513. t.prototype.loadLabels = function() {
  17514. this.labels = new b(this);
  17515. var e = $.Deferred();
  17516. window.MP_PREFETCHED_MODELDATA.showingLabels ? this.showingLabels = true : '';
  17517. if (!this.showingLabels)
  17518. return e.resolve();
  17519. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17520. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17521. R.warn("Getting labels failed, not displaying labels."),
  17522. e.resolve()
  17523. }),
  17524. e
  17525. }
  17526. ,
  17527. t.prototype.buildRooms = function() {
  17528. this.rooms = new _(this),
  17529. this.rooms.createFromChunks(this.chunks),
  17530. this.rooms.calcRoomBoundaries()
  17531. }
  17532. ,
  17533. t.prototype.updateProjectedPanos = function() {
  17534. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17535. }
  17536. ,
  17537. t.prototype.setProjectedPanos = function(t, i, n) {
  17538. null != n || (n = !0),
  17539. n = !!n,
  17540. this.projectedPano0 = t,
  17541. this.projectedPano1 = i,
  17542. this.skybox.material.setProjectedPanos(t, i, n),
  17543. this.chunks.forEach(function(e) {
  17544. e.materialInside.setProjectedPanos(t, i, n)
  17545. })
  17546. }
  17547. ,
  17548. t.prototype.setSide = function(t) {
  17549. this.floors.forEach(function(e) {
  17550. e.collider.material.side = t
  17551. })
  17552. }
  17553. ,
  17554. t.prototype.heroCount = function() {
  17555. return this.heroLocations ? this.heroLocations.length : 0
  17556. }
  17557. ,
  17558. t.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  17559. if (e[0] < 0)
  17560. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17561. null;
  17562. if (this.heroCount() < 1)
  17563. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17564. null;
  17565. var t = this.heroLocations[e[0]];
  17566. if(t.heroLocations && e[1]!=void 0){
  17567. t = t.heroLocations[e[1]];
  17568. }
  17569. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17570. null) : t
  17571. }
  17572. ,
  17573. t.prototype.findPanoramicHero = function() {
  17574. for (var e in this.heroLocations)
  17575. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  17576. return this.heroLocations[e];
  17577. return null
  17578. }
  17579. ,
  17580. t.prototype.listImagePanos = function() {
  17581. var i = []
  17582. , n = this;
  17583. return this.images.forEach(function(e) {
  17584. if (e.metadata && e.metadata.scan_id) {
  17585. var t = n.panos.get(e.metadata.scan_id);
  17586. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17587. }
  17588. }),
  17589. i
  17590. }
  17591. ,
  17592. t.prototype.fadePanoMarkers = function(e, t) {
  17593. this.panos.fadeMarkerOpacity(e, t)
  17594. }
  17595. ,
  17596. t.prototype.setSweepVisibility = function(t) {
  17597. this.panos.forEach(function(e) {
  17598. e.marker && (e.marker.visible = t)
  17599. })
  17600. }
  17601. ,
  17602. t.prototype.outsideAllowed = function() {
  17603. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17604. }
  17605. ,
  17606. O.exports = t
  17607. }
  17608. ).call(this, "/js/model/Model.js")
  17609. }
  17610. , {
  17611. "../constants": 8,
  17612. "../enum/AlignmentType": 17,
  17613. "../enum/RenderOrder": 42,
  17614. "../enum/Viewmode": 51,
  17615. "../exception/BasicException": 55,
  17616. "../label/Label": 90,
  17617. "../loaders/ModelLoader": 105,
  17618. "../loaders/ModelTextureLoader": 106,
  17619. "../loaders/SweepDataLoader": 107,
  17620. "../tag/tag": 123,
  17621. "../tag/tagManager": 124,
  17622. "../objects/BoundingTextureSkybox": 143,
  17623. "../objects/Chunk": 144,
  17624. "../objects/Floor": 146,
  17625. "../objects/Panorama": 148,
  17626. "../objects/Room": 150,
  17627. "../objects/Snapshot": 153,
  17628. "../settings": 166,
  17629. "../shaders": 167,
  17630. "../util/ModelUrls": 177,
  17631. "../util/PanoramaCollection": 178,
  17632. "../util/ajax": 181,
  17633. "../util/common": 185,
  17634. "../util/easing": 186,
  17635. "../util/lerp": 188,
  17636. "../util/logger": 189,
  17637. "../util/math": 190,
  17638. "../util/texture": 194,
  17639. "../util/transitions": 195,
  17640. "./../util/browser": 182,
  17641. "./../util/showcase": 193,
  17642. "./Chunks": 135,
  17643. "./FloorCollection": 136,
  17644. "./ImageCollection": 137,
  17645. "./LabelCollection": 138,
  17646. "./RoomCollection": 141,
  17647. events: 202,
  17648. three: 217,
  17649. hot: "hot"
  17650. }],
  17651. 140: [function(e, t, i) {
  17652. "use strict";
  17653. function n() {
  17654. this.modelMap = {},
  17655. this.activeModel = null,
  17656. this.modelCount = 0,
  17657. this.tileDownloader = null,
  17658. this.panoRenderer = null
  17659. }
  17660. var r = (e("three"),
  17661. e("../util/common"))
  17662. , o = e("../exception/BasicException")
  17663. , a = e("../enum/ModelManagerEvents")
  17664. , s = e("../enum/PanoRendererEvents")
  17665. , l = e("events").EventEmitter;
  17666. n.prototype.init = function(e, t, i) {
  17667. this.tileDownloader = e,
  17668. this.panoRenderer = t,
  17669. this.qualityManager = i,
  17670. this.bindEvents()
  17671. }
  17672. ,
  17673. n.prototype.bindEvents = function() {
  17674. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17675. }
  17676. ,
  17677. n.prototype.onTileRendered = function(e, t, i, n) {}
  17678. ,
  17679. n.prototype.addModel = function(e) {
  17680. this.modelMap[e.sid] = e,
  17681. 0 === this.modelCount && this.activateModel(e.sid),
  17682. this.modelCount++,
  17683. this.emit(a.ModelAdded)
  17684. }
  17685. ,
  17686. n.prototype.getModel = function(e) {
  17687. return this.modelMap[e]
  17688. }
  17689. ,
  17690. n.prototype.activateModel = function(e) {
  17691. var t = this.modelMap[e];
  17692. if (!t)
  17693. throw new o("Tried to activate invalid model!");
  17694. var i = this.activeModel;
  17695. this.activeModel = t,
  17696. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17697. this.tileDownloader.setUrls(t.urls),
  17698. t.panos.forEach(function(e) {
  17699. e.attachToPanoRenderer(this.panoRenderer),
  17700. e.tileDownloader = this.tileDownloader,
  17701. e.qualityManager = this.qualityManager
  17702. }
  17703. .bind(this)),
  17704. this.emit(a.ActiveModelChanged, {
  17705. oldModel: i,
  17706. model: t
  17707. })
  17708. }
  17709. ,
  17710. n.prototype.getActiveModel = function() {
  17711. return this.activeModel
  17712. }
  17713. ,
  17714. r.extend(n, l),
  17715. t.exports = n
  17716. }
  17717. , {
  17718. "../enum/ModelManagerEvents": 33,
  17719. "../enum/PanoRendererEvents": 35,
  17720. "../exception/BasicException": 55,
  17721. "../util/common": 185,
  17722. events: 202,
  17723. three: 217
  17724. }],
  17725. 141: [function(r, l, e) {
  17726. (function(e) {
  17727. "use strict";
  17728. function o() {
  17729. n.call(this)
  17730. }
  17731. var a = r("../objects/Room")
  17732. , t = (r("../settings"),
  17733. r("../util/logger"))
  17734. , i = (r("../util/transitions"),
  17735. r("../util/easing"),
  17736. r("../util/common"))
  17737. , n = r("../util/IndexedCollection")
  17738. , s = r("./Chunks");
  17739. new t(e),
  17740. i.inherit(o, n),
  17741. o.prototype.getIndex = function(e) {
  17742. return e.roomId
  17743. }
  17744. ,
  17745. o.prototype.calcRoomBoundaries = function() {
  17746. this.forEach(function(e) {
  17747. e.calcBoundaries()
  17748. })
  17749. }
  17750. ,
  17751. o.prototype.createFromChunks = function(e) {
  17752. var n = {
  17753. floorId: -1,
  17754. roomId: -1
  17755. }
  17756. , r = {};
  17757. e.forEach(function(e) {
  17758. s.parseIdsFromChunkName(e.name, n);
  17759. var t = r[n.roomId];
  17760. if (!t) {
  17761. var i = o.generateRoomId(n.floorId, n.roomId);
  17762. t = new a(n.floorId,i),
  17763. this.add(t),
  17764. r[n.roomId] = t
  17765. }
  17766. t.addChunk(e)
  17767. }
  17768. .bind(this)),
  17769. this.calcRoomBoundaries()
  17770. }
  17771. ,
  17772. o.generateRoomId = function(e, t) {
  17773. return e + "_" + t
  17774. }
  17775. ,
  17776. l.exports = o
  17777. }
  17778. ).call(this, "/js/model/RoomCollection.js")
  17779. }
  17780. , {
  17781. "../objects/Room": 150,
  17782. "../settings": 166,
  17783. "../util/IndexedCollection": 175,
  17784. "../util/common": 185,
  17785. "../util/easing": 186,
  17786. "../util/logger": 189,
  17787. "../util/transitions": 195,
  17788. "./Chunks": 135
  17789. }],
  17790. 142: [function(e, t, i) {
  17791. "use strict";
  17792. function n(e, t, i) {
  17793. var n = (e = e.clone().expandByScalar(0.01)).size()
  17794. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17795. r.boundingBox = e,
  17796. o.Mesh.call(this, r, t),
  17797. this.position.copy(e.center()),
  17798. this.frustumCulled = !1,
  17799. i && this.add(new o.WireframeHelper(this))
  17800. }
  17801. var o = e("three");
  17802. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17803. t.exports = n
  17804. }
  17805. , {
  17806. three: 217
  17807. }],
  17808. 143: [function(l, c, e) {
  17809. (function(e) {
  17810. "use strict";
  17811. function t(e) {
  17812. s.time("Computing a nice bounding cubemap");
  17813. var t = new r({
  17814. side: i.BackSide,
  17815. transparent: !0
  17816. });
  17817. t.uniforms.modelAlpha.value = 0,
  17818. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17819. this.renderOrder = a.boundingSkybox,
  17820. n.call(this, e, t),
  17821. s.timeEnd("Computing a nice bounding cubemap")
  17822. }
  17823. var i = l("three")
  17824. , n = (l("../enum/Viewmode"),
  17825. l("../shaders"),
  17826. l("./BoundingMesh"))
  17827. , r = l("../materials/ModelTextureMaterial")
  17828. , o = l("../settings")
  17829. , a = l("../enum/RenderOrder")
  17830. , s = new (l("../util/logger"))(e);
  17831. (t.prototype = Object.create(n.prototype)).constructor = t,
  17832. c.exports = t
  17833. }
  17834. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17835. }
  17836. , {
  17837. "../enum/RenderOrder": 42,
  17838. "../enum/Viewmode": 51,
  17839. "../materials/ModelTextureMaterial": 118,
  17840. "../settings": 166,
  17841. "../shaders": 167,
  17842. "../util/logger": 189,
  17843. "./BoundingMesh": 142,
  17844. three: 217
  17845. }],
  17846. 144: [function(e, t, i) {
  17847. "use strict";
  17848. function n(e) {
  17849. this.materialInside = new s({
  17850. side: r.DoubleSide
  17851. });
  17852. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17853. this.materialOutside = new r.RawShaderMaterial({
  17854. fragmentShader: o.modelOutside.fragmentShader,
  17855. vertexShader: o.modelOutside.vertexShader,
  17856. uniforms: t,
  17857. side: r.FrontSide,
  17858. name: "chunkOut"
  17859. }),
  17860. r.Mesh.call(this, e.geometry, this.materialInside),
  17861. this.name = e.name || "",
  17862. this.textureName = e.textureName,
  17863. this.meshUrl = e.meshUrl
  17864. }
  17865. var r = e("three")
  17866. , o = e("../shaders")
  17867. , a = e("../enum/Viewmode")
  17868. , s = e("../materials/ModelTextureMaterial");
  17869. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17870. this.materialInside.uniforms.map.value = e,
  17871. this.materialOutside.uniforms.map.value = e
  17872. }
  17873. ,
  17874. n.prototype.setMode = function(e) {
  17875. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17876. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17877. t.transparent = this.material.transparent,
  17878. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17879. this.material = t
  17880. }
  17881. ,
  17882. t.exports = n
  17883. }
  17884. , {
  17885. "../enum/Viewmode": 51,
  17886. "../materials/ModelTextureMaterial": 118,
  17887. "../shaders": 167,
  17888. three: 217
  17889. }],
  17890. 145: [function(e, t, i) {
  17891. "use strict";
  17892. function n(e) {
  17893. this.chunksize = e || 10,
  17894. this.chunks = {},
  17895. this.boundingBoxes = {},
  17896. this.children = [],
  17897. this.offset = new m.Vector3(0,.5,0),
  17898. this.material = new m.MeshBasicMaterial({
  17899. color: 16777215 * Math.random(),
  17900. side: m.DoubleSide
  17901. })
  17902. }
  17903. var m = e("three");
  17904. e("../enum/Viewmode"),
  17905. n.prototype.add = function(e) {
  17906. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17907. u ? (t = u.position.array,
  17908. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17909. e.faces);
  17910. var d = new m.Vector3;
  17911. if (i)
  17912. for (n = 0,
  17913. r = i.length; n < r; n += 3) {
  17914. var p = 3 * i[n]
  17915. , f = 3 * i[n + 1]
  17916. , g = 3 * i[n + 2];
  17917. o = (t[p] + t[f] + t[g]) / 3,
  17918. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17919. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17920. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17921. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17922. this.boundingBoxes[l] = new m.Box3),
  17923. h.push(t[p], t[1 + p], t[2 + p], t[f], t[1 + f], t[2 + f], t[g], t[1 + g], t[2 + g]),
  17924. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17925. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17926. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17927. }
  17928. else
  17929. for (n = 0,
  17930. r = t.length; n < r; n += 9)
  17931. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17932. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17933. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17934. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17935. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17936. this.boundingBoxes[l] = new m.Box3),
  17937. h.push(t[n], t[n + 1], t[n + 2], t[n + 3], t[n + 4], t[n + 5], t[n + 6], t[n + 7], t[n + 8]),
  17938. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17939. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17940. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17941. }
  17942. ,
  17943. n.prototype.build = function() {
  17944. var e = new m.Object3D;
  17945. for (var t in e.material = this.material,
  17946. this.chunks) {
  17947. var i = this.chunks[t]
  17948. , n = new m.BufferGeometry;
  17949. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17950. n.boundingBox = this.boundingBoxes[t];
  17951. var r = new m.Mesh(n,this.material);
  17952. r.material.visible = !1,
  17953. e.add(r),
  17954. this.chunks[t] = []
  17955. }
  17956. return e
  17957. }
  17958. ,
  17959. t.exports = n
  17960. }
  17961. , {
  17962. "../enum/Viewmode": 51,
  17963. three: 217
  17964. }],
  17965. 146: [function(e, t, i) {
  17966. "use strict";
  17967. var n = e("three")
  17968. , r = e("../settings")
  17969. , o = e("../util/common")
  17970. , a = e("../util/lerp")
  17971. , s = e("./ChunkedCollider")
  17972. , l = e("../util/transitions")
  17973. , c = e("../util/easing")
  17974. , h = (e("../objects/Panorama"),
  17975. e("../enum/RenderOrder"));
  17976. e("../localization/localize");
  17977. function u(e, t, i) {
  17978. n.Object3D.call(this),
  17979. this.model = e,
  17980. this.floorIndex = t,
  17981. this.lang = r.languageTag,
  17982. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17983. this.panos = [],
  17984. this.chunks = [],
  17985. this.colliderBuilder = new s(3),
  17986. this.collider = null,
  17987. this.center = null,
  17988. this.boundingBox = new n.Box3,
  17989. this.size = null,
  17990. this.hidden = !1,
  17991. this.conservativeBoundingBox = new n.Box3,
  17992. this.debugColor = 16777215 * Math.random(),
  17993. this.transition = null
  17994. }
  17995. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17996. this.model.setFloor(this, e)
  17997. }
  17998. ,
  17999. u.prototype.hide = function(e) {
  18000. if (!this.hidden || this.transition) {
  18001. this.chunks.forEach(function(e) {
  18002. e.material.transparent = !0
  18003. }),
  18004. l.cancel(this.transition);
  18005. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  18006. , i = e ? 0 : r.hideFloorDelay / t;
  18007. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  18008. this.hidden = !0
  18009. }
  18010. .bind(this), i, c.easeInOutQuad)
  18011. }
  18012. }
  18013. ,
  18014. u.prototype.show = function(e) {
  18015. if (this.hidden || this.transition) {
  18016. this.hidden = !1,
  18017. l.cancel(this.transition);
  18018. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  18019. , i = e ? 0 : r.showFloorDelay / t;
  18020. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  18021. this.hidden || this.chunks.forEach(function(e) {
  18022. e.material.transparent = !1
  18023. })
  18024. }
  18025. .bind(this), i, c.easeInOutQuad)
  18026. }
  18027. }
  18028. ,
  18029. u.prototype.toggle = function(e, t) {
  18030. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  18031. }
  18032. ,
  18033. u.prototype.containsPoint = function(t) {
  18034. return this.collider.children.some(function(e) {
  18035. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  18036. e.geometry.boundingBox.containsPoint(t)
  18037. })
  18038. }
  18039. ,
  18040. u.prototype.distanceToPoint = function(i) {
  18041. var n = null
  18042. , r = 1 / 0;
  18043. return this.collider.children.forEach(function(e) {
  18044. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  18045. var t = e.geometry.boundingBox.distanceToPoint(i);
  18046. (!n || t < r) && (r = t,
  18047. n = e)
  18048. }),
  18049. r
  18050. }
  18051. ,
  18052. u.prototype.addChunk = function(e) {
  18053. e.renderOrder = h.ghostFloor,
  18054. this.add(e),
  18055. this.chunks.push(e),
  18056. this.boundingBox.union(e.geometry.boundingBox),
  18057. this.size = this.boundingBox.size(),
  18058. this.colliderBuilder.add(e.geometry)
  18059. }
  18060. ,
  18061. u.prototype.addPano = function(e) {
  18062. this.panos.push(e),
  18063. this.add(e.skyboxMesh),
  18064. e.marker && this.add(e.marker);
  18065. var t = new n.Vector3(1,1,1)
  18066. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  18067. this.boundingBox.union(i)
  18068. }
  18069. ,
  18070. u.prototype.build = function() {
  18071. this.collider = this.colliderBuilder.build(!0),
  18072. this.add(this.collider),
  18073. this.center = this.boundingBox.center(),
  18074. this.conservativeBoundingBox.copy(this.boundingBox),
  18075. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  18076. return e.geometry.boundingBox.min.y
  18077. }), 5),
  18078. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  18079. return e.geometry.boundingBox.max.y
  18080. }), 5),
  18081. this.colliderBuilder = null
  18082. }
  18083. ,
  18084. u.prototype.toShortString = function() {
  18085. return o.nth(this.floorIndex + 1)
  18086. }
  18087. ,
  18088. u.prototype.toString = function() {
  18089. return this.name
  18090. }
  18091. ,
  18092. t.exports = u
  18093. }
  18094. , {
  18095. "../enum/RenderOrder": 42,
  18096. "../localization/localize": 108,
  18097. "./strings-cn-CN": 109,
  18098. "../objects/Panorama": 148,
  18099. "../settings": 166,
  18100. "../util/common": 185,
  18101. "../util/easing": 186,
  18102. "../util/lerp": 188,
  18103. "../util/transitions": 195,
  18104. "./ChunkedCollider": 145,
  18105. three: 217
  18106. }],
  18107. 147: [function(e, t, i) {
  18108. "use strict";
  18109. function n(e) {
  18110. this.player = e,
  18111. this.obj3d = null,
  18112. this.UP = new u.Vector3(0,1,0)
  18113. }
  18114. var u = e("three")
  18115. , d = e("../settings");
  18116. n.prototype.prefs = {
  18117. linewidth: 3,
  18118. height: .07,
  18119. opacity: .45,
  18120. endScale: .05
  18121. },
  18122. n.prototype.discard = function() {
  18123. if (this.obj3d) {
  18124. var e = this.obj3d.parent;
  18125. e && e.remove(this.obj3d)
  18126. }
  18127. this.obj3d = null
  18128. }
  18129. ,
  18130. n.prototype.draw = function() {
  18131. if (this.discard(),
  18132. d.showNeighbors) {
  18133. var e = this.player.currentPano.floor;
  18134. this.obj3d = new u.Object3D;
  18135. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  18136. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  18137. i.y += this.prefs.height;
  18138. var n = .1525
  18139. , r = new u.Matrix4;
  18140. for (var o in t)
  18141. if (t[o]) {
  18142. var a = this.player.model.panos.get(o)
  18143. , s = (a.position.clone().sub(this.player.model.position),
  18144. a.position.clone().sub(a.floorPosition))
  18145. , l = a.floorPosition.clone().sub(this.player.model.position);
  18146. l.y += this.prefs.height;
  18147. var c = new u.Geometry;
  18148. c.vertices.push(new u.Vector3(0,-.0127,0), new u.Vector3(-.0127,0,0), new u.Vector3(0,.0127,0), new u.Vector3(.0127,0,0), new u.Vector3(0,-.0127,0)),
  18149. c.vertices.push(new u.Vector3(0,-.255,0), new u.Vector3(.255,-.255,0), new u.Vector3(.255,n,0), new u.Vector3(-n,n,0), new u.Vector3(-n,.127,0), new u.Vector3(-.19,.1,0), new u.Vector3(-.19,-.2032,0), new u.Vector3(-n,-.2286,0), new u.Vector3(-n,-.255,0), new u.Vector3(0,-.255,0)),
  18150. r.identity().setPosition(s),
  18151. c.applyMatrix(r),
  18152. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  18153. c.vertices.push(new u.Vector3(-this.prefs.endScale,-this.prefs.endScale,0), new u.Vector3(-this.prefs.endScale,this.prefs.endScale,0), new u.Vector3(this.prefs.endScale,this.prefs.endScale,0), new u.Vector3(this.prefs.endScale,-this.prefs.endScale,0)),
  18154. r.lookAt(l, i, this.UP).setPosition(l),
  18155. c.applyMatrix(r),
  18156. c.vertices.push(l, i);
  18157. var h = new u.Line(c,new u.LineBasicMaterial({
  18158. color: a.debugColor.getHex(),
  18159. transparent: !0,
  18160. opacity: this.prefs.opacity,
  18161. depthWrite: !1,
  18162. name: "sLine" + o,
  18163. linewidth: this.prefs.linewidth
  18164. }));
  18165. this.obj3d.add(h)
  18166. }
  18167. e.add(this.obj3d)
  18168. }
  18169. }
  18170. ,
  18171. n.prototype.update = function() {
  18172. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18173. }
  18174. ,
  18175. t.exports = n
  18176. }
  18177. , {
  18178. "../settings": 166,
  18179. three: 217
  18180. }],
  18181. 148: [function(S, M, e) {
  18182. (function(e) {
  18183. "use strict";
  18184. function r(e, t, i, n) {
  18185. this.model = e,
  18186. this.id = t,
  18187. this.alignmentType = i.alignmentType || c.ALIGNED,
  18188. this.neighbourUUIDs = i.neighbours,
  18189. this.neighbourPanos = null,
  18190. this.floor = null,
  18191. this.floorIndex = i.floor,
  18192. this.failedLoadingAt = 0,
  18193. this.maxLoadRetries = 4,
  18194. this.origin = i.position.clone(),
  18195. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  18196. this.quaternion = i.quaternion.clone(),
  18197. this.skyboxMesh = new s.Mesh(E),
  18198. this.skyboxMesh.position.copy(this.position),
  18199. this.skyboxMesh.quaternion.copy(this.quaternion),
  18200. this.skyboxMesh.name = "skybox",
  18201. this.skyboxMesh.visible = !1,
  18202. this.skyboxMesh.updateMatrix(),
  18203. this.skyboxMesh.updateMatrixWorld(),
  18204. this.marker = null,
  18205. this.showFloorMarker = this.showFloorMarker = !window.MP_PREFETCHED_MODELDATA.hideFloorMarker,
  18206. this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  18207. map: b,
  18208. side: s.DoubleSide,
  18209. opacity: 0,
  18210. transparent: !0,
  18211. depthWrite: !1
  18212. })),
  18213. this.marker.visible = this.showFloorMarker,
  18214. this.marker.renderOrder = l.panoMarker,
  18215. this.marker.name = "marker",
  18216. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  18217. this.marker.updateMatrixWorld(),
  18218. a.colorMarkerOnLoad && this.on("load", function() {
  18219. this.marker.material.color.set(65280)
  18220. })),
  18221. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  18222. this.floorPosition = i.puck ? i.puck.clone() : null,
  18223. this.tiled = n,
  18224. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  18225. this.solidSkybox.flipY = !1,
  18226. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  18227. this.solidSkybox.magFilter = s.LinearFilter,
  18228. this.solidSkybox.generateMipmaps = !1)),
  18229. this.zoomed = !1,
  18230. this.panoRenderer = null,
  18231. this.qualityManager = null,
  18232. this.tileDownloader = null,
  18233. this.tiledPanoRenderTarget = null,
  18234. this.minimumTiledPanoLoaded = !1,
  18235. this.highestPartialTileRenderOpCompleted = 0,
  18236. this.highestFullTileRenderOpCompleted = 0,
  18237. this.shouldRedrawOnBaseLoaded = !1,
  18238. this.lockUntilRenderingComplete = !1,
  18239. a.colorMarkerOnLoad && this.on("load", function() {
  18240. this.marker.material.color.set(65280)
  18241. }),
  18242. (e = new s.TextureLoader).setCrossOrigin(!0);
  18243. var r = e.load("images/texture.jpg");
  18244. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  18245. color: 16777215,
  18246. transparent: !0,
  18247. opacity: .75,
  18248. map: r
  18249. })),
  18250. this.vrMarker.boluoType = "vr",
  18251. this.vrMarker.position.z = 1,
  18252. this.vrMarker.enabled = !0,
  18253. this.vrMarker.visible = !1,
  18254. window.vrMarkers = window.vrMarkers || [],
  18255. window.vrMarkers.push(this.vrMarker),
  18256. this.marker && this.marker.add(this.vrMarker),
  18257. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  18258. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  18259. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  18260. this.adjustAngleEnable) {
  18261. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  18262. this.skyboxMesh.quaternion.multiply(i);
  18263. var o = new s.Quaternion;
  18264. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  18265. this.skyboxMesh.quaternion.multiply(o),
  18266. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  18267. this.skyboxMesh.quaternion.multiply(n),
  18268. this.skyboxMesh.updateMatrix(),
  18269. this.skyboxMesh.updateMatrixWorld(),
  18270. this.model.updateProjectedPanos()
  18271. }
  18272. }
  18273. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  18274. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  18275. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  18276. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  18277. S("../enum/GLCubeFaces"),
  18278. S("../exception/BasicException")), A = S("../tile/TileUtils"), C = S("events").EventEmitter, I = new n(e), E = new s.SphereBufferGeometry(.1), _ = new s.PlaneBufferGeometry(.4,.4,1,1), b = d.load("images/marker-256x256.png");
  18279. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  18280. function() {
  18281. this.setZoomed(!1),
  18282. this.emit("enter", {
  18283. oldPano: t,
  18284. newPano: this
  18285. }),
  18286. t = this
  18287. }
  18288. ),
  18289. r.prototype.exit = function() {
  18290. this.tiled ? (this.clearWaitDeferreds(),
  18291. this.minimumTiledPanoLoaded = !1,
  18292. this.tiledPanoRenderTarget = null,
  18293. this.setZoomed(!1),
  18294. this.panoRenderer.deactivateTiledPano(this),
  18295. this.highestPartialTileRenderOpCompleted = 0,
  18296. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  18297. this.solidSkybox.loaded = !1,
  18298. this.solidSkybox.version = 0),
  18299. this.emit("exit")
  18300. }
  18301. ,
  18302. r.prototype.hoverOn = function(e) {
  18303. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  18304. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  18305. }
  18306. ,
  18307. r.prototype.hoverOff = function(e) {
  18308. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  18309. }
  18310. ,
  18311. r.prototype.build1 = function() {
  18312. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  18313. this.floor.addPano(this),
  18314. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  18315. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  18316. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18317. this.neighbourUUIDs = this.neighbourUUIDs || [] //add
  18318. }
  18319. ,
  18320. r.prototype.build2 = function() {
  18321. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  18322. this.height = this.position.distanceTo(this.floorPosition),
  18323. this.placeMarker()
  18324. }
  18325. ,
  18326. r.prototype.interpolateFloorPosition = function() {
  18327. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  18328. return !!e.floorPosition
  18329. }).sort(function(e, t) {
  18330. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18331. }
  18332. .bind(this))
  18333. , t = this.position.clone();
  18334. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  18335. t
  18336. }
  18337. ,
  18338. r.prototype.raycastFloorPosition = function() {
  18339. I.warn("Performance warning: Raycasting to find floor position");
  18340. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  18341. return e.length ? e[0].point : null
  18342. }
  18343. ,
  18344. r.prototype.raycastToFindFloor = (i = [new s.Vector3(0,-1,0), new s.Vector3(1,-1,0), new s.Vector3(0,-1,1), new s.Vector3(-1,-1,0), new s.Vector3(0,-1,-1), new s.Vector3(1,0,0), new s.Vector3(0,0,1), new s.Vector3(-1,0,0), new s.Vector3(0,0,-1)],
  18345. function() {
  18346. I.warn("Performance warning: Raycasting to find floor index");
  18347. for (var e = 0; e < i.length; e++) {
  18348. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  18349. if (t.length)
  18350. return t[0].object.parent.parent
  18351. }
  18352. return null
  18353. }
  18354. ),
  18355. r.prototype.placeMarker = function() {
  18356. this.marker && (this.marker.position.copy(this.floorPosition),
  18357. this.marker.position.y += .05,
  18358. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  18359. }
  18360. ,
  18361. r.prototype.translate = function(e) {
  18362. this.position.add(e),
  18363. this.floorPosition.add(e)
  18364. }
  18365. ,
  18366. r.prototype.findClosestMidtpointPanoTo = function(e) {
  18367. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  18368. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  18369. }
  18370. ,
  18371. r.prototype.attachToPanoRenderer = function(e) {
  18372. this.panoRenderer = e,
  18373. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18374. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18375. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18376. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18377. }
  18378. ;
  18379. var w, T, x = {};
  18380. r.prototype.getWaitDeferred = function(e) {
  18381. var t = x[this.id];
  18382. t || (t = {},
  18383. x[this.id] = t);
  18384. var i = t[e];
  18385. return i || (i = {
  18386. deferred: $.Deferred(),
  18387. active: !1
  18388. },
  18389. t[e] = i),
  18390. i
  18391. }
  18392. ,
  18393. r.prototype.resetWaitDeferred = function(e) {
  18394. var t = this.getWaitDeferred(e);
  18395. t.active = !1,
  18396. t.deferred = $.Deferred()
  18397. }
  18398. ,
  18399. r.prototype.clearWaitDeferreds = function() {
  18400. var e = x[this.id];
  18401. for (var t in e || (e = {},
  18402. x[this.id] = e),
  18403. e)
  18404. if (e.hasOwnProperty(t)) {
  18405. var i = e[t];
  18406. i.active = !1,
  18407. i.deferred = $.Deferred()
  18408. }
  18409. }
  18410. ,
  18411. r.prototype.loadTiledPano = (new s.Vector3,
  18412. w = [],
  18413. T = [],
  18414. function(e, t, i, n, r, o) {
  18415. null != n || (n = !0),
  18416. null != r || (r = !0);
  18417. var a = this.getWaitDeferred(e)
  18418. , s = a.deferred
  18419. , l = null
  18420. , c = null;
  18421. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  18422. c = i.vFov)),
  18423. !this.isLoaded(e)) {
  18424. if (!a.active) {
  18425. if (a.active = !0,
  18426. i) {
  18427. var h = A.matchingTilesInDirection(this, e, t, l, c);
  18428. w[this.id + ":" + e] = {
  18429. tileCount: 0,
  18430. targetTileCount: h
  18431. },
  18432. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  18433. }
  18434. T[this.id] || (T[this.id] = !0,
  18435. this.on(f.LoadComplete, function(e, t) {
  18436. var i = this.getWaitDeferred(e).deferred;
  18437. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18438. this.resetWaitDeferred(e))
  18439. }
  18440. .bind(this)),
  18441. this.on(f.LoadFailed, function(e) {
  18442. var t = this.getWaitDeferred(e).deferred;
  18443. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18444. this.resetWaitDeferred(e))
  18445. }
  18446. .bind(this)),
  18447. this.on(f.TileLoaded, function(e, t, i) {
  18448. var n = this.getWaitDeferred(e).deferred;
  18449. if (n && "pending" === n.state()) {
  18450. n.notify(e, t, i);
  18451. var r = w[this.id + ":" + e];
  18452. r && (r.tileCount++,
  18453. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  18454. n.resolve(e, i),
  18455. this.resetWaitDeferred(e)))
  18456. }
  18457. }
  18458. .bind(this)))
  18459. }
  18460. this.tileDownloader.clearForceQueue(),
  18461. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  18462. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  18463. this.panoRenderer.renderPanoTiles(this.id, t, r)
  18464. }
  18465. return s.promise()
  18466. }
  18467. ),
  18468. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18469. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18470. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18471. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18472. }
  18473. ,
  18474. r.prototype.onTileRendered = function(e, t, i, n) {
  18475. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18476. }
  18477. ,
  18478. r.prototype.onPanoRendered = function(e, t, i, n) {
  18479. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18480. this.updateSkyboxForZoomLevel(),
  18481. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18482. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18483. this.emit("load", t),
  18484. this.model.emit("load", this),
  18485. this.emit(f.LoadComplete, t, i))
  18486. }
  18487. ,
  18488. r.prototype.setZoomed = function(e) {
  18489. this.zoomed = e,
  18490. this.updateSkyboxForZoomLevel()
  18491. }
  18492. ,
  18493. r.prototype.ensureSkyboxReadyForRender = function() {
  18494. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18495. this.solidSkybox.loaded = !0)
  18496. }
  18497. ,
  18498. r.prototype.updateSkyboxForZoomLevel = function() {
  18499. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18500. }
  18501. ,
  18502. r.prototype.getSkyboxTexture = function() {
  18503. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18504. }
  18505. ,
  18506. r.prototype.onTileRenderFail = function(e, t, i) {
  18507. e === this.id && this.emit(f.LoadFailed, t)
  18508. }
  18509. ,
  18510. r.prototype.isLoaded = function(e) {
  18511. if (this.tiled) {
  18512. if (e && "string" == typeof e)
  18513. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18514. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18515. }
  18516. if (e && "number" == typeof e)
  18517. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18518. return !!this.solidSkybox.high || e in this.solidSkybox
  18519. }
  18520. ,
  18521. r.prototype.loadCube = function(a) {
  18522. if (this.isLoaded(a))
  18523. return I.info("Skipping load of pano, already loaded"),
  18524. $.when();
  18525. this.emit("loading", a),
  18526. this.model.emit("loading", this);
  18527. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  18528. , e = n.filter(function(e) {
  18529. return !e
  18530. });
  18531. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18532. a = "high",
  18533. n = p.getCubemapUrls(this.model.urls, this.id, a));
  18534. var t = 0
  18535. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  18536. return u.getImage(n[t])
  18537. }
  18538. .bind(this));
  18539. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  18540. return this.solidSkybox[a] = [e, t, i, n, r, o],
  18541. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  18542. this.solidSkybox.low = null),
  18543. this.solidSkybox.needsUpdate = !0,
  18544. this.emit("load", a),
  18545. this.model.emit("load", this),
  18546. this
  18547. }
  18548. .bind(this), function() {
  18549. I.error("Downloading cubemap for pano", this.id, "failed"),
  18550. this.failedLoadingAt = Date.now()
  18551. }
  18552. .bind(this), function() {
  18553. return $.when(++t, 6)
  18554. })
  18555. }
  18556. ,
  18557. r.raycastsSkipped = 0,
  18558. r.raycastsDone = 0,
  18559. r.prototype.findNeighourPanos = function() {
  18560. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18561. this.model.panos.forEach(function(e) {
  18562. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18563. var t = this.position.distanceTo(e.position);
  18564. if (t > a.panoramaNeighbourMaxDistance)
  18565. return this.model.panos.setNeighbour(this, e, !1),
  18566. void r.raycastsSkipped++;
  18567. var i = e.position.clone().sub(this.position).normalize()
  18568. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  18569. r.raycastsDone++,
  18570. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18571. a.showNeighbourRaycasts && (n.length ? this.floor.model.add(new s.ArrowHelper(i,this.position,n[0].distance,16711680)) : this.floor.model.add(new s.ArrowHelper(i,this.position,t,16777215,0,0)))
  18572. }
  18573. }
  18574. .bind(this)),
  18575. this.model.panos.neighbourMap[this.id]
  18576. }
  18577. ,
  18578. r.prototype.worldPosition = function() {
  18579. return this.position
  18580. }
  18581. ,
  18582. r.prototype.addTextSprite = function(e, color, parent) {
  18583. this.removeTextSprite();
  18584. var ratio = 16;
  18585. var i = document.createElement("canvas")
  18586. , n = i.getContext("2d");
  18587. i.width = 1024,
  18588. i.height = i.width / ratio;
  18589. n.font = " 30px Arial",
  18590. n.fillStyle = "white";
  18591. var r = n.measureText(e).width;
  18592. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18593. var o = new s.Texture(i);
  18594. o.needsUpdate = !0;
  18595. var a = new s.SpriteMaterial({
  18596. map: o,
  18597. color: color || 16428055,
  18598. depthTest:false
  18599. });
  18600. this.text3d = new s.Sprite(a)
  18601. if(parent){
  18602. parent.add(this.text3d)
  18603. }else{
  18604. this.text3d.position.copy(this.skyboxMesh.position)
  18605. this.floor.add(this.text3d)
  18606. }
  18607. var scale = 5
  18608. this.text3d.scale.y = scale/ratio
  18609. this.text3d.scale.x = scale
  18610. }
  18611. ,
  18612. r.prototype.removeTextSprite = function() {
  18613. this.text3d && (this.text3d.parent.remove(this.text3d),
  18614. this.text3d.material.map.dispose(),
  18615. this.text3d = null)
  18616. }
  18617. ,
  18618. r.prototype.isAligned = function() {
  18619. return this.alignmentType === c.ALIGNED
  18620. }
  18621. ,
  18622. r.filters = {
  18623. inDirection: function(t, i, n) {
  18624. return function(e) {
  18625. return e.position.clone().sub(t).normalize().dot(i) > n
  18626. }
  18627. },
  18628. inFloorDirection: function(t, i, n) {
  18629. return function(e) {
  18630. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18631. }
  18632. },
  18633. inPanoDirection: function(n, r, o) {
  18634. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18635. function(e) {
  18636. var t = e.floorPosition.clone().sub(n).normalize()
  18637. , i = e.position.clone().sub(n).normalize();
  18638. return t.dot(r) > o || i.dot(r) > o
  18639. }
  18640. },
  18641. atFloor: function(t) {
  18642. return function(e) {
  18643. return !t || e.floor === t
  18644. }
  18645. },
  18646. not: function(t) {
  18647. return function(e) {
  18648. return e !== t
  18649. }
  18650. },
  18651. notIn: function(t) {
  18652. return function(e) {
  18653. return -1 === t.indexOf(e)
  18654. }
  18655. },
  18656. isLoaded: function() {
  18657. return function(e) {
  18658. return e.isLoaded()
  18659. }
  18660. },
  18661. isNotLoaded: function() {
  18662. return function(e) {
  18663. return !e.isLoaded()
  18664. }
  18665. },
  18666. isCloseEnoughTo: function(t, i) {
  18667. return function(e) {
  18668. return t.distanceTo(e.floorPosition) < i
  18669. }
  18670. },
  18671. hasMinimumHeightDifferenceTo: function(t, i) {
  18672. return function(e) {
  18673. return Math.abs(e.position.y - t.y) > i
  18674. }
  18675. },
  18676. isNotBehindNormal: function(t, i) {
  18677. var n = new s.Vector3;
  18678. return i = i.clone(),
  18679. function(e) {
  18680. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18681. }
  18682. },
  18683. isNeighbourPanoTo: function(t) {
  18684. return function(e) {
  18685. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18686. }
  18687. },
  18688. isNeighbourOfNeighbourTo: function(n) {
  18689. return function(i) {
  18690. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18691. var t = n.model.panos.get(e);
  18692. return !!t && t.neighbourPanos[i.id]
  18693. })
  18694. }
  18695. },
  18696. isNotRecentlyFailed: function(t) {
  18697. return function(e) {
  18698. return Date.now() - e.failedLoadingAt > t
  18699. }
  18700. },
  18701. isOnVisibleFloor: function() {
  18702. return function(e) {
  18703. return !e.floor.hidden
  18704. }
  18705. },
  18706. isPanoAligned: function() {
  18707. return function(e) {
  18708. return e.isAligned()
  18709. }
  18710. }
  18711. },
  18712. r.sortFunctions = {
  18713. distanceToPoint: function(i) {
  18714. return function(e, t) {
  18715. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18716. }
  18717. },
  18718. floorDistanceToPoint: function(i) {
  18719. return function(e, t) {
  18720. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18721. }
  18722. },
  18723. choose: function(i) {
  18724. return function(e, t) {
  18725. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18726. }
  18727. }
  18728. },
  18729. r.scoreFunctions = {
  18730. distance: function(t, i) {
  18731. return i = i || a.navigation.distanceFactor,
  18732. function(e) {
  18733. return t ? t.position.distanceTo(e.position) * i : 0
  18734. }
  18735. },
  18736. distanceSquared: function(t, i) {
  18737. return i = i || a.navigation.distanceFactor,
  18738. function(e) {
  18739. return t ? t.position.distanceToSquared(e.position) * i : 0
  18740. }
  18741. },
  18742. direction: function(t, i) {
  18743. return function(e) {
  18744. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18745. }
  18746. },
  18747. angle: function(t, i) {
  18748. return function(e) {
  18749. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18750. }
  18751. },
  18752. inFieldOfView: function(t, i) {
  18753. return function(e) {
  18754. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18755. }
  18756. },
  18757. optionality: function(t) {
  18758. return function(e) {
  18759. return e.neighbourUUIDs.filter(function(e) {
  18760. return !(e in t.neighbourUUIDs) && e !== t.id
  18761. }).length * a.navigation.optionalityFactor
  18762. }
  18763. },
  18764. penalizeHeightDifferenceUnder: function(t, i) {
  18765. return function(e) {
  18766. return t.y - e.position.y < i ? -20 : 0
  18767. }
  18768. }
  18769. },
  18770. M.exports = r
  18771. }
  18772. ).call(this, "/js/objects/Panorama.js")
  18773. }
  18774. , {
  18775. "../enum/AlignmentType": 17,
  18776. "../enum/GLCubeFaces": 25,
  18777. "../enum/PanoRendererEvents": 35,
  18778. "../enum/PanoSizeClass": 36,
  18779. "../enum/PanoramaEvents": 37,
  18780. "../enum/RenderLayers": 41,
  18781. "../enum/RenderOrder": 42,
  18782. "../enum/TileDownloaderEvents": 45,
  18783. "../enum/Viewmode": 51,
  18784. "../exception/BasicException": 55,
  18785. "../scene/SceneRenderer": 158,
  18786. "../settings": 166,
  18787. "../tile/TileUtils": 174,
  18788. "../util/ajax": 181,
  18789. "../util/common": 185,
  18790. "../util/lerp": 188,
  18791. "../util/logger": 189,
  18792. "../util/panorama": 191,
  18793. "../util/texture": 194,
  18794. "../util/transitions": 195,
  18795. events: 202,
  18796. three: 217
  18797. }],
  18798. 149: [function(e, t, i) {
  18799. "use strict";
  18800. function n(e) {
  18801. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18802. t.map.value = d,
  18803. t.opacity.value = 0,
  18804. t.color.value.set(o.reticuleColor),
  18805. t.showMouseMarker = !window.MP_PREFETCHED_MODELDATA.hideMouseMarker;
  18806. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18807. side: r.DoubleSide,
  18808. depthWrite: !1,
  18809. depthTest: !1,
  18810. transparent: !0,
  18811. vertexShader: c.waypoint.vertexShader,
  18812. fragmentShader: c.waypoint.fragmentShader,
  18813. uniforms: t,
  18814. name: "waypoint",
  18815. opacity: 0,
  18816. visible: t.showMouseMarker
  18817. })),
  18818. this.layers.set(h.RETICULE),
  18819. this.renderOrder = u.reticule,
  18820. this.player = e,
  18821. this.direction = new r.Vector3,
  18822. this.hidden = !0,
  18823. this.mouseLastMoveTime = Date.now()
  18824. }
  18825. var r = e("three")
  18826. , o = e("../settings")
  18827. , a = e("../util/transitions")
  18828. , s = e("../util/texture")
  18829. , l = e("../util/lerp")
  18830. , c = e("../shaders")
  18831. , h = e("../enum/RenderLayers")
  18832. , u = e("../enum/RenderOrder")
  18833. , d = s.load("images/reticule-256x256.png");
  18834. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18835. this.hidden = i,
  18836. this.mouseLastMoveTime = Date.now()
  18837. }
  18838. ,
  18839. n.prototype.hide = function() {
  18840. this.hidden || (this.hidden = !0,
  18841. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18842. }
  18843. ,
  18844. n.prototype.show = function() {
  18845. this.hidden = !1,
  18846. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18847. }
  18848. ,
  18849. n.prototype.update = function() {
  18850. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18851. }
  18852. ,
  18853. n.prototype.updatePosition = function(e, t) {
  18854. if (!this.hidden) {
  18855. if (!t)
  18856. return this.hide();
  18857. var i = t.point
  18858. , n = e.distanceTo(i)
  18859. , r = 1 + .01 * n;
  18860. n < 1 && (r -= 1 - n),
  18861. this.show(),
  18862. this.scale.set(r, r, r),
  18863. this.direction = this.direction.multiplyScalar(.8),
  18864. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18865. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18866. this.lookAt(this.position.clone().add(this.direction))
  18867. }
  18868. }
  18869. ,
  18870. n.prototype.writeAstag = function() {
  18871. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18872. , t = new Date;
  18873. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18874. var i = {
  18875. enabled: !0,
  18876. version: "0",
  18877. created: t.toISOString(),
  18878. created_by: "APITest",
  18879. position: this.position.clone(),
  18880. stem: {
  18881. enabled: o.tags.pole.enabled,
  18882. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18883. },
  18884. label: "tag " + this.tagCount,
  18885. description: "Description " + e,
  18886. floor: function(e) {
  18887. if (e.currentFloor) {
  18888. var t = e.floors.indexOf(e.currentFloor);
  18889. return -1 < t ? t : void 0
  18890. }
  18891. }(this.player.model),
  18892. type: "info",
  18893. metadata: {
  18894. preferred_camera: {
  18895. mode: this.player.mode
  18896. }
  18897. }
  18898. };
  18899. console.log("--------------------------"),
  18900. console.log(JSON.stringify(i));
  18901. var n = this.player.model.addtag(e, i).build();
  18902. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18903. n.visible || n.show(o.tags.startup.fadeInDuration))
  18904. }
  18905. ,
  18906. t.exports = n
  18907. }
  18908. , {
  18909. "../enum/RenderLayers": 41,
  18910. "../enum/RenderOrder": 42,
  18911. "../settings": 166,
  18912. "../shaders": 167,
  18913. "../util/lerp": 188,
  18914. "../util/texture": 194,
  18915. "../util/transitions": 195,
  18916. three: 217
  18917. }],
  18918. 150: [function(e, t, i) {
  18919. "use strict";
  18920. function n(e, t) {
  18921. this.chunks = [],
  18922. this.floorId = e,
  18923. this.roomId = t,
  18924. this.position = new l.Vector3
  18925. }
  18926. var l = e("three");
  18927. n.prototype.addChunk = function(e) {
  18928. this.chunks.push(e)
  18929. }
  18930. ,
  18931. n.prototype.calcBoundaries = function() {
  18932. for (var e = new l.Vector3, t = new l.Vector3(0,0,0), i = new l.Vector3(0,0,0), n = new l.Vector3(0,0,0), r = 0, o = 0; o < this.chunks.length; o++) {
  18933. var a = this.chunks[o].geometry.attributes.position;
  18934. if (a)
  18935. for (var s = 0; s < a.array.length; s += 3)
  18936. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18937. t.add(e),
  18938. 0 === s ? (i.copy(e),
  18939. n.copy(e)) : (i.max(e),
  18940. n.min(e)),
  18941. r++
  18942. }
  18943. 0 < r ? (t.multiplyScalar(1 / r),
  18944. this.average = t) : this.average = null,
  18945. this.boundsMax = i,
  18946. this.boundsMin = n,
  18947. this.center = new l.Vector3,
  18948. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18949. }
  18950. ,
  18951. t.exports = n
  18952. }
  18953. , {
  18954. three: 217
  18955. }],
  18956. 151: [function(o, v, e) {
  18957. (function(e) {
  18958. "use strict";
  18959. function t(e, t, i) {
  18960. this.obj3d = null,
  18961. this.nodes = [],
  18962. this.colorHull = [],
  18963. this.shortPaths = {},
  18964. this.floorHull = null,
  18965. this.cameraHull = null,
  18966. this.floorPathDistance = 0,
  18967. this.floorCurvePoints = null,
  18968. this.floorCurveColors = null,
  18969. this.camCurvePoints = null,
  18970. this.warpDestHeroLoc = null,
  18971. this.warpDestPano = null,
  18972. this.warpPathPoints = null,
  18973. this.warpPathLengths = [0],
  18974. this.warpLength = 0,
  18975. this.closeWarpDistance = 4,
  18976. this.UP = U.UP.clone(),
  18977. this.longestStep = 0,
  18978. this.upcomingTransType = null,
  18979. this.burnsDir = 1,
  18980. this.prevNextDist = 0,
  18981. this.nextI = 0,
  18982. this.activeTransType = null,
  18983. this.lastTransType = null,
  18984. this.bunnyObj = null,
  18985. this.director = e,
  18986. this.player = t,
  18987. this.playerControls = i,
  18988. this.modelManager = t.modelManager,
  18989. this.updateModel(),
  18990. this.updateDefaultsFromModelData(),
  18991. this.bindEvents(),
  18992. this.warping = !1,
  18993. this.waitingToWarp = !1,
  18994. this.warpInterrupted = !1,
  18995. this.warpInterruptionBlackoutStyle = null,
  18996. this.warpInterruptionTravelTime = null
  18997. }
  18998. var c, h, u, d, p, f, a, s, P = o("three"), i = o("../util/logger"), O = o("../enum/Viewmode"), A = o("../enum/RenderOrder"), L = o("../enum/WarpStyle"), D = o("../settings"), N = o("../util/math"), F = o("../util/lerp"), B = o("../util/easing"), V = o("../util/transitions"), l = o("../objects/Snapshot"), k = o("../effects"), C = o("../shaders"), n = (o("../gui/gui"),
  18999. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  19000. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  19001. path: n.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"),
  19002. pathEnd: n.load("images/End.png"),
  19003. pathStart: n.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==")
  19004. };
  19005. t.prototype.setScene = function(e) {
  19006. this.createCpm(e),
  19007. this.createBunnyObj(e)
  19008. }
  19009. ,
  19010. t.prototype.updateModel = function() {
  19011. this.model = this.modelManager.getActiveModel()
  19012. }
  19013. ,
  19014. t.prototype.bindEvents = function() {
  19015. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  19016. }
  19017. ,
  19018. t.prototype.updateDefaultsFromModelData = function() {
  19019. this.model.data
  19020. }
  19021. ,
  19022. t.prototype.pointPathDistance = function(e) {
  19023. for (var t = 0, i = 1; i < e.length; i += 1)
  19024. t += e[i - 1].distanceTo(e[i]);
  19025. return t
  19026. }
  19027. ,
  19028. t.prototype.pointPathLengths = function(e) {
  19029. for (var t = [0], i = 1; i < e.length; i += 1)
  19030. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  19031. return t
  19032. }
  19033. ,
  19034. t.prototype.interpAlongPath = function(e, t, i) {
  19035. var n, r = new P.Vector3, o = t[t.length - 1];
  19036. if (i < 1) {
  19037. n = i * o;
  19038. for (var a = 1; a < t.length; a += 1)
  19039. if (t[a] > n) {
  19040. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  19041. return r.copy(e[a]),
  19042. r.sub(e[a - 1]),
  19043. r.multiplyScalar(s),
  19044. r.add(e[a - 1]),
  19045. r
  19046. }
  19047. } else
  19048. r.copy(e[e.length - 1]);
  19049. return r
  19050. }
  19051. ,
  19052. t.prototype.pathHeight = function() {
  19053. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  19054. }
  19055. ,
  19056. t.prototype.createBunnyObj = function(e) {
  19057. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  19058. this.bunnyObj.visible = D.warp.showBunny),
  19059. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  19060. e.add(this.bunnyObj)
  19061. }
  19062. ,
  19063. t.prototype.createCpm = function(e) {
  19064. if (!this.currentPanoMarker) {
  19065. var t = this.makeWaypointObj(I.pathEnd, "Current");
  19066. t.material.uniforms.opacity.value = 0,
  19067. this.currentPanoMarker = {
  19068. mesh: t,
  19069. placed: !1
  19070. }
  19071. }
  19072. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19073. this.placeCpm(),
  19074. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  19075. }
  19076. ,
  19077. t.prototype.placeCpm = function() {
  19078. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  19079. var e = this.player.currentPano.floor;
  19080. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19081. e.add(this.currentPanoMarker.mesh)),
  19082. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  19083. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  19084. this.currentPanoMarker.placed = !0
  19085. } else
  19086. this.popOutCpm()
  19087. }
  19088. ,
  19089. t.prototype.fadeInCpm = function(e) {
  19090. this.player.mode === O.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || D.path.mapGuides && this.currentPanoMarker.placed && V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  19091. }
  19092. ,
  19093. t.prototype.fadeOutCpm = function(e) {
  19094. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  19095. }
  19096. ,
  19097. t.prototype.popInCpm = function() {
  19098. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  19099. }
  19100. ,
  19101. t.prototype.popOutCpm = function() {
  19102. this.fadeOutCpm(2)
  19103. }
  19104. ,
  19105. t.prototype.brushPrefs = {
  19106. linewidth: 7,
  19107. strokeWidth: 15,
  19108. cvSegments: 48,
  19109. paveStep: .1,
  19110. paveWidth: .2,
  19111. lookBlendDist: 3,
  19112. maxTurn: P.Math.degToRad(2)
  19113. },
  19114. t.prototype.panoPathDistance = function(e) {
  19115. var t = this.model.panos;
  19116. if (!e || e.length < 2)
  19117. return 0;
  19118. for (var i = [], n = 0; n < e.length; n += 1)
  19119. i.push(t.get(e[n]).floorPosition);
  19120. return this.pointPathDistance(i)
  19121. }
  19122. ,
  19123. t.prototype.loadTileTexture = function(t) {
  19124. var e = n.load(t, function(e) {
  19125. e.wrapS = P.RepeatWrapping,
  19126. e.wrapT = P.RepeatWrapping,
  19127. e.needsUpdate = !0,
  19128. H.debug('path texture "' + t + '" is ready')
  19129. }, function() {
  19130. H.error('path texture "' + t + '" failed')
  19131. });
  19132. return e.mapping = P.UVMapping,
  19133. e
  19134. }
  19135. ,
  19136. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  19137. return new l({
  19138. cameraMode: n,
  19139. position: e,
  19140. quaternion: t,
  19141. panoId: i,
  19142. orthoZoom: o,
  19143. floorVisibility: r,
  19144. thumbUrl: null,
  19145. name: null
  19146. })
  19147. }
  19148. ,
  19149. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  19150. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  19151. }
  19152. ,
  19153. t.prototype.setWarpDestination = function(e) {
  19154. this.warpDestHeroLoc = e
  19155. }
  19156. ,
  19157. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  19158. var t = this.getHeroDescriptorByHeroIndex(e);
  19159. return null !== t && (this.setWarpDestination(t),
  19160. !0)
  19161. }
  19162. ,
  19163. t.prototype.setWarpDestinationByPano = function(e, t) {
  19164. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  19165. }
  19166. ,
  19167. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  19168. var i = this.model.panos.get(e);
  19169. if (i) {
  19170. t = t || new P.Quaternion;
  19171. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  19172. return this.setWarpDestination(n),
  19173. !0
  19174. }
  19175. return !1
  19176. }
  19177. ,
  19178. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  19179. var t = this.model.heroCount();
  19180. if (null !== this.warpDestHeroLoc && t < 1)
  19181. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  19182. this.model.getHeroDescriptorByIndex(0);
  19183. var i = this.model.getHeroDescriptorByIndex(e);
  19184. if (i) {
  19185. var n = i.isPano() ? i.panoId : i.cameraMode;
  19186. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  19187. }
  19188. return i
  19189. }
  19190. ,
  19191. t.prototype.getHeroDescriptorByPano = function(e) {
  19192. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  19193. }
  19194. ,
  19195. t.prototype.getHeroDescriptorByPanoId = function(e) {
  19196. var t = this.getHeroIndexFromPanoId(e);
  19197. return this.getHeroDescriptorByHeroIndex(t)
  19198. }
  19199. ,
  19200. t.prototype.getHeroIndexFromPanoId = function(e) {
  19201. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19202. var i = this.model.heroLocations[t]
  19203. , n = this.getHeroId(i);
  19204. if (n && n === e)
  19205. return t
  19206. }
  19207. return -1
  19208. }
  19209. ,
  19210. t.prototype.getHeroPano = function(e) {
  19211. if (null === e)
  19212. return H.warn("getHeroPano(): no destination"),
  19213. null;
  19214. var t = this.getHeroId(e)
  19215. , i = this.model.panos.get(t);
  19216. return void 0 === i && (i = null,
  19217. "" !== t && H.debug('unable to find pano "' + t + '"')),
  19218. i
  19219. }
  19220. ,
  19221. t.prototype.getHeroId = function(e) {
  19222. return e.panoId
  19223. }
  19224. ,
  19225. t.prototype.setWarpDestPano = function() {
  19226. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  19227. this.warpDestPano
  19228. }
  19229. ,
  19230. t.prototype.brushToWarpPano = function(e, t) {
  19231. if (this.discardPathObject(),
  19232. !this.setWarpDestPano())
  19233. return !1;
  19234. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  19235. !this.warpDestPano)
  19236. return H.info("No brush"),
  19237. !1;
  19238. if (!this.player.currentPano)
  19239. return H.debug("No current pano, visibility undefined"),
  19240. !1;
  19241. if (!this.warpDestPano)
  19242. return H.info("No wPano, visibility undefined"),
  19243. !1;
  19244. if (!this.warpDestPano.isAligned())
  19245. return H.debug("Cannot brush to unaligned pano"),
  19246. !1;
  19247. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  19248. , n = !0;
  19249. if (this.player.currentPano.id === this.warpDestPano.id)
  19250. H.debug("Already at destination pano");
  19251. else {
  19252. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19253. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  19254. this.obj3d = new P.Object3D,
  19255. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  19256. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  19257. e = t) : (this.setPathHulls(this.nodes),
  19258. this.setFloorCurves(),
  19259. i && ("chevron" === D.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === D.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  19260. this.player.currentPano.floor.add(this.obj3d);
  19261. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  19262. , o = e === L.STD;
  19263. if (!n && (i || o)) {
  19264. if (r) {
  19265. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  19266. this.obj3d.add(a)
  19267. }
  19268. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  19269. this.obj3d.add(s)
  19270. }
  19271. this.appearSlow()
  19272. }
  19273. return this.upcomingTransType = e,
  19274. !n
  19275. }
  19276. ,
  19277. t.prototype.findShortestPath = function(e, t) {
  19278. if (!e || !t)
  19279. return null;
  19280. var i = D.warp.walkExtraPanosDistance
  19281. , n = e.id + ":" + t.id + ":" + i;
  19282. if (this.shortPaths.hasOwnProperty(n))
  19283. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  19284. var r = t.id + ":" + e.id + ":" + i;
  19285. if (this.shortPaths.hasOwnProperty(r))
  19286. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  19287. var o = this.model.panos.aStarSearch(e, t);
  19288. return this.model.panos.includeNodesNearPath(o, i),
  19289. this.shortPaths[n] = o ? o.slice() : null,
  19290. o
  19291. }
  19292. ,
  19293. t.prototype.makePathHulls = function(e) {
  19294. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  19295. r = (t = h.get(e[0])).floor.floorIndex;
  19296. for (var u = 0; u < e.length; u += 1)
  19297. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  19298. s.push(i),
  19299. l.push(t.position.clone()),
  19300. n = t.floor.floorIndex,
  19301. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  19302. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  19303. return a > this.longestStep && (this.longestStep = a,
  19304. H.debug("path contains " + a + " meter segment")),
  19305. {
  19306. floor: s,
  19307. camera: l,
  19308. color: c
  19309. }
  19310. }
  19311. ,
  19312. t.prototype.makeFloorCurves = function(e, t, i) {
  19313. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19314. , r = this.pointPathDistance(e) - 2 * n
  19315. , o = e.slice(0)
  19316. , a = o[1].clone().sub(o[0]);
  19317. a.y = 0,
  19318. a.normalize().multiplyScalar(n),
  19319. o[0] = (new P.Vector3).copy(o[0]).add(a),
  19320. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  19321. a.normalize().multiplyScalar(n),
  19322. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  19323. var s = new P.CatmullRomCurve3(o)
  19324. , l = Math.floor(r / i);
  19325. l = 4 * Math.floor(l / 4),
  19326. l = Math.max(4, l);
  19327. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  19328. h = 0,
  19329. c = u[f].distanceTo(e[0]);
  19330. for (var g = 1; g < e.length; g += 1)
  19331. p.copy(u[f]).sub(e[g]),
  19332. p.y *= 4,
  19333. p.length() < c && (h = g);
  19334. d.push(t[h])
  19335. }
  19336. return {
  19337. distance: r,
  19338. points: u,
  19339. colors: d
  19340. }
  19341. }
  19342. ,
  19343. t.prototype.makeCameraCurvePoints = function(e, t) {
  19344. var i = this.pointPathDistance(e);
  19345. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19346. }
  19347. ,
  19348. t.prototype.makeCameraCurveTangents = function(e, t) {
  19349. var i = this.pointPathDistance(e)
  19350. , n = new P.CatmullRomCurve3(e)
  19351. , r = Math.max(2, Math.floor(i / t));
  19352. r = r || 5;
  19353. for (var o = [], a = 0; a <= r; a++)
  19354. o.push(n.getTangentAt(a / r));
  19355. return o
  19356. }
  19357. ,
  19358. t.prototype.setPathHulls = function(e) {
  19359. var t = this.makePathHulls(e);
  19360. this.floorHull = t.floor,
  19361. this.cameraHull = t.camera,
  19362. this.colorHull = t.color
  19363. }
  19364. ,
  19365. t.prototype.setFloorCurves = function() {
  19366. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  19367. this.floorPathDistance = e.distance,
  19368. this.floorCurvePoints = e.points,
  19369. this.floorCurveColors = e.colors
  19370. }
  19371. ,
  19372. t.prototype.setCameraCurvePoints = function() {
  19373. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  19374. }
  19375. ,
  19376. t.prototype.chooseWarpPath = function(e) {
  19377. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  19378. if (this.player.currentPano === this.warpDestPano || !e)
  19379. return this.warpPathPoints = null,
  19380. this.warpLength = 0,
  19381. !1;
  19382. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19383. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  19384. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  19385. t.multiplyScalar(.15).add(r.position),
  19386. i.multiplyScalar(.15).add(this.warpDestPano.position),
  19387. t.y = r.position.y,
  19388. i.y = this.warpDestPano.position.y,
  19389. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  19390. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  19391. this.setCameraCurvePoints(),
  19392. this.warpPathPoints = this.camCurvePoints.slice(0)),
  19393. this.warpLength = 0,
  19394. this.warpPathLengths = [0];
  19395. for (var o = new P.Vector3, a = new P.Vector3, s = Math.cos(P.Math.degToRad(D.warp.minBrakeAngle)), l = Math.cos(P.Math.degToRad(D.warp.maxBrakeAngle)), c = 1; c < this.warpPathPoints.length; c += 1) {
  19396. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  19397. var h = o.length();
  19398. o.y *= D.warp.climbEffort;
  19399. var u = o.length() / h;
  19400. if (1 < c) {
  19401. o.setY(0).normalize(),
  19402. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  19403. var d = Math.min(1, o.dot(a))
  19404. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  19405. u = Math.max(p, u)
  19406. }
  19407. this.warpLength += h * u,
  19408. this.warpPathLengths[c] = this.warpLength
  19409. }
  19410. return !0
  19411. }
  19412. ,
  19413. t.prototype.drawPathRibbon = function(e, t) {
  19414. this.bunnyObj.visible = D.warp.showBunny;
  19415. for (var i = .6 * D.path.ribbonWidth * .5, n = new P.Vector3, r = new P.Vector3(0,this.pathHeight(),0), o = new P.Geometry, a = new P.Vector3, s = 0; s < e.length; s += 1) {
  19416. a.copy(e[s]),
  19417. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  19418. a.normalize(),
  19419. n.crossVectors(a, U.UP),
  19420. n.multiplyScalar(i);
  19421. var l = (new P.Vector3).copy(e[s]).add(r);
  19422. l.sub(n),
  19423. o.vertices.push(l),
  19424. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  19425. o.vertices.push(l)
  19426. }
  19427. var c, h, u, d = 0;
  19428. for (s = 0; s < e.length - 1; s += 1) {
  19429. var p = 2 * s
  19430. , f = d
  19431. , g = d += e[s + 1].distanceTo(e[s])
  19432. , m = t[s]
  19433. , v = t[s + 1];
  19434. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  19435. o.faces.push(c),
  19436. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  19437. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  19438. o.faces.push(c),
  19439. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  19440. }
  19441. o.computeFaceNormals(),
  19442. o.computeVertexNormals(),
  19443. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  19444. u.opacity.value = 0,
  19445. u.color.value.set(D.path.color),
  19446. new P.RawShaderMaterial({
  19447. side: P.DoubleSide,
  19448. depthWrite: !1,
  19449. transparent: !0,
  19450. vertexShader: C.ribbon.vertexShader,
  19451. fragmentShader: C.ribbon.fragmentShader,
  19452. uniforms: u,
  19453. name: "ribbonT",
  19454. opacity: 0
  19455. })) : new P.MeshBasicMaterial({
  19456. color: 16777215,
  19457. side: P.DoubleSide,
  19458. name: "ribbonOut",
  19459. vertexColors: P.VertexColors
  19460. });
  19461. var y = new P.Mesh(o,h);
  19462. return y.name = "ribbon",
  19463. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  19464. y
  19465. }
  19466. ,
  19467. t.prototype.drawPathPavement = function(e) {
  19468. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  19469. r.copy(e[o]),
  19470. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  19471. r.normalize(),
  19472. i.crossVectors(r, U.UP),
  19473. i.multiplyScalar(this.brushPrefs.paveWidth),
  19474. (t = (new P.Vector3).copy(e[o])).sub(i),
  19475. n.vertices.push(t),
  19476. n.vertices.push((new P.Vector3).copy(e[o])),
  19477. (t = (new P.Vector3).copy(e[o])).add(i),
  19478. n.vertices.push(t);
  19479. var a, s, l;
  19480. for (o = 0; o < e.length - 1; o += 1)
  19481. a = 3 * o + 1,
  19482. l = .25 + (s = .25 * o),
  19483. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  19484. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  19485. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  19486. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  19487. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  19488. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  19489. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  19490. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  19491. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  19492. color: D.path.color,
  19493. side: P.DoubleSide,
  19494. transparent: !0,
  19495. depthWrite: !1,
  19496. opacity: 0,
  19497. name: "paveT",
  19498. map: I.path
  19499. }) : new P.MeshBasicMaterial({
  19500. color: D.path.color,
  19501. side: P.DoubleSide,
  19502. transparent: !0,
  19503. depthWrite: !1,
  19504. opacity: 1,
  19505. name: "paveO",
  19506. map: I.path
  19507. });
  19508. return new P.Mesh(n,c)
  19509. }
  19510. ,
  19511. t.prototype.hintPrefs = {
  19512. rad: .18,
  19513. width: .0125,
  19514. depth: .0625,
  19515. setBack: -.04,
  19516. markRad: .25,
  19517. markInnerRad: .16
  19518. },
  19519. t.prototype.makeWaypointObj = function(e, t) {
  19520. var i = new P.Geometry
  19521. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19522. , r = this.pathHeight();
  19523. i.vertices.push(new P.Vector3(-n,r,n), new P.Vector3(-n,r,-n), new P.Vector3(n,r,-n), new P.Vector3(n,r,n)),
  19524. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  19525. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  19526. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  19527. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  19528. o.map.value = e,
  19529. o.opacity.value = 0,
  19530. o.color.value.set(D.path.color);
  19531. var a = {
  19532. side: P.DoubleSide,
  19533. depthWrite: !1,
  19534. transparent: !0,
  19535. vertexShader: C.waypoint.vertexShader,
  19536. fragmentShader: C.waypoint.fragmentShader,
  19537. uniforms: o,
  19538. name: "waypoint",
  19539. opacity: 0
  19540. };
  19541. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  19542. a.name = "wayPtOut");
  19543. var s = new P.RawShaderMaterial(a)
  19544. , l = new P.Mesh(i,s);
  19545. return l.name = t,
  19546. l
  19547. }
  19548. ,
  19549. t.prototype.makeStartMarker = function(e, t) {
  19550. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  19551. i.y = 0,
  19552. i.normalize();
  19553. var n = Math.acos(i.x)
  19554. , r = this.makeWaypointObj(I.pathStart, "Start");
  19555. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  19556. r.position.copy(e),
  19557. r
  19558. }
  19559. ,
  19560. t.prototype.makeEndMarker = function(e) {
  19561. var t = this.makeWaypointObj(I.pathEnd, "End")
  19562. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19563. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19564. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  19565. t.position.copy(e),
  19566. t
  19567. }
  19568. ,
  19569. t.prototype.pathClean = function(e) {
  19570. if (e) {
  19571. for (var t in e.children)
  19572. this.pathClean(e.children[t]);
  19573. e.geometry && e.geometry.dispose(),
  19574. e.material && e.material.dispose()
  19575. }
  19576. }
  19577. ,
  19578. t.prototype.discardPathObject = function() {
  19579. if (this.obj3d) {
  19580. var e = this.obj3d.parent;
  19581. e && e.remove(this.obj3d),
  19582. this.pathClean(this.obj3d)
  19583. }
  19584. this.obj3d = null,
  19585. this.popInCpm()
  19586. }
  19587. ,
  19588. t.prototype.discardSlow = function() {
  19589. if (this.obj3d) {
  19590. if (this.player.mode !== O.PANORAMA)
  19591. return void this.discardPathObject();
  19592. for (var e, t = 0, i = function() {
  19593. this.discardPathObject()
  19594. }
  19595. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  19596. void 0 !== (e = this.obj3d.children[n]).material && !0 === e.material.transparent && (void 0 !== e.material.uniforms ? V.start(F.property(e.material.uniforms.opacity, "value", 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing]) : V.start(F.property(e.material, "opacity", 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing]),
  19597. t += 1,
  19598. i = null);
  19599. 0 === t && this.discardPathObject(),
  19600. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19601. }
  19602. }
  19603. ,
  19604. t.prototype.appearSlow = function() {
  19605. var e;
  19606. this.fadeOutCpm(D.path.fadeInTime);
  19607. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19608. void 0 !== (e = this.obj3d.children[i]).material && !0 === e.material.transparent && (void 0 !== e.material.uniforms ? V.start(F.property(e.material.uniforms.opacity, "value", t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing]) : V.start(F.property(e.material, "opacity", t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing]))
  19609. }
  19610. ,
  19611. t.prototype.update = function() {
  19612. this.obj3d && this.obj3d.updateMatrixWorld()
  19613. }
  19614. ,
  19615. t.prototype.calcBurnsAmount = function(e) {
  19616. var n = P.Math.degToRad(D.warp.burnsAngle);
  19617. if (this.player.mode !== O.PANORAMA)
  19618. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19619. var t = this.burnsDir * n;
  19620. if (this.upcomingTransType === L.BLACK)
  19621. return t;
  19622. var i = e;
  19623. if (null === i)
  19624. return H.warn("Transition request for non-highlight"),
  19625. t;
  19626. var r = this.getHeroDescriptorByHeroIndex(i);
  19627. if (null === r)
  19628. return t;
  19629. if (!r.isPano())
  19630. return t;
  19631. function o(e) {
  19632. var t = Math.acos(Math.min(1, e.dot(l)))
  19633. , i = (new P.Vector3).crossVectors(l, e);
  19634. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19635. }
  19636. var a = this.getHeroPano(r)
  19637. , s = this.playerControls.cameras[O.PANORAMA]
  19638. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19639. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19640. if (a === this.player.currentPano)
  19641. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19642. var h = this.findShortestPath(this.player.currentPano, a);
  19643. if (null == h || h.length < 1)
  19644. return H.debug("Empty path ahead..."),
  19645. t;
  19646. var u = this.makePathHulls(h)
  19647. , d = new P.CatmullRomCurve3(u.camera)
  19648. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19649. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19650. }
  19651. ,
  19652. t.prototype.waitNextStep = function(e, t, i) {
  19653. var o = null == i ? D.warp.tourStepDelay : i;
  19654. o = o || (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19655. var a = new P.Euler
  19656. , s = new P.Vector3;
  19657. H.debug("Starting wait: " + (void 0 !== t));
  19658. var l = this.calcBurnsAmount(e)
  19659. , c = function() {
  19660. this.endWarpState(),
  19661. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19662. t && t()
  19663. }
  19664. .bind(this)
  19665. , n = function(e, t) {
  19666. if (this.warpInterrupted)
  19667. return c(),
  19668. !0;
  19669. var i = t || 1e3 / 60;
  19670. if (D.warp.doBurns)
  19671. if (this.player.mode === O.PANORAMA) {
  19672. var n = this.playerControls.cameras[O.PANORAMA];
  19673. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19674. var r = i * l / o;
  19675. r = Math.sign(r) * Math.max(r, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  19676. a.y += r,
  19677. s.set(0, 0, -1),
  19678. s.applyEuler(a),
  19679. s.add(n.position),
  19680. n.controls.lookAt(s),
  19681. n.controls.lookVector.copy(s),
  19682. n.lookAt(s)
  19683. } else
  19684. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19685. }
  19686. .bind(this);
  19687. this.startWarpState(),
  19688. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19689. }
  19690. ,
  19691. t.prototype.warpToNonPano = function(e) {
  19692. if (this.discardPathObject(),
  19693. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19694. var t = function() {
  19695. e && e()
  19696. }
  19697. .bind(this);
  19698. this.player.flyToNewMode({
  19699. mode: this.warpDestHeroLoc.cameraMode,
  19700. duration: D.warp.outsideTime,
  19701. warpDest: this.warpDestHeroLoc,
  19702. callback: t,
  19703. force: !0
  19704. })
  19705. } else
  19706. H.warn("no warp destination!!!"),
  19707. e && e()
  19708. }
  19709. ,
  19710. t.prototype._resetWarpShaderParams = function(e) {
  19711. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19712. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19713. }
  19714. ,
  19715. t.prototype._clearWarpShading = function() {
  19716. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19717. this._resetWarpShaderParams(e[t]),
  19718. e[t].visible = !0;
  19719. this._resetWarpShaderParams(this.model.skybox)
  19720. }
  19721. ,
  19722. t.prototype._warpStopFlying = function() {
  19723. this.activeTransType = null,
  19724. this.placeCpm()
  19725. }
  19726. ,
  19727. t.prototype._wrapupTravelOnlyBits = function() {
  19728. this._warpStopFlying(),
  19729. this.warpPathPoints && (this.player.currentPano.exit(),
  19730. this.warpDestPano.enter(),
  19731. this.player.currentPano = this.warpDestPano),
  19732. this.player.spider.draw(),
  19733. this.placeCpm()
  19734. }
  19735. ,
  19736. t.prototype._wrapupTravel = function(e) {
  19737. this._wrapupTravelOnlyBits(),
  19738. this.warpCameraAim(e)
  19739. }
  19740. ,
  19741. t.prototype._wrapupWarpShading = function(e) {
  19742. this._clearWarpShading(),
  19743. this._wrapupTravel(e)
  19744. }
  19745. ,
  19746. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19747. t !== z.END && this._clearWarpShading(),
  19748. this._wrapupTravelOnlyBits(),
  19749. this.upcomingTransType = null,
  19750. e && e()
  19751. }
  19752. ,
  19753. t.prototype._warpCameraAim = function(e, t) {
  19754. var i = this.warpDestHeroLoc.quaternion
  19755. , n = this.playerControls.cameras[O.PANORAMA]
  19756. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19757. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19758. , a = P.Math.radToDeg(Math.acos(o))
  19759. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19760. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19761. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19762. c.y = N.constrainedTurn(c.y),
  19763. this.burnsDir = Math.sign(c.y);
  19764. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19765. , u = new P.Vector3
  19766. , d = function(e, t) {
  19767. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19768. h.y = l.y + e * c.y,
  19769. h.z = l.z + e * c.z,
  19770. u.set(0, 0, -1),
  19771. u.applyEuler(h),
  19772. u.add(n.position),
  19773. n.controls.lookAt(u),
  19774. n.controls.lookVector.copy(u),
  19775. void n.lookAt(u))
  19776. }
  19777. .bind(this);
  19778. /* return a > D.warp.minRotation ? (V.start(d, e, t, 0, B[D.warp.movementEasing])
  19779. , (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19780. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19781. )
  19782. : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19783. void (t && t())) */
  19784. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19785. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19786. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing])
  19787. : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19788. void (t && t()))
  19789. }
  19790. ,
  19791. t.prototype._warpBendAim = function(e, t, i, n) {
  19792. var r = n || 0
  19793. , o = this.playerControls.cameras[O.PANORAMA]
  19794. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19795. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19796. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19797. l.y = N.constrainedTurn(l.y);
  19798. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19799. l.x = c * Math.sign(l.x),
  19800. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19801. this.burnsDir = Math.sign(l.y),
  19802. c *= Math.sign(l.y),
  19803. l.y = c;
  19804. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19805. , u = new P.Vector3
  19806. , d = function(e, t) {
  19807. if (e < .5)
  19808. h.x = s.x + e * l.x,
  19809. h.y = s.y + e * l.y,
  19810. h.z = s.z + e * l.z;
  19811. else {
  19812. var i = (1 - e) * D.warp.softBendEnd;
  19813. h.x = a.x - i * l.x,
  19814. h.y = a.y - i * l.y,
  19815. h.z = a.z - i * l.z
  19816. }
  19817. u.set(0, 0, -1),
  19818. u.applyEuler(h),
  19819. u.add(o.position),
  19820. o.controls.lookAt(u),
  19821. o.controls.lookVector.copy(u),
  19822. o.lookAt(u)
  19823. }
  19824. .bind(this);
  19825. return V.start(d, t, i, r, B[D.warp.movementEasing])
  19826. }
  19827. ,
  19828. t.prototype._warpStepCameraAim = function(e, t, i) {
  19829. var n = this.playerControls.cameras[O.PANORAMA]
  19830. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19831. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19832. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19833. a.y = N.constrainedTurn(a.y),
  19834. this.burnsDir = Math.sign(a.y);
  19835. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19836. , l = new P.Vector3
  19837. , c = function(e, t) {
  19838. e < .5 ? s.copy(o) : s.copy(r),
  19839. l.set(0, 0, -1),
  19840. l.applyEuler(s),
  19841. l.add(n.position),
  19842. n.controls.lookAt(l),
  19843. n.controls.lookVector.copy(l),
  19844. n.lookAt(l)
  19845. }
  19846. .bind(this);
  19847. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19848. }
  19849. ,
  19850. t.prototype.setBurnsDir = function() {
  19851. var e = this.playerControls.cameras[O.PANORAMA]
  19852. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19853. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19854. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19855. n.y = N.constrainedTurn(n.y),
  19856. this.burnsDir = Math.sign(n.y)
  19857. }
  19858. ,
  19859. t.prototype.stepWarpPath = function(e, t) {
  19860. var i = this.playerControls.cameras[O.PANORAMA];
  19861. if (!this.warpPathPoints)
  19862. return i.position.copy(this.warpDestPano.position),
  19863. !0;
  19864. var n = this.warpPathPoints[0]
  19865. , r = this.warpDestPano.position;
  19866. if (null !== this.nodes && 1 < this.cameraHull.length) {
  19867. var o = new P.Vector3;
  19868. e < .5 ? o.copy(this.cameraHull[1]).sub(n).normalize().multiplyScalar(D.warp.softPushDist * e).add(n) : o.copy(this.cameraHull[this.cameraHull.length - 2]).sub(r).normalize().multiplyScalar(D.warp.softPushDist * D.warp.softPushEnd * (1 - e)).add(r),
  19869. i.position.copy(o)
  19870. } else
  19871. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19872. }
  19873. ,
  19874. t.prototype.interruptAndFastForward = function(e, t) {
  19875. this.warping && (this.warpInterrupted = !0,
  19876. this.warpInterruptionBlackoutStyle = e,
  19877. this.warpInterruptionTravelTime = t,
  19878. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19879. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19880. }
  19881. ,
  19882. t.prototype.warpCameraAim = function(e) {
  19883. var t = D.warp.minWarpTime;
  19884. if (this.upcomingTransType === L.BLACK)
  19885. t = D.warp.teleportTime;
  19886. else {
  19887. var i = this.playerControls.cameras[O.PANORAMA]
  19888. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19889. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19890. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19891. o.y = N.constrainedTurn(o.y);
  19892. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19893. t = Math.max(t, a)
  19894. }
  19895. var s = function() {
  19896. this._warpStopFlying(),
  19897. this.discardSlow(),
  19898. e && e()
  19899. }
  19900. .bind(this);
  19901. this._warpCameraAim(t, s)
  19902. }
  19903. ,
  19904. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19905. this.model.skybox.material.uniforms.blackout.value = n;
  19906. var r = F.uniform(this.model.skybox, "progress", 1)
  19907. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19908. , a = !1
  19909. , s = function() {
  19910. if (this.warpInterrupted)
  19911. return a = !0
  19912. }
  19913. .bind(this)
  19914. , l = function(e, t) {
  19915. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19916. }
  19917. .bind(this)
  19918. , c = function(e, t) {
  19919. return i && a ? (o(0),
  19920. !0) : void o(e, t)
  19921. }
  19922. .bind(this);
  19923. V.start(s, e, null, t, null, "safeHaltWatch"),
  19924. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19925. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19926. }
  19927. ,
  19928. t.prototype.warpTravel_STD = function(e) {
  19929. var l, c = Math.min(D.warp.lookAheadMax, D.warp.lookAheadDist / this.warpLength), h = this.playerControls.cameras[O.PANORAMA], i = (Math.min(.25, 3 / this.warpLength),
  19930. Math.min(.35, 7 / this.warpLength)), u = new P.Euler(0,0,0,D.warp.eOrder), d = new P.Vector3, p = (new P.Euler).setFromQuaternion(h.quaternion, D.warp.eOrder), f = (new P.Euler).copy(p), g = h.position.clone(), m = new P.Matrix4, v = new P.Euler, t = D.warp.minWarpTime;
  19931. t += this.warpLength * D.warp.timePerMeter,
  19932. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19933. function n(e) {
  19934. var t = i;
  19935. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19936. }
  19937. var y = !1
  19938. , r = this.warpDestHeroLoc.quaternion
  19939. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19940. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19941. , a = A.dot(o)
  19942. , C = P.Math.radToDeg(Math.acos(a))
  19943. , s = function() {
  19944. return m.lookAt(g, l, U.UP),
  19945. u.setFromRotationMatrix(m, D.warp.eOrder),
  19946. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19947. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19948. N.constrainedTurn(v.y)
  19949. }
  19950. .bind(this)
  19951. , I = function(e, t) {
  19952. if (this.warpInterrupted)
  19953. return y = !0
  19954. }
  19955. .bind(this)
  19956. , E = function(e, t) {
  19957. return y || !this.warpPathPoints ? (k.blur(0),
  19958. !0) : void k.blur(e)
  19959. }
  19960. .bind(this)
  19961. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19962. , b = function(e, t) {
  19963. return y || !this.warpPathPoints ? (_(0),
  19964. !0) : void _(e, t)
  19965. }
  19966. .bind(this)
  19967. , w = function(e, t) {
  19968. if (!this.warpPathPoints)
  19969. return h.position.copy(this.warpDestPano.position),
  19970. !0;
  19971. if (y)
  19972. return !0;
  19973. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19974. h.position.copy(i),
  19975. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19976. }
  19977. .bind(this)
  19978. , T = function(e, t) {
  19979. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19980. !0)
  19981. }
  19982. .bind(this)
  19983. , x = function(e, t) {
  19984. if (y)
  19985. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19986. !0;
  19987. if (!this.warpPathPoints)
  19988. return !0;
  19989. var i = this.warpLength * e
  19990. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19991. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19992. D.warp.matchCam && (n *= 1 - r),
  19993. m.lookAt(g, l, U.UP),
  19994. u.setFromRotationMatrix(m, D.warp.eOrder),
  19995. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19996. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19997. v.y = N.constrainedTurn(v.y),
  19998. u.x = p.x + n * v.x,
  19999. u.y = p.y + n * v.y,
  20000. u.z = p.z + n * v.z,
  20001. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  20002. v.y = N.constrainedTurn(v.y);
  20003. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  20004. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  20005. f.x = f.x + v.x * D.warp.turnFriction,
  20006. f.y = f.y + v.y * D.warp.turnFriction,
  20007. f.z = f.z + v.z * D.warp.turnFriction,
  20008. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  20009. var a = l.clone().sub(g).normalize();
  20010. if (C < D.warp.maxAimRotation && 0 < r) {
  20011. var s = 1 - r;
  20012. a.x = a.x * s + r * A.x,
  20013. a.y = a.y * s + r * A.y,
  20014. a.z = a.z * s + r * A.z,
  20015. a.normalize()
  20016. }
  20017. this.bunnyObj.position.copy(h.position).add(a),
  20018. d.set(0, 0, -1).applyEuler(f).normalize(),
  20019. d.multiplyScalar(8),
  20020. d.add(h.position),
  20021. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  20022. h.controls.lookVector.copy(d),
  20023. h.lookAt(d))
  20024. }
  20025. .bind(this)
  20026. , S = function() {
  20027. y ? (this.discardSlow(),
  20028. this.upcomingTransType = L.BLACK,
  20029. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  20030. }
  20031. .bind(this);
  20032. T(0);
  20033. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  20034. , R = M / (t += M);
  20035. this.warpCommonParameters(t, R, !0, z.NONE),
  20036. V.start(I, t, null, 0, null, "_haltWatcher"),
  20037. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  20038. V.start(E, t, null, R, n, "blurring")),
  20039. V.start(b, t, null, R, n, "modelAlpha"),
  20040. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  20041. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  20042. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  20043. }
  20044. ,
  20045. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  20046. var r = e || 0;
  20047. null != t || (t = D.warp.teleportTime),
  20048. this.warpCommonParameters(t, r, !1, i),
  20049. this.model.chunks.forEach(function(e) {
  20050. e.material.uniforms.blackout.value = i
  20051. }),
  20052. this._warpBendAim(null, t, null, r);
  20053. var o = function() {
  20054. this.wrapupWarpShadingOnly(n, i)
  20055. }
  20056. .bind(this);
  20057. V.start(this.stepWarpPath.bind(this), t, o, r, B[D.warp.blendEasing], "stepMotion")
  20058. }
  20059. ,
  20060. t.prototype.flightStepWalk = (a = new P.Vector3,
  20061. s = new P.Vector3,
  20062. function(e, t, i) {
  20063. if (this.warpInterrupted)
  20064. i && i();
  20065. else if (this.activeTransType !== L.WALK)
  20066. this._clearWarpShading(),
  20067. this._warpStopFlying(),
  20068. this.player.spider.draw(),
  20069. this.placeCpm(),
  20070. i && i();
  20071. else if (this.player.currentPano !== e) {
  20072. var n = {
  20073. pano: e,
  20074. lookAtPoint: t,
  20075. duration: null,
  20076. maxDistanceOverride: D.warp.walkMaxDist,
  20077. skipWarpingCheck: !1,
  20078. constantMoveSpeed: !0
  20079. };
  20080. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  20081. n.zoomLevel = this.warpDestHeroLoc.zoom
  20082. }
  20083. n.duration = function(e, t) {
  20084. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  20085. s.copy(U.FORWARD),
  20086. this.player.getDirection(s),
  20087. a.copy(t).sub(e.position).normalize();
  20088. var n = a.dot(s)
  20089. , r = Math.acos(n)
  20090. , o = r / i;
  20091. return .001 < o && (i *= o / .001,
  20092. r < 1 && (i *= 1.2)),
  20093. i
  20094. }
  20095. .call(this, e, t),
  20096. this.player.nonInterruptingFlyToPano(n, i)
  20097. } else
  20098. i && i()
  20099. }
  20100. ),
  20101. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  20102. return this.flightStepWalk.bind(this, e, t, i)
  20103. }
  20104. ,
  20105. t.prototype.warpTravel_WALK = (f = [],
  20106. function(e) {
  20107. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  20108. var o = this.nodes[r]
  20109. , a = t.get(o);
  20110. this.nodes.length,
  20111. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  20112. i && n || (f.push(o),
  20113. i = a)
  20114. }
  20115. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  20116. var s = f.length
  20117. , l = t.get(f[s - 1])
  20118. , c = new Array(s + 1);
  20119. c[c.length - 1] = function() {
  20120. e && e()
  20121. }
  20122. .bind(this);
  20123. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  20124. var d = f[h];
  20125. l = t.get(d);
  20126. var p = new P.Vector3;
  20127. this.getLookAtForWalkingTourNode(f, h, p),
  20128. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  20129. h--
  20130. }
  20131. c[0]()
  20132. }
  20133. ),
  20134. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  20135. h = new P.Vector3,
  20136. u = new P.Vector3,
  20137. d = new P.Vector3,
  20138. p = new P.Vector3,
  20139. function(e, t, i) {
  20140. var n = e.length;
  20141. if (n <= t)
  20142. return !1;
  20143. var r = 1
  20144. , o = 1;
  20145. h.set(0, 0, 0),
  20146. p.set(0, 0, 0);
  20147. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  20148. if (a = this.player.model.panos.get(e[s]),
  20149. this.getOrientationForWalkingTourNode(e, s, u),
  20150. s === t && c.copy(u),
  20151. d.copy(u),
  20152. t < s) {
  20153. var l = d.dot(c) < .65;
  20154. r *= l ? .2 : .75,
  20155. o *= l ? .2 : .4
  20156. }
  20157. u.multiplyScalar(r),
  20158. h.add(u),
  20159. p.lerp(a.position, o)
  20160. }
  20161. return h.normalize(),
  20162. i.copy(p),
  20163. i.add(h),
  20164. !0
  20165. }
  20166. ),
  20167. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  20168. var n = e.length;
  20169. if (n <= t)
  20170. return !1;
  20171. if (t === n - 1)
  20172. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  20173. else {
  20174. var r = this.player.model.panos.get(e[t])
  20175. , o = this.player.model.panos.get(e[t + 1]);
  20176. i.copy(o.position).sub(r.position)
  20177. }
  20178. return i.normalize(),
  20179. !0
  20180. }
  20181. ,
  20182. t.prototype.warpCameraTravel = function(e, t, i, n) {
  20183. if (this.activeTransType = this.upcomingTransType,
  20184. this.lastTransType = this.activeTransType,
  20185. this.upcomingTransType = null,
  20186. e)
  20187. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  20188. this._clearWarpShading(),
  20189. this._warpStopFlying(),
  20190. this.player.spider.draw(),
  20191. this.placeCpm(),
  20192. n && n()
  20193. }
  20194. .bind(this)) : this.warpTravel_STD(n);
  20195. else {
  20196. var r = function() {
  20197. this._wrapupTravel(n)
  20198. }
  20199. .bind(this)
  20200. , o = {
  20201. pano: this.warpDestPano,
  20202. lookAtPoint: null,
  20203. duration: null,
  20204. maxDistanceOverride: null,
  20205. skipWarpingCheck: !1
  20206. };
  20207. this.player.flyToPano(o, r)
  20208. }
  20209. }
  20210. ,
  20211. t.prototype.startWarpState = function() {
  20212. this.warping = !0,
  20213. this.warpInterrupted = !1,
  20214. this.warpInterruptionBlackoutStyle = null,
  20215. this.warpInterruptionTravelTime = null
  20216. }
  20217. ,
  20218. t.prototype.endWarpState = function() {
  20219. this.warping = !1
  20220. }
  20221. ,
  20222. t.prototype.warpToPano = function(e, t, i, n) {
  20223. if (this.warping)
  20224. H.warn("Cannot warp when already warping");
  20225. else {
  20226. if (this.upcomingTransType = e,
  20227. this.activeTransType = null,
  20228. !this.setWarpDestPano())
  20229. return this.upcomingTransType = null,
  20230. void this.warpToNonPano(n);
  20231. if (this.player.mode !== O.PANORAMA)
  20232. return this.upcomingTransType = null,
  20233. this.discardSlow(),
  20234. void this.player.flyToNewMode({
  20235. mode: O.PANORAMA,
  20236. pano: this.warpDestPano,
  20237. duration: D.warp.outsideTime,
  20238. warpDest: this.warpDestHeroLoc,
  20239. callback: n,
  20240. force: !0
  20241. });
  20242. if (!this.warpDestPano)
  20243. return H.warn("no warp destination, callback dropped"),
  20244. void (this.upcomingTransType = null);
  20245. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) && this.warpDestPano !== this.player.currentPano && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < D.warp.nearPanoDist)
  20246. , o = this.chooseWarpPath(r);
  20247. if (o && this.upcomingTransType !== L.WALK) {
  20248. var a = function() {
  20249. this.waitingToWarp = !1,
  20250. this.warpToPano(e, t, i, n)
  20251. }
  20252. .bind(this);
  20253. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  20254. return void (this.waitingToWarp = !0)
  20255. }
  20256. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  20257. this.player.currentPano = this.warpDestPano,
  20258. this.placeCpm(),
  20259. this.fadeOutCpm(D.path.fadeOutTime),
  20260. this.player.spider.draw()),
  20261. H.debug("Warping to pano ", this.warpDestPano.position),
  20262. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  20263. this.startWarpState();
  20264. var s = function() {
  20265. this.endWarpState(),
  20266. n && n()
  20267. }
  20268. .bind(this);
  20269. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  20270. }
  20271. }
  20272. ,
  20273. v.exports = t
  20274. }
  20275. ).call(this, "/js/objects/ShowPath.js")
  20276. }
  20277. , {
  20278. "../constants": 8,
  20279. "../effects": 16,
  20280. "../enum/BlackoutStyle": 18,
  20281. "../enum/ModelManagerEvents": 33,
  20282. "../enum/PlayerEvents": 40,
  20283. "../enum/RenderOrder": 42,
  20284. "../enum/Vectors": 50,
  20285. "../enum/Viewmode": 51,
  20286. "../enum/WarpStyle": 52,
  20287. "../gui/gui": 65,
  20288. "../model/ModelManager": 140,
  20289. "../objects/Snapshot": 153,
  20290. "../settings": 166,
  20291. "../shaders": 167,
  20292. "../util/easing": 186,
  20293. "../util/lerp": 188,
  20294. "../util/logger": 189,
  20295. "../util/math": 190,
  20296. "../util/texture": 194,
  20297. "../util/transitions": 195,
  20298. three: 217
  20299. }],
  20300. 152: [function(e, t, i) {
  20301. "use strict";
  20302. function n() {
  20303. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  20304. , t = new r.RawShaderMaterial({
  20305. fragmentShader: o.skysphere.fragmentShader,
  20306. vertexShader: o.skysphere.vertexShader,
  20307. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20308. side: r.BackSide,
  20309. name: "skysphere"
  20310. });
  20311. t.uniforms.radius.value = e.parameters.radius,
  20312. r.Mesh.call(this, e, t)
  20313. }
  20314. var r = e("three")
  20315. , o = e("../shaders")
  20316. , a = e("../settings");
  20317. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  20318. t.exports = n
  20319. }
  20320. , {
  20321. "../settings": 166,
  20322. "../shaders": 167,
  20323. three: 217
  20324. }],
  20325. 153: [function(r, o, e) {
  20326. (function(e) {
  20327. "use strict";
  20328. function t(e) {
  20329. n.call(this, e),
  20330. this.sid = e.sid,
  20331. this.panoId = e.panoId,
  20332. this.orthoZoom = e.orthoZoom,
  20333. this.floorVisibility = e.floorVisibility,
  20334. this.thumbUrl = e.thumbUrl,
  20335. this.name = e.name,
  20336. this.zoom = e.zoom
  20337. }
  20338. var i = (r("three"),
  20339. r("../util/logger"))
  20340. , n = (r("../settings"),
  20341. r("../enum/Viewmode"),
  20342. r("../util/common"),
  20343. r("../util/transitions"),
  20344. r("../util/lerp"),
  20345. r("../util/ajax"),
  20346. r("../util/texture"),
  20347. r("./View"));
  20348. r("events").EventEmitter,
  20349. new i(e),
  20350. (t.prototype = Object.create(n.prototype)).isPano = function() {
  20351. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  20352. }
  20353. ,
  20354. o.exports = t
  20355. }
  20356. ).call(this, "/js/objects/Snapshot.js")
  20357. }
  20358. , {
  20359. "../enum/Viewmode": 51,
  20360. "../settings": 166,
  20361. "../util/ajax": 181,
  20362. "../util/common": 185,
  20363. "../util/lerp": 188,
  20364. "../util/logger": 189,
  20365. "../util/texture": 194,
  20366. "../util/transitions": 195,
  20367. "./View": 154,
  20368. events: 202,
  20369. three: 217
  20370. }],
  20371. 154: [function(o, a, e) {
  20372. (function(e) {
  20373. "use strict";
  20374. function t(e) {
  20375. e = e || {},
  20376. this.position = new i.Vector3,
  20377. this.quaternion = new i.Quaternion,
  20378. this.update(e)
  20379. }
  20380. var i = o("three")
  20381. , n = o("../util/logger")
  20382. , r = (o("../settings"),
  20383. o("../enum/Viewmode"),
  20384. o("../util/common"),
  20385. o("../util/transitions"),
  20386. o("../util/lerp"),
  20387. o("../util/ajax"),
  20388. o("../util/texture"),
  20389. o("events").EventEmitter);
  20390. new n(e),
  20391. (t.prototype = Object.create(r.prototype)).isValid = function() {
  20392. return !!this.cameraMode
  20393. }
  20394. ,
  20395. t.prototype.update = function(e) {
  20396. return this.cameraMode = e.cameraMode || this.cameraMode,
  20397. this.pano = e.pano || this.pano,
  20398. e.position && this.position.copy(e.position),
  20399. e.quaternion && this.quaternion.copy(e.quaternion),
  20400. this
  20401. }
  20402. ,
  20403. a.exports = t
  20404. }
  20405. ).call(this, "/js/objects/View.js")
  20406. }
  20407. , {
  20408. "../enum/Viewmode": 51,
  20409. "../settings": 166,
  20410. "../util/ajax": 181,
  20411. "../util/common": 185,
  20412. "../util/lerp": 188,
  20413. "../util/logger": 189,
  20414. "../util/texture": 194,
  20415. "../util/transitions": 195,
  20416. events: 202,
  20417. three: 217
  20418. }],
  20419. 155: [function(J, ee, e) {
  20420. (function(e) {
  20421. "use strict";
  20422. function t(e) {
  20423. this.currentPano = null,
  20424. this.nextPano = null,
  20425. this.camera = null,
  20426. this.paused = !1,
  20427. this.flying = !1,
  20428. this.sceneIntersectionPlane = null,
  20429. this.target = new B.Vector3,
  20430. this.mouse = new B.Vector3(1.1,1.1,.5),
  20431. this.mouseAtMouseDown = new B.Vector2,
  20432. this.mouseCouldBeClickToMove = !1,
  20433. this.mouseLastMoveTime = Date.now(),
  20434. this.mouseDown = !1,
  20435. this.mouseDownTimer = null,
  20436. this.couldBeLongTap = !1,
  20437. this.containsMouse = !0,
  20438. this.isTouchEvent = !1,
  20439. this.isPanoHover = !1,
  20440. this.reticule = new n(this),
  20441. this.panoMarkers = [],
  20442. this.spider = new s(this),
  20443. this.quaternion = new B.Quaternion,
  20444. this.position = new B.Vector3(15,10,15),
  20445. this.previousState = null,
  20446. this.lastInsideView = new o,
  20447. this.last360View = new o,
  20448. this.raycaster = new B.Raycaster,
  20449. this.intersect = null,
  20450. this.lastChangeTime = Date.now(),
  20451. this.history = new h,
  20452. this.cameraControls = null,
  20453. this.path = null,
  20454. this.model = null,
  20455. this.domElement = null,
  20456. this.cachedPanoCandidates = null,
  20457. this.basePanoSize = 0,
  20458. this.standardPanoSize = 0,
  20459. this.highPanoSize = 0,
  20460. this.ultraHighPanoSize = 0,
  20461. this.zoomLevel = 1,
  20462. this.zooming = 0,
  20463. this.zoomSpeed = .5,
  20464. this.scrollZoomSpeed = .06,
  20465. this.zoomSpeedAdjust = .05,
  20466. this.defaultZoomIncrement = .2,
  20467. this.baseFov = k.insideFOV,
  20468. this.zoomFov = this.baseFov,
  20469. this.zoomEnabled = !0,
  20470. this.preRenderingEnabled = !1,
  20471. this.setupCustomProperties(e),
  20472. this.zoomStats = new v,
  20473. this.modeTran = 'dollhouse-panorama'
  20474. this.currentCursor = '';
  20475. window.player = this
  20476. }
  20477. var B = J("three")
  20478. , i = J("./util/logger")
  20479. , n = J("./objects/Reticule")
  20480. , a = J("./objects/Panorama")
  20481. , r = J("./objects/ShowPath")
  20482. , o = J("./objects/View")
  20483. , s = (J("./objects/Snapshot"),
  20484. J("./objects/NSpider"))
  20485. , V = J("./enum/Viewmode")
  20486. , T = (J("./enum/TagStates"),
  20487. J("./enum/Vectors"))
  20488. , l = J("./enum/Keys")
  20489. , k = (J("./enum/AlignmentType"),
  20490. J("./settings"))
  20491. , x = J("./util/common")
  20492. , U = (J("./util/browser"),
  20493. J("./util/math"))
  20494. , H = J("./util/lerp")
  20495. , z = J("./util/easing")
  20496. , G = J("./util/transitions")
  20497. , c = J("events").EventEmitter
  20498. , h = (J("./shaders"),
  20499. J("./util/history"))
  20500. , S = (J("./util/camera"),
  20501. J("./model/ModelManager"),
  20502. J("./enum/PathDiscardMode"))
  20503. , M = J("./enum/PathDisplayMode")
  20504. , W = J("./enum/PlayerEvents")
  20505. , u = J("./enum/ControlEvents")
  20506. , d = J("./enum/ModelManagerEvents")
  20507. , R = J("./enum/WarpStyle")
  20508. , P = J("./enum/BlackoutStyle")
  20509. , p = J("./exception/BasicException")
  20510. , f = J("./enum/PanoSizeClass")
  20511. , g = (J("./tile/TileDownloader"),
  20512. J("./tile/TilePrioritizer"))
  20513. , m = (J("./enum/PanoramaEvents"),
  20514. J("./enum/ZoomEvents"))
  20515. , v = J("./util/ZoomStats")
  20516. , y = J("./constants")
  20517. , j = J("./util/common")
  20518. , A = J("./util/cameraLight")
  20519. , C = J("hot")
  20520. , Y = new i(e)
  20521. , q = Object.freeze({
  20522. FlyToPano: G.getUniqueId(),
  20523. FlyToNewMode: G.getUniqueId(),
  20524. FlyToSameMode: G.getUniqueId(),
  20525. FlyToViewFloor: G.getUniqueId(),
  20526. LookTransition: G.getUniqueId(),
  20527. ZoomTransition: G.getUniqueId()
  20528. });
  20529. function I(e) {
  20530. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  20531. o[r] = n.charCodeAt(r);
  20532. return new Blob([o],{
  20533. type: i
  20534. })
  20535. }
  20536. (t.prototype = Object.create(c.prototype)).init = function(e) {
  20537. this.modelManager = e.modelManager,
  20538. this.tileDownloader = e.tileDownloader,
  20539. this.panoRenderer = e.panoRenderer,
  20540. this.qualityManager = e.qualityManager,
  20541. this.domElement = e.container,
  20542. this.camera = e.camera,
  20543. this.tagManager = e.tagManager,
  20544. this.cameraControls = e.controls,
  20545. this.path = new r(e.director,this,e.controls),
  20546. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  20547. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  20548. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  20549. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  20550. this.tileDownloader.processPriorityQueue = !1,
  20551. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20552. this.bindEvents(e.container),
  20553. this.updateModel()
  20554. }
  20555. ,
  20556. t.prototype.screenShot = function(i) {
  20557. if (!this.flying && !this.flyingToTag) {
  20558. var n = this.sceneRenderer;
  20559. for (var e in n.updateScreenSize(i),
  20560. this.model.panos.index)
  20561. this.model.panos.index[e].marker && (this.model.panos.index[e].marker.forceHide = this.model.panos.index[e].marker.visible,
  20562. this.model.panos.index[e].marker.visible = !1);
  20563. for (var e in this.model.hots)
  20564. this.model.hots[e].mesh.visible = !1;
  20565. this.reticule.visible = !1,
  20566. this.reticule.forceUnvisible = !0,
  20567. this.path.currentPanoMarker.mesh.visible = !1,
  20568. setTimeout(function() {
  20569. n.renderer.clear(!0, !0, !0),
  20570. n.renderer.render(n.scene, n.camera);
  20571. var e = n.renderer.domElement.toDataURL(i.type, .9);
  20572. for (var t in i.f && i.f(e),
  20573. n.updateScreenSize({
  20574. resize: !0
  20575. }),
  20576. this.reticule.visible = !0,
  20577. this.model.hots)
  20578. this.model.hots[t].mesh.visible = !0;
  20579. for (var t in this.model.panos.index)
  20580. this.model.panos.index[t].marker.visible = this.model.panos.index[t].marker.forceHide;
  20581. this.path.currentPanoMarker.mesh.visible = !0,
  20582. n.renderer.render(n.scene, n.camera)
  20583. }
  20584. .bind(this), 30)
  20585. }
  20586. }
  20587. ;
  20588. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  20589. t.prototype.getWrapShot = function() {
  20590. var i = this.getSnapAngleInfo()
  20591. , n = ",{\r\t" + i
  20592. , r = arguments[0];
  20593. this.screenShot({
  20594. width: g_snapShotWidth,
  20595. height: g_snapShotHeight,
  20596. type: "image/jpeg",
  20597. f: function(e) {
  20598. if (r && r.__callback)
  20599. return r.__callback(e, i);
  20600. var t = new Image;
  20601. t.src = e,
  20602. t.onload = function() {
  20603. var e = function(r, i) {
  20604. function n(e, t) {
  20605. var i = o || r
  20606. , n = document.createElement("canvas");
  20607. n.width = i.width,
  20608. n.height = i.height,
  20609. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20610. o = Q(e, n, t)
  20611. }
  20612. function e() {
  20613. var e = o || r
  20614. , t = I(e.src);
  20615. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20616. t = I(e.src)),
  20617. (o = o || new Image).base64Src = e.src,
  20618. o.src = window.URL.createObjectURL(t)
  20619. }
  20620. var o, t = Math.max(r.width, r.height);
  20621. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20622. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20623. e())),
  20624. o || r
  20625. }(this, {
  20626. maxSize: g_snapShotWidth,
  20627. oldType: "jpeg"
  20628. });
  20629. e.src.replace(function(e) {
  20630. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20631. }("image/jpeg"), "image/octet-stream");
  20632. var t = "snap" + (new Date).getTime();
  20633. !function(e, t) {
  20634. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20635. i.href = e,
  20636. i.download = t;
  20637. var n = document.createEvent("MouseEvents");
  20638. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20639. i.dispatchEvent(n)
  20640. }(e.src, t + ".jpg"),
  20641. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20642. n += '\r\t"sid":"' + t + '",',
  20643. n += '\r\t"name":"' + t + '"\r}',
  20644. logData(n)
  20645. }
  20646. }
  20647. })
  20648. }
  20649. /* ,
  20650. t.prototype.getSnapAngleInfo = function() {
  20651. var e = {}
  20652. , t = '"metadata":{'
  20653. , i = this.camera.quaternion.clone();
  20654. switch (this.mode) {
  20655. case "panorama":
  20656. e.scan_id = this.currentPano.id,
  20657. t += '"scan_id":"' + this.currentPano.id + '",';
  20658. break;
  20659. case "floorplan":
  20660. e.camera_mode = 1,
  20661. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20662. t += '"camera_mode":1,',
  20663. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20664. break;
  20665. case "dollhouse":
  20666. e.camera_mode = 2,
  20667. t += '"camera_mode":2,'
  20668. }
  20669. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20670. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20671. n.x *= -1,
  20672. n.w *= -1,
  20673. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20674. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20675. e.zoom = this.zoomLevel,
  20676. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20677. }
  20678. , */
  20679. t.prototype.getSnapAngleInfo = function(){
  20680. var info = {};
  20681. var str = '"metadata":{';
  20682. var q = this.camera.quaternion.clone();
  20683. switch (this.mode) {
  20684. case "panorama":
  20685. info.scan_id = this.currentPano.id;
  20686. str += ('"scan_id":"'+this.currentPano.id+'",');
  20687. break;
  20688. case "floorplan":
  20689. info.camera_mode = 1;
  20690. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20691. q.multiply(this.camera.quaternion);
  20692. str += ('"camera_mode":1,');
  20693. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20694. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20695. break;
  20696. case "dollhouse":
  20697. info.camera_mode = 2;
  20698. str += ('"camera_mode":2,');
  20699. break;
  20700. }
  20701. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20702. //console.log(info.camera_position)
  20703. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20704. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20705. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20706. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20707. out.x *= -1;
  20708. out.w *= -1;
  20709. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20710. }else{
  20711. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20712. } */
  20713. info.zoom = this.zoomLevel;
  20714. //console.log(info.camera_quaternion)
  20715. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20716. // fyz 扩展编辑页面, 加上导览点缩放值
  20717. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20718. console.log(str)
  20719. return str;
  20720. }
  20721. //------end
  20722. t.prototype.closePopup = function() {
  20723. if (g_currentHot) {
  20724. g_currentHot = null,
  20725. document.getElementById("popup").style.display = "none",
  20726. document.querySelector(".popup-content").removeChild(document.getElementById("id1")),
  20727. $("#popup iframe:last").remove();
  20728. document.getElementById("bgaudio");
  20729. if(g_bgAudio && g_bgAudio.pauseByHot){
  20730. manage.switchBgmState(true)
  20731. }
  20732. return false
  20733. }
  20734. }
  20735. ,
  20736. t.prototype.setupCustomProperties = function(e) {
  20737. var i = e || V.PANORAMA;
  20738. Object.defineProperty(this, "mode", {
  20739. get: function() {
  20740. return i
  20741. },
  20742. set: function(e) {
  20743. var t = i;
  20744. i = e,
  20745. this.onModeUpdated(t, i)
  20746. }
  20747. })
  20748. }
  20749. ,
  20750. t.prototype.isInMode = function() {
  20751. for (var e = 0; e < arguments.length; e++)
  20752. if (this.mode === arguments[e])
  20753. return !0;
  20754. return !1
  20755. }
  20756. ,
  20757. t.prototype.isOutsideMode = function(e) {
  20758. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20759. }
  20760. ,
  20761. t.prototype.is360View = function(e, t) {
  20762. return e === V.PANORAMA && t && !t.isAligned()
  20763. }
  20764. ,
  20765. t.prototype.setScene = function(e) {
  20766. this.sceneIntersectionPlane = e.plane,
  20767. this.path.setScene(e),
  20768. this.moveReticuleToScene(e)
  20769. }
  20770. ,
  20771. t.prototype.moveReticuleToScene = function(e) {
  20772. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20773. e.add(this.reticule)
  20774. }
  20775. ,
  20776. t.prototype.updateModel = function() {
  20777. function n(e) {
  20778. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20779. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20780. , n = t.position.y + (e - i.target.y)
  20781. , r = k.showFloorDuration + k.showFloorDelay;
  20782. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20783. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20784. }
  20785. this.model = this.modelManager.getActiveModel(),
  20786. this.model.on("floor.changed", function(e, t, i) {
  20787. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20788. }
  20789. .bind(this)),
  20790. this.model.on("allfloors.toggled", function(e, t) {
  20791. if (this.mode === V.DOLLHOUSE) {
  20792. var i = e ? this.model.center.y : i = t.center.y;
  20793. n.call(this, i)
  20794. }
  20795. }
  20796. .bind(this)),
  20797. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20798. var t = this;
  20799. this.model.panos.list.forEach(function(e) {
  20800. e.vrMarker.addEventListener("click", function() {
  20801. t.flyToPano({
  20802. pano: e
  20803. })
  20804. })
  20805. })
  20806. }
  20807. ,
  20808. t.prototype.updateModelDependentData = function() {
  20809. this.cameraControls.setModelForControls(this.model),
  20810. this.getPanoMarkersFromModel(this.model)
  20811. }
  20812. ,
  20813. t.prototype.onModelChanged = function() {
  20814. this.updateModel(),
  20815. this.updateModelDependentData()
  20816. }
  20817. ,
  20818. t.prototype.getPanoMarkersFromModel = function(e) {
  20819. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20820. return t.marker ? e.concat(t.marker) : e
  20821. }, [])
  20822. }
  20823. ,
  20824. t.prototype.handleControlMove = function(e) {
  20825. this.emit(W.Move, e)
  20826. }
  20827. ,
  20828. t.prototype.handleControlInputStart = function(e) {
  20829. this.emit(W.InputStart, e)
  20830. }
  20831. ,
  20832. t.prototype.onModeUpdated = function(e, t) {
  20833. this.cameraControls.activateControls(t),
  20834. this.emit(W.ModeChanged, e, t)
  20835. }
  20836. ,
  20837. t.prototype.isWarping = function() {
  20838. return this.path.warping
  20839. }
  20840. ,
  20841. t.prototype.isWaitingToWarp = function() {
  20842. return this.path.waitingToWarp
  20843. }
  20844. ,
  20845. t.prototype.getLabelScaleFactor = function() {
  20846. if (this.isOutsideMode()) {
  20847. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20848. }
  20849. return .5
  20850. }
  20851. ,
  20852. t.prototype.changeMusic = function() {
  20853. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  20854. }
  20855. ,
  20856. t.prototype.bindEvents = function(e) {
  20857. e !== document && e.setAttribute("tabindex", -1),
  20858. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20859. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20860. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20861. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20862. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20863. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20864. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20865. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20866. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20867. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20868. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20869. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20870. document.addEventListener("pointerup", ()=>{//add
  20871. window.transformControls && transformControls.onPointerUp()
  20872. }),
  20873. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20874. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20875. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20876. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20877. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20878. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20879. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20880. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20881. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20882. window.getSeft && getSeft(this),
  20883. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? $("#closepop").on("touchstart", this.closePopup.bind(this)) : $("#closepop").on("click", this.closePopup.bind(this))
  20884. }
  20885. ,
  20886. t.prototype.onMouseDown = function(e) {
  20887. e.currentTarget !== document && e.currentTarget.focus(),
  20888. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20889. this.updateIntersect())
  20890. }
  20891. ,
  20892. t.prototype.onMouseMove = function(e) {
  20893. this.isTouchEvent = !1,
  20894. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20895. }
  20896. ,
  20897. t.prototype.onMouseOver = function(e) {
  20898. this.containsMouse = !0,
  20899. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20900. }
  20901. ,
  20902. t.prototype.onMouseOut = function(e) {
  20903. this.containsMouse = !1
  20904. }
  20905. ,
  20906. t.prototype.onMouseUp = function(e) {
  20907. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20908. }
  20909. ,
  20910. t.prototype.onTouchStart = function(e) {
  20911. if (e.currentTarget !== document && e.currentTarget.focus(),
  20912. !this.mouseDown) {
  20913. this.couldBeLongTap = !0;
  20914. var t = x.average(e.changedTouches, "clientX")
  20915. , i = x.average(e.changedTouches, "clientY");
  20916. this.handleInputStart.call(this, t, i, !0),
  20917. this.mouseDownTimer = setTimeout(function() {
  20918. this.updateIntersect(),
  20919. this.handleInputEnd.call(this, t, i, !0)
  20920. }
  20921. .bind(this), k.input.longTapThreshold)
  20922. }
  20923. }
  20924. ,
  20925. t.prototype.onTouchMove = function(e) {
  20926. var t = x.average(e.changedTouches, "clientX")
  20927. , i = x.average(e.changedTouches, "clientY");
  20928. this.handleInputMove.call(this, t, i, !0)
  20929. }
  20930. ,
  20931. t.prototype.onTouchEnd = function(e) {
  20932. if (clearTimeout(this.mouseDownTimer),
  20933. this.mouseDown) {
  20934. this.couldBeLongTap = !1,
  20935. this.updateIntersect();
  20936. var t = x.average(e.changedTouches, "clientX")
  20937. , i = x.average(e.changedTouches, "clientY");
  20938. this.handleInputEnd.call(this, t, i, !0)
  20939. }
  20940. }
  20941. ,
  20942. t.prototype.onPointerDown = function(e) {
  20943. return e.currentTarget !== document && e.currentTarget.focus(),
  20944. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20945. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20946. void (this.mouseDownTimer = setTimeout(function() {
  20947. this.updateIntersect(),
  20948. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20949. }
  20950. .bind(this), k.input.longTapThreshold)))
  20951. }
  20952. ,
  20953. t.prototype.onPointerMove = function(e) {
  20954. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20955. }
  20956. ,
  20957. t.prototype.onPointerUp = function(e) {
  20958. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20959. this.couldBeLongTap = !1,
  20960. this.updateIntersect(),
  20961. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20962. }
  20963. ,
  20964. t.prototype.onPointerOut = function(e) {
  20965. this.mouseDown = !1
  20966. }
  20967. ,
  20968. t.prototype.onPointerCancel = function(e) {
  20969. this.mouseDown = !1
  20970. }
  20971. ,
  20972. t.prototype.onKeyDown = function(e) {
  20973. var t = function() {
  20974. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20975. }
  20976. .bind(this)
  20977. , i = e.which;
  20978. switch (i) {
  20979. case l.F:
  20980. t(),
  20981. this.changeFloor(-1);
  20982. break;
  20983. case l.R:
  20984. t(),
  20985. this.changeFloor(1)
  20986. }
  20987. if (this.mode === V.PANORAMA)
  20988. switch (i) {
  20989. case l.UPARROW:
  20990. case l.W:
  20991. this.flyLocalDirection(T.FORWARD.clone());
  20992. break;
  20993. case l.DOWNARROW:
  20994. case l.S:
  20995. this.flyLocalDirection(T.BACK.clone());
  20996. break;
  20997. case l.A:
  20998. this.flyLocalDirection(T.LEFT.clone());
  20999. break;
  21000. case l.D:
  21001. this.flyLocalDirection(T.RIGHT.clone())
  21002. }
  21003. }
  21004. ,
  21005. t.prototype.handleScrollPinchZoom = function(e) {
  21006. var t = e
  21007. , i = this.zoomLevel;
  21008. this.zoomBy(t),
  21009. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  21010. }
  21011. ,
  21012. t.prototype.handleControlPinch = function(e) {
  21013. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  21014. }
  21015. ,
  21016. t.prototype.handleControlScroll = function(e) {
  21017. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  21018. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  21019. }
  21020. ,
  21021. t.prototype.handleInputStart = function(e, t, i) {
  21022. var n = this.handelPadding(e, t);
  21023. e = n.x,
  21024. t = n.y,
  21025. this.isTouchEvent = i,
  21026. U.convertScreenPositionToNDC(e, t, this.mouse),
  21027. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  21028. this.mouseCouldBeClickToMove = !0,
  21029. this.mouseDown = !0,
  21030. this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  21031. window.transformControls && transformControls.onPointerDown()
  21032. if(!this.overlayInitedPlay && this.overlayGroup.children.length){
  21033. try{
  21034. this.overlayGroup.children.forEach((overlay)=>{
  21035. overlay.overlayType == "video" && overlay.plane.material.map.image.play()
  21036. })
  21037. }catch(e){}
  21038. this.overlayInitedPlay = true
  21039. }
  21040. }
  21041. ,
  21042. t.prototype.handelPadding = function(e, t) {
  21043. return this.pad || (this.pad = {
  21044. x: dom.getOffset("left", $("#player")[0]),
  21045. y: dom.getOffset("top", $("#player")[0])
  21046. }),
  21047. {
  21048. x: e - this.pad.x,
  21049. y: t - this.pad.y
  21050. }
  21051. }
  21052. ,
  21053. t.prototype.handleInputMove = function(e, t, i) {
  21054. var n = this.handelPadding(e, t);
  21055. e = n.x,
  21056. t = n.y,
  21057. this.isTouchEvent = i,
  21058. U.convertScreenPositionToNDC(e, t, this.mouse);
  21059. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  21060. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  21061. this.couldBeLongTap = !1,
  21062. clearTimeout(this.mouseDownTimer)),
  21063. this.mouseLastMoveTime = Date.now(),
  21064. this.reticule.move(e, t, i)
  21065. window.transformControls && transformControls.onPointerMove()
  21066. }
  21067. ,
  21068. t.prototype.handleInputEnd = function(e, t, i) {
  21069. if (this.isTouchEvent = i,
  21070. this.mouseDown = !1,
  21071. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  21072. !i && this.couldBeLongTap)
  21073. return !0;
  21074. if (this.handleLongTap())
  21075. return !0;
  21076. window.transformControls && transformControls.onPointerUp()
  21077. if (this.mouseCouldBeClickToMove) {
  21078. if (this.flying)
  21079. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  21080. !0;
  21081. //add----
  21082. if (this.checkHotClick())
  21083. return !0;
  21084. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  21085. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  21086. return;
  21087. }
  21088. if (window.VisiSet && VisiSet.setTagVisible ) {
  21089. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name);
  21090. return;
  21091. }
  21092. if (window.VisiSet && VisiSet.setPanoLog ) {
  21093. this.intersect && this.intersect.object.visible && VisiSet.dealPanoLogClick( this.intersect.object);
  21094. return;
  21095. }
  21096. if(this.hoveringPlane){
  21097. this.clickOverlay(this.hoveringPlane)
  21098. return;
  21099. }
  21100. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  21101. return EditOverlay.addPlane({intersect:this.intersect});
  21102. }
  21103. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  21104. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  21105. else if(objects.mainDesign.editType == "addOverlay")return !0;
  21106. } */
  21107. //----------
  21108. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  21109. this.history.invalidate(),
  21110. this.intersect)
  21111. return this.flyToPanoClosestToMouse();
  21112. if (this.mode === V.PANORAMA) {
  21113. var n = this.closestPanoInDirection(this.getMouseDirection());
  21114. return n ? this.flyToPano({
  21115. pano: n
  21116. }) : this.bump(this.getMouseDirection())
  21117. }
  21118. }
  21119. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  21120. }
  21121. ,
  21122. t.prototype.handleLongTap = function() {
  21123. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  21124. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  21125. !0
  21126. }
  21127. ,
  21128. t.prototype.checktagClick = function() {
  21129. if (this.tagManager.intersectTag) {
  21130. var e = this.isTouchEvent
  21131. , t = this.tagManager.clickedOnTag(e, this);
  21132. return e || t || G.cancelById(q.LookTransition),
  21133. !0
  21134. }
  21135. if (this.tagManager.activeTag)
  21136. return this.tagManager.dismissActiveTag(),
  21137. !1
  21138. }
  21139. ,
  21140. t.prototype.rankedtagInDirection = function(e, t) {
  21141. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  21142. }
  21143. ,
  21144. t.prototype.start = function(e) {
  21145. $(".toolLeft").removeClass("unable");
  21146. $(".toolTop").removeClass("unable");
  21147. //-------------------
  21148. window.initTransformCtl(B)
  21149. window.initOverlay(B)
  21150. this.model.loadOverlays()
  21151. window.EditOverlay && window.EditOverlay.init(B);
  21152. window.VisiSet && VisiSet.init()
  21153. //-------------------
  21154. var t = e.mode
  21155. , i = e.pano
  21156. , n = e.position
  21157. , r = e.quaternion
  21158. , o = e.tag
  21159. , a = e.quickstart
  21160. , s = $.Deferred();
  21161. this.updateModelDependentData(),
  21162. this.updateFromControls(),
  21163. this.findDefaultViews();
  21164. var l = this.is360View(t, i);
  21165. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  21166. s.done(function(e) {
  21167. this.emit(W.Ready, l, e, o)
  21168. }
  21169. .bind(this)),
  21170. s.promise()
  21171. }
  21172. ,
  21173. t.prototype.startOutside = function(e, t) {
  21174. var i = e.mode
  21175. , n = e.pano
  21176. , r = e.position
  21177. , o = e.quaternion
  21178. , a = e.zoom
  21179. , s = e.floorVisibility
  21180. , l = e.tag;
  21181. this.emit(W.StartOutside, k[i].transitionTime),
  21182. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  21183. G.cancelById(q.FlyToViewFloor),
  21184. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  21185. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  21186. }
  21187. ,
  21188. t.prototype.startInside = function(e, t, i, n, r) {
  21189. r = r || $.Deferred();
  21190. var o = (this.currentPano = e) && !e.isAligned();
  21191. if (t = o ? e.position : t || e.position,
  21192. i = i || e.quaternion,
  21193. e) {
  21194. var a = this.startInside.bind(this, e, t, i, n, r);
  21195. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  21196. return
  21197. }
  21198. //add
  21199. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  21200. this.updateHotVisible()
  21201. EditOverlay.updatePano()
  21202. editTool.hotpoint.updatePano()
  21203. Overlay.updateVisibles([this.currentPano])
  21204. return this.mode = V.PANORAMA,
  21205. e.floor.enter(this.mode),
  21206. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  21207. this.switchCameraMode(this.mode, i),
  21208. this.emit(W.StartInside, o),
  21209. r.resolve(!0),
  21210. r
  21211. }
  21212. ,
  21213. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  21214. if (r = r || $.Deferred(),
  21215. this.dollhouseMode(),
  21216. !i)
  21217. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  21218. r.resolve(!1),
  21219. r;
  21220. e = e || i.position;
  21221. var o = n || this.cameraControls.activeControl.camera.quaternion
  21222. , a = i.position;
  21223. return this.fitDollhouse(a, e, o),
  21224. setTimeout(function(e) {
  21225. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  21226. var t = {
  21227. mode: V.PANORAMA,
  21228. pano: i,
  21229. quaternion: n,
  21230. callback: function() {
  21231. this.emit(W.FlyinFinished),
  21232. r.resolve(!0)
  21233. }
  21234. .bind(this)
  21235. };
  21236. this.flyToNewMode(t)
  21237. }
  21238. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  21239. r
  21240. }
  21241. ,
  21242. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  21243. K = {},
  21244. function(t, e, i, n, r, o, a, s, l, c) {
  21245. if (function() {
  21246. for (var e in Z)
  21247. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  21248. return !0;
  21249. return !1
  21250. }())
  21251. return !0;
  21252. var h = function(e, t, i) {
  21253. j.delayOneFrame(function() {
  21254. Z[e] = !1,
  21255. r && r(t, i)
  21256. }
  21257. .bind(this))
  21258. }
  21259. .bind(this, t.id)
  21260. , u = function(e, t) {
  21261. j.delayOneFrame(function() {
  21262. Z[e] = !1,
  21263. o && o(t)
  21264. }
  21265. .bind(this))
  21266. }
  21267. .bind(this, t.id);
  21268. try {
  21269. return null != s || (s = !0),
  21270. this.model.supportsTiles ? Z[t.id] = this.checkAndWaitForTiledPanoLoad(t, n, h, u, a, s, l, c) : Z[t.id] = this.checkAndWaitForWholePanoLoad(t, e, i, h, s),
  21271. Z[t.id] && (K[t.id] = performance.now()),
  21272. Z[t.id]
  21273. } catch (e) {
  21274. throw Z[t.id] = !1,
  21275. K[t.id] = performance.now() - 5e3,
  21276. e
  21277. }
  21278. }
  21279. ),
  21280. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  21281. if (!e)
  21282. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  21283. return r && this.model.waitForLoad(e, function() {
  21284. return e.isLoaded(i)
  21285. }),
  21286. !e.isLoaded(t) && (e.loadCube(t).done(n),
  21287. !0)
  21288. }
  21289. ,
  21290. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  21291. function(e, t, i, n, r, o, a, s) {
  21292. if (!e)
  21293. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  21294. return X.copy(T.FORWARD),
  21295. this.getDirection(X),
  21296. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  21297. return e.isLoaded(t)
  21298. }),
  21299. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  21300. i && i(e, t)
  21301. }
  21302. .bind(this)).fail(function(e) {
  21303. n && n(e)
  21304. }
  21305. .bind(this)).progress(function(e, t, i) {
  21306. r && r(e, t, i)
  21307. }
  21308. .bind(this)),
  21309. !0)
  21310. }
  21311. ),
  21312. t.prototype.switchCameraMode = function(e, t) {
  21313. var i = this.cameraControls.controls[e]
  21314. , n = i.camera;
  21315. switch (e) {
  21316. case V.PANORAMA:
  21317. n.position.copy(this.currentPano.position);
  21318. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  21319. i.lookAt(r.add(n.position));
  21320. break;
  21321. case V.DOLLHOUSE:
  21322. var o = this.position.clone();
  21323. this.mode === V.PANORAMA ? o.add(new B.Vector3(0,6,0)).add(this.getDirection().multiplyScalar(-10)) : o.add(T.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6),
  21324. n.position.copy(o),
  21325. i.target.copy(this.target.clone().setY(this.model.center.y));
  21326. break;
  21327. //for多楼层 且 让模型刚好适应屏幕
  21328. /* var box = this.model.boundingBox.clone();
  21329. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  21330. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  21331. var fov = A.getHFOVFromVFOV(k.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  21332. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  21333. console.log(boxSize.x,distance, boxSize.length() / 2)
  21334. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  21335. if(this.mode === V.PANORAMA){
  21336. i.target.copy(this.model.center);
  21337. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  21338. }else{
  21339. i.target.copy(this.target.clone().setY(this.model.center.y))
  21340. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  21341. }
  21342. vec.multiplyScalar(distance )
  21343. n.position.copy(i.target.clone().add(vec)) */
  21344. break
  21345. case V.FLOORPLAN:
  21346. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  21347. i.target.copy(this.model.center).setY(0),
  21348. i.zoomToContain(this.model.size),
  21349. i.rotateToView(this.model.size, this.getDirection())
  21350. }
  21351. i.update(0)
  21352. }
  21353. ,
  21354. t.prototype.update = (new B.Vector3,
  21355. N = {},
  21356. F = [],
  21357. function(e) {
  21358. this.updatePersistentZooming(e),
  21359. this.updateFromControls(e),
  21360. this.getCurrentNodePanos(F)
  21361. if(this.hasChanged(N)){
  21362. this.lastChangeTime = Date.now(),
  21363. !this.mouseDown && this.containsMouse && this.updateIntersect()
  21364. this.emit(W.ViewChanged)
  21365. //add:
  21366. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)) VisiSet.updateFootIconSize();
  21367. this.intersectHot && this.intersectHot.showTitle()
  21368. editTool.hotpoint.showTitileSpots && editTool.hotpoint.showTitileSpots.forEach(e=>e.showTitle())
  21369. for(var i in this.model.hots){
  21370. this.model.hots[i].update(this.camera)
  21371. }
  21372. if(this.mode == 'panorama')this.overlayGroup&&this.overlayGroup.children.forEach(overlay=>{
  21373. overlay.update()
  21374. })
  21375. }
  21376. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
  21377. this.model.supportsTiles && (this.updateTileDownloader(F),
  21378. this.updatePanoRenderer(F)),
  21379. this.updatePreRendering(F),
  21380. this.reticule.update(),
  21381. this.path.update(),
  21382. this.spider.update(),
  21383. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21384. this.updateControlLocks(),
  21385. this.model.supportsTiles && this.updateZoomPano()
  21386. }
  21387. ),
  21388. t.prototype.updatePersistentZooming = function(e) {
  21389. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  21390. }
  21391. ,
  21392. t.prototype.updateControlLocks = function() {
  21393. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21394. }
  21395. ,
  21396. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  21397. function(e) {
  21398. var t = this.nextPano || this.currentPano;
  21399. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  21400. this.getDirection(D),
  21401. this.panoRenderer.updateDirection(D))
  21402. }
  21403. ),
  21404. t.prototype.cleanupInactivePanos = (O = [],
  21405. L = [],
  21406. function() {
  21407. O.length = 0,
  21408. O.push(this.currentPano),
  21409. this.nextPano && O.push(this.nextPano);
  21410. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  21411. L.push(this.panoRenderer.activePanos[e]);
  21412. for (var t = 0; t < L.length; t++) {
  21413. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  21414. i.id === O[r].id && (n = !1);
  21415. n && i.exit()
  21416. }
  21417. }
  21418. ),
  21419. t.prototype.updatePreRendering = (w = {},
  21420. function(e) {
  21421. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21422. var t = this.nextPano || this.currentPano;
  21423. if (t && e && 1 < e.length) {
  21424. var i = e.findIndex(function(e) {
  21425. if (e.id === t.id)
  21426. return !0
  21427. });
  21428. if (0 <= i && i + 1 < e.length) {
  21429. var n = e[i + 1];
  21430. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  21431. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21432. window.setTimeout(function(e) {
  21433. w[e.id] = !1
  21434. }
  21435. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  21436. }
  21437. .bind(this, n), k.tiling.panoPreRenderDelay),
  21438. w[n.id] = !0)
  21439. }
  21440. }
  21441. }
  21442. }
  21443. ),
  21444. t.prototype.enablePreRendering = function() {
  21445. this.preRenderingEnabled = !0
  21446. }
  21447. ,
  21448. t.prototype.disablePreRendering = function() {
  21449. this.preRenderingEnabled = !1,
  21450. this.cleanupInactivePanos()
  21451. }
  21452. ,
  21453. t.prototype.updateTileDownloader = (b = new B.Vector3,
  21454. function(e) {
  21455. var t = this.nextPano || this.currentPano;
  21456. t && (b.copy(T.FORWARD),
  21457. this.getDirection(b),
  21458. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  21459. this.tileDownloader.processPriorityQueue = !0)
  21460. }
  21461. ),
  21462. t.prototype.updateFromControls = function(e) {
  21463. null != e || (e = 0),
  21464. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21465. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21466. this.position.copy(this.cameraControls.activeControl.camera.position),
  21467. this.target.copy(this.cameraControls.activeControl.target),
  21468. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21469. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21470. this.camera.position.copy(this.position),
  21471. this.camera.quaternion.copy(this.quaternion),
  21472. this.camera.updateMatrix(),
  21473. this.camera.updateMatrixWorld()
  21474. }
  21475. ,
  21476. t.prototype.hasChanged = function(e) {
  21477. if (!this.previousState)
  21478. return this.previousState = {
  21479. allFloorsVisible: this.model.allFloorsVisible,
  21480. position: this.position.clone(),
  21481. quaternion: this.quaternion.clone(),
  21482. mouse: this.mouse.clone(),
  21483. labelScaleFactor: this.getLabelScaleFactor(),
  21484. currentFloor: this.model.currentFloor,
  21485. projectionMatrix: this.camera.projectionMatrix.clone(),
  21486. worldMatrix: this.camera.matrixWorld.clone(),
  21487. mode: this.mode,
  21488. modelPosition: this.model.position.clone(),
  21489. modelCenter: this.model.center.clone(),
  21490. zoomLevel: this.zoomLevel
  21491. },
  21492. !0;
  21493. var t = this.model.allFloorsVisible === this.previousState.allFloorsVisible && this.position.equals(this.previousState.position) && this.quaternion.equals(this.previousState.quaternion) && this.mouse.equals(this.previousState.mouse) && this.getLabelScaleFactor() === this.previousState.labelScaleFactor && this.model.currentFloor === this.previousState.currentFloor && this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) && this.camera.matrixWorld.equals(this.previousState.worldMatrix) && this.mode === this.previousState.mode && this.model.position.equals(this.previousState.modelPosition) && this.model.center.equals(this.previousState.modelCenter) && null === this.nextPano && this.zoomLevel === this.previousState.zoomLevel;
  21494. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21495. e.moved = !this.position.equals(this.previousState.position),
  21496. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21497. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21498. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21499. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21500. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21501. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21502. e.modeChanged = this.mode !== this.previousState.mode,
  21503. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21504. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21505. e.nextPanoActive = null !== this.nextPano,
  21506. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21507. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21508. this.previousState.position.copy(this.position),
  21509. this.previousState.quaternion.copy(this.quaternion),
  21510. this.previousState.mouse.copy(this.mouse),
  21511. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21512. this.previousState.currentFloor = this.model.currentFloor,
  21513. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21514. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21515. this.previousState.mode = this.mode,
  21516. this.previousState.modelPosition.copy(this.model.position),
  21517. this.previousState.modelCenter.copy(this.model.center),
  21518. this.previousState.zoomLevel = this.zoomLevel,
  21519. !t
  21520. }
  21521. ,
  21522. t.prototype.updateIntersect = function() {
  21523. var e = this.flying || this.isWarping()
  21524. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21525. , i = G.getById(q.LookTransition);
  21526. e || t || this.isTouchEvent || i.length && i[0].running;
  21527. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)) {
  21528. this.intersect = this.getMouseIntersect(null, VisiSet.footIcons);
  21529. if (this.intersect && this.intersect.object.visible )
  21530. $("#player").css("cursor", "pointer");
  21531. else
  21532. $("#player").css("cursor", "")
  21533. return;
  21534. }
  21535. this.intersect = this.getMouseIntersect(),
  21536. this.intersect && this.updateClosestPano(this.intersect),
  21537. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21538. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21539. }
  21540. ,
  21541. t.prototype.checkHotClick = function() {
  21542. if (this.intersectHot){
  21543. if (window.VisiSet && VisiSet.setTagVisible ) {
  21544. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  21545. return;
  21546. }else if(editTool.atPanel == 'hotpoint'){
  21547. if(editTool.hotpoint.editSpot && this.intersectHot != editTool.hotpoint.editSpot){
  21548. var sure = confirm("是否保存当前热点?")
  21549. if(sure){
  21550. editTool.hotpoint.saveHot().then(()=>{
  21551. editTool.hotpoint.editHot(this.intersectHot)
  21552. })
  21553. }else{
  21554. editTool.hotpoint.editHot(this.intersectHot)
  21555. }
  21556. }else{
  21557. editTool.hotpoint.editHot(this.intersectHot)
  21558. }
  21559. }
  21560. this.intersectHot.examine(this)
  21561. return !0
  21562. }
  21563. }
  21564. ,
  21565. t.prototype.getMouseDirection = function(e) {
  21566. e = e || this.mouse;
  21567. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21568. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  21569. }
  21570. ,
  21571. t.prototype.hoverOverlay = function(mesh){
  21572. if(!mesh){
  21573. this.hoveringPlane = null;
  21574. $("#player").css("cursor",this.currentCursor || "" );
  21575. }else{
  21576. var overlay = mesh.parent;
  21577. $("#player").css("cursor","pointer");
  21578. this.hoveringPlane = overlay;
  21579. return true;
  21580. }
  21581. },
  21582. t.prototype.clickOverlay = function(overlay){
  21583. if(this.openOverlay && !overlay)return;
  21584. var plane = overlay.plane;
  21585. if(overlay.overlayType == "video"){
  21586. overlay.switchPlay(!!overlay.pausedByUser)
  21587. }
  21588. if(window.EditOverlay && EditOverlay.editing){
  21589. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane){
  21590. var sure = confirm("是否保存当前展览?")
  21591. if(sure){
  21592. $("#overlayProp button.submit").click()
  21593. }else{
  21594. EditOverlay.closeOverlayPanel('cancel')
  21595. }
  21596. }
  21597. EditOverlay.beginEdit(overlay);
  21598. return;
  21599. }
  21600. },
  21601. t.prototype.getMouseIntersect = function(e, t1) {
  21602. e = e || this.mouse.clone()
  21603. var t = t1 || this.model.floors.reduce(function(e, t) {
  21604. return t.hidden ? e : e.concat(t.collider.children)
  21605. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21606. t = t.slice(0)
  21607. for (var i in this.model.hots) t.push(this.model.hots[i].mesh);
  21608. this.overlayGroup && (t = t.concat(this.overlayGroup.children));
  21609. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21610. this.raycaster.set(i, this.getMouseDirection(e));
  21611. var n = this.raycaster.intersectObjects(t, true);//add true
  21612. if ("add" == g_HotStatus) {
  21613. var r = this.raycaster.intersectObjects(window.player.model.chunks);
  21614. //console.log(r[0]),
  21615. 1 <= r.length ? ($("#player").css("cursor", "cell"),
  21616. window.hotIntersect = r[0]) : ($("#player").css("cursor", "not-allowed"),
  21617. window.hotIntersect = !1)
  21618. return;
  21619. }
  21620. this.intersectHot && this.intersectHot.hideTitle()
  21621. if (0 === n.length)
  21622. return this.intersectHot = null,
  21623. "add" != g_HotStatus && $("#player").css("cursor", ""),
  21624. null;
  21625. var o = n[0];
  21626. if ("hotSprite" == o.object.type){
  21627. this.intersectHot = o.object.belongHot
  21628. this.intersectHot.showTitle()
  21629. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21630. this.intersectHot.actionType == 'noAction' || $("#player").css("cursor", "pointer");
  21631. return;
  21632. }
  21633. $(".toolRight .spotList ul li").removeClass("active")
  21634. this.intersectHot = null;
  21635. /* if(window.EditOverlay && n && n.length){
  21636. if(n[0].object.parent.parent == this.overlayGroup){
  21637. this.hoverOverlay(n[0].object);
  21638. }else()
  21639. } */
  21640. var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
  21641. intersect || "add" != g_HotStatus && $("#player").css("cursor", this.currentCursor),
  21642. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21643. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21644. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21645. o.horizontal = .8 < o.normal.y);
  21646. return o
  21647. }
  21648. ,
  21649. t.prototype.updateClosestPano = function(e) {
  21650. var t = [a.filters.isPanoAligned()];
  21651. if (this.mode === V.PANORAMA) {
  21652. if (!this.currentPano)
  21653. return;
  21654. t.push(a.filters.not(this.currentPano)),
  21655. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21656. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21657. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21658. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21659. } else{
  21660. t.push((pano)=>{ // add
  21661. return this.checkHasNeighbor(pano)
  21662. })
  21663. t.push(a.filters.isOnVisibleFloor()),
  21664. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21665. }
  21666. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21667. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21668. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21669. this.closestPano = i) : this.isPanoHover = !1
  21670. }
  21671. ,
  21672. t.prototype.dollhouseMode = function(e, t) {
  21673. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21674. this.mode = V.DOLLHOUSE,
  21675. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21676. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21677. , n = new B.Vector3(15,10,15);
  21678. if (e && t) {
  21679. var r = T.FORWARD.clone().applyQuaternion(t)
  21680. , o = this.model.center.clone().sub(e).dot(r);
  21681. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21682. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21683. }
  21684. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21685. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21686. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21687. this.updateFromControls(),
  21688. this.model.alpha = 1,
  21689. this.model.skybox.material.uniforms.opacity.value = 0
  21690. }
  21691. ,
  21692. t.prototype.insideMode = function(e, t) {
  21693. var i = $.Deferred()
  21694. , n = t || null;
  21695. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21696. var r = [a.filters.isPanoAligned()];
  21697. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21698. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21699. this.flyToNewMode({
  21700. mode: V.PANORAMA,
  21701. pano: e,
  21702. callback: n
  21703. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21704. } else {
  21705. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21706. i.reject(o)
  21707. }
  21708. return i.promise()
  21709. }
  21710. ,
  21711. t.prototype.fitDollhouse = function(e, t, i) {
  21712. var maxY = this.model.boundingBox.max.y;//add
  21713. var n = T.FORWARD.clone().applyQuaternion(i);
  21714. i = n.clone().add(e);
  21715. this.cameraControls.activeControl.target.copy(i),
  21716. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  21717. }
  21718. ,
  21719. t.prototype.floorplanMode = function(e, t, i) {
  21720. this.mode = V.FLOORPLAN;
  21721. var n = this.cameraControls.controls[V.FLOORPLAN];
  21722. n.reset();
  21723. var r = e || this.model.center;
  21724. if (n.target.copy(r).setY(0),
  21725. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21726. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21727. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21728. t) {
  21729. var o = T.LEFT.clone().applyQuaternion(t);
  21730. n.rotateLeft(-Math.atan2(o.x, o.z))
  21731. } else
  21732. n.rotateToView(this.model.size, this.getDirection());
  21733. n.update(0)
  21734. }
  21735. ,
  21736. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21737. return e.skipWarpingCheck = !0,
  21738. this.flyToPano(e, t)
  21739. }
  21740. ,
  21741. t.prototype.updateMarkerVisi = function() {//加
  21742. if(this.mode != "panorama")return;
  21743. this.model.panos.list.forEach((pano)=>{
  21744. if(!pano.marker)return;
  21745. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21746. })
  21747. }
  21748. ,
  21749. t.prototype.updateHotVisible = function(pano){
  21750. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setPanoLog))return
  21751. var hots = this.model.hots;
  21752. pano = pano || this.currentPano;
  21753. for (var index in hots){
  21754. var visible;
  21755. if(this.mode != "panorama"){
  21756. visible = true;
  21757. }else{
  21758. //hots[index].mesh.material.depthTest = false;
  21759. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21760. }
  21761. hots[index].mesh.visible = visible;
  21762. }
  21763. }
  21764. t.prototype.flyToPano = function(e, t) {
  21765. var i, n = e.pano, aim = e.lookAtPoint, aimQua = e.quaternion,//ADD
  21766. o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride,
  21767. l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null
  21768. if (aim){
  21769. var m = (new B.Matrix4).lookAt(n.position, aim, T.UP)
  21770. aimQua = (new B.Quaternion).setFromRotationMatrix(m)
  21771. }
  21772. else aimQua = aimQua
  21773. var zoomLevel = e.zoomLevel || 1 //add
  21774. if(this.flying) return t && t(e)
  21775. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21776. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21777. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21778. t && t(),
  21779. !1;
  21780. this.updateLastView()
  21781. if (this.mode !== V.PANORAMA)
  21782. return void this.flyToNewMode({
  21783. mode: V.PANORAMA,
  21784. pano: n,
  21785. duration: o,
  21786. quaternion: aimQua,
  21787. callback: t
  21788. });
  21789. if (!n || (h = x.deepExtend(e), u = function() {
  21790. j.delayOneFrame(function() {
  21791. this.flyToPano(h, t)
  21792. }.bind(this))
  21793. }.bind(this),
  21794. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21795. var d = function(e) {
  21796. t && t(e)
  21797. }
  21798. .bind(this);
  21799. this.currentPano || (this.currentPano = n,
  21800. this.path.placeCpm(),
  21801. this.path.fadeOutCpm(k.path.fadeOutTime),
  21802. this.spider.draw());
  21803. var p = o;
  21804. if ("number" != typeof o) {
  21805. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21806. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21807. }
  21808. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21809. zoomLevel !== this.zoomLevel)
  21810. switch (k.zoom.transitionStyle) {
  21811. case 1:
  21812. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? p / 2 : p); //改
  21813. break;
  21814. case 2:
  21815. return h = x.deepExtend(e),
  21816. u = this.flyToPano.bind(this, h, t),
  21817. void this.smoothZoomFovTo(null, zoomLevel, k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21818. }
  21819. if (aimQua) {
  21820. G.cancelById(q.LookTransition),
  21821. p *= k.transition.aimSlowFactor;
  21822. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21823. , y = g.clone()
  21824. , A = new B.Vector3;
  21825. if (n === this.currentPano) {
  21826. var C = T.FORWARD.clone().applyQuaternion(g)
  21827. , I = T.FORWARD.clone().applyQuaternion(aimQua)
  21828. , E = C.angleTo(I);
  21829. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21830. void G.start(function(e) {
  21831. y.copy(g),
  21832. H.quaternion(y, aimQua)(e),
  21833. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21834. this.cameraControls.activeControl.lookAt(A)
  21835. }
  21836. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21837. }
  21838. }
  21839. if (n === this.currentPano )
  21840. return void d();
  21841. this.flying = !0;
  21842. var _ = this.position.clone()
  21843. , b = this.currentPano;
  21844. Y.debug("Flying to pano ", n.position);
  21845. this.emit(W.PanoChosen, this.currentPano, n);
  21846. this.emit(W.FlyingStarted, n.position, _, n, b);
  21847. this.updateHotVisible(n); //更新热点显示
  21848. this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
  21849. Overlay.updateVisibles([this.currentPano, n])
  21850. aimQua && G.start(function(e) {
  21851. y.copy(g),
  21852. H.quaternion(y, aimQua)(e),
  21853. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21854. this.cameraControls.activeControl.lookAt(A)
  21855. }
  21856. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21857. var w = c ? null : z[k.transition.movementEasing];
  21858. this.nextPano = n;
  21859. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21860. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21861. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21862. this.flying = !1,
  21863. this.currentPano !== n && this.currentPano.exit(),
  21864. n.enter(),
  21865. this.currentPano = n,
  21866. this.nextPano = null,
  21867. this.path.placeCpm(),
  21868. this.path.fadeOutCpm(k.path.fadeOutTime),
  21869. this.spider.draw(),
  21870. this.emit(W.FlyingEnded, n.position, _, n, b),
  21871. this.updateMarkerVisi();//add
  21872. d(e)
  21873. if(this.mode == "panorama" ){
  21874. EditOverlay.updatePano()
  21875. editTool.hotpoint.updatePano()
  21876. Overlay.updateVisibles([this.currentPano])
  21877. }
  21878. }
  21879. .bind(this), 0, w, "camFly", q.FlyToPano)
  21880. }
  21881. }
  21882. ,
  21883. window._transitionPosId = 9999
  21884. t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  21885. G.cancelById(_transitionPosId)
  21886. var begin = function(object, pos, qua, scale){
  21887. if(pos){
  21888. if(!same(object.position, pos, 0.01)){
  21889. G.start(H.vector(object.position, pos), o.dur, (e)=>{
  21890. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21891. }
  21892. if(qua && !same(object.quaternion, qua, 1e-6)){
  21893. G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
  21894. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21895. }
  21896. if(scale && !same(object.scale, scale, 0.001)){
  21897. G.start(H.vector(object.scale, scale), o.dur, (e)=>{
  21898. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21899. }
  21900. }
  21901. }
  21902. var same = function(vec1, vec2, diff){
  21903. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  21904. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  21905. return s
  21906. }
  21907. var sid = o.pano != void 0 ? o.pano.id : "outside";
  21908. this.overlayGroup.children.forEach(overlay=>{
  21909. var panoData = overlay.transformAtPanos[sid]
  21910. var useCustom = !panoData
  21911. //if(overlay.usingTransformData || !useCustom){
  21912. var pos = useCustom ? overlay.posCustom : panoData.pos;
  21913. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  21914. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  21915. overlay.getScaleBySize(panoData.width , panoData.height)
  21916. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  21917. begin(overlay, pos, qua, scale )
  21918. //}
  21919. overlay.usingTransformData = !useCustom
  21920. })
  21921. for(let i in this.model.hots){//是否判断visible?
  21922. var hot = this.model.hots[i];
  21923. var panoData = hot.transformAtPanos[sid];
  21924. var useCustom = !panoData
  21925. //if(hot.usingTransformData || !useCustom){
  21926. var pos = useCustom ? hot.position : panoData.pos;
  21927. var qua = hot.isSprite ? null : (useCustom ? hot.quaternion : panoData.qua);
  21928. begin(hot.mesh, pos, qua )
  21929. //}
  21930. hot.usingTransformData = !useCustom;
  21931. }
  21932. }
  21933. window._tranOutsideFocus = 4399
  21934. t.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  21935. console.log("focusPoint")
  21936. if(this.mode == "floorplan"){
  21937. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  21938. var control = player.cameraControls.controls.floorplan;
  21939. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  21940. var currentScale = control.absoluteScale;
  21941. var currentTarget = control.target.clone()
  21942. G.cancelById(window._tranOutsideFocus, true);
  21943. G.start(function(progress){
  21944. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  21945. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21946. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  21947. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21948. }else if(player.mode == "dollhouse"){
  21949. var control = player.cameraControls.controls.dollhouse;
  21950. var radius = o.radius || 8;
  21951. var currentTarget = control.target.clone()
  21952. var dir = control.offset.clone().normalize()
  21953. var currentRadius = control.offset.length();
  21954. G.cancelById(window._tranOutsideFocus, true);
  21955. G.start(function(progress){
  21956. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21957. let radius_ = radius*progress+currentRadius*(1-progress)
  21958. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  21959. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21960. }else if(this.mode == 'panorama'){
  21961. this.flyToPano({
  21962. lookAtPoint: o.aim.clone() ,
  21963. pano: this.currentPano,
  21964. aimDuration: o.dur || 600
  21965. })
  21966. }
  21967. }
  21968. t.prototype.fastForwardActivePanoFlight = function(e) {
  21969. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21970. G.adjustSpeed(q.FlyToPano, e),
  21971. G.adjustSpeed(q.LookTransition, e)
  21972. }
  21973. ,
  21974. t.prototype.flyToPanoClosestToMouse = function() {
  21975. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21976. this.intersect && this.updateClosestPano(this.intersect)),
  21977. this.closestPano)
  21978. return this.flyToPano({
  21979. pano: this.closestPano
  21980. });
  21981. var e = this.getMouseDirection();
  21982. this.flyDirection(e) || this.flyToPano({
  21983. pano: this.currentPano
  21984. })
  21985. }
  21986. ,
  21987. t.prototype.flyLocalDirection = function(e) {
  21988. var t = this.getDirection(e)
  21989. , i = 1 === e.z ? .4 : .75
  21990. , n = 1 === Math.abs(e.x);
  21991. return this.flyDirection(t, i, n)
  21992. }
  21993. ,
  21994. t.prototype.flyDirection = function(e, t, i) {
  21995. this.closePopup();
  21996. var n = $.Deferred();
  21997. this.history.invalidate();
  21998. var r = this.closestPanoInDirection(e, t, i);
  21999. return r ? this.flyToPano({
  22000. pano: r
  22001. }, n.resolve.bind(n, !0)) : (this.bump(e),
  22002. n.resolve(!1)),
  22003. n.promise()
  22004. }
  22005. ,
  22006. t.prototype.closestPanoInDirection = function(e, t, i) {
  22007. return this.rankedPanoInDirection(0, e, t, i)
  22008. }
  22009. ,
  22010. t.prototype.rankedPanoInDirection = (_ = {
  22011. pano: null,
  22012. candidates: []
  22013. },
  22014. function(e, t, i, n) {
  22015. e = e || 0,
  22016. i = void 0 !== i ? i : .75;
  22017. var r = n ? "angle" : "direction";
  22018. return this.model.panos.findRankedByScore(e, [a.filters.isPanoAligned(), a.filters.inPanoDirection(this.position, t, i), a.filters.isNeighbourPanoTo(this.currentPano), a.filters.not(this.currentPano)], [a.scoreFunctions.distanceSquared(this.currentPano), a.scoreFunctions[r](this.position, t)], _),
  22019. this.cachedPanoCandidates = _.candidates,
  22020. _.pano
  22021. }
  22022. ),
  22023. t.prototype.bump = function(e) {
  22024. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  22025. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  22026. if (.5 < Math.abs(a))
  22027. t = function() {
  22028. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  22029. }
  22030. .bind(this),
  22031. i = function() {
  22032. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  22033. }
  22034. .bind(this);
  22035. else {
  22036. var s = this.camera.position.clone()
  22037. , l = e.clone();
  22038. this.raycaster.set(s, l);
  22039. var c = this.model.floors.reduce(function(e, t) {
  22040. return e.concat(t.collider.children)
  22041. }, [])
  22042. , h = this.raycaster.intersectObjects(c)
  22043. , u = 0 < h.length ? h[0].distance / 25 : .04
  22044. , d = s.clone().add(l.multiplyScalar(u));
  22045. t = function() {
  22046. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  22047. }
  22048. .bind(this),
  22049. i = function() {
  22050. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  22051. }
  22052. .bind(this)
  22053. }
  22054. n = function() {
  22055. this.flying = !1
  22056. }
  22057. .bind(this),
  22058. this.flying = !0,
  22059. t()
  22060. }
  22061. }
  22062. ,
  22063. t.prototype.changeFloor = function(e) {
  22064. if (!this.is360View(this.mode, this.currentPano))
  22065. if (this.mode === V.PANORAMA) {
  22066. var t = this.history.reversePano(e);
  22067. t && t.isAligned() ? this.flyToPano({
  22068. pano: t
  22069. }) : this.changeFloorByScore(e)
  22070. } else
  22071. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  22072. }
  22073. ,
  22074. t.prototype.changeFloorByScore = (E = {
  22075. pano: null,
  22076. candidates: []
  22077. },
  22078. function(e) {
  22079. var t = this.model.nextFloor(e);
  22080. return t ? (this.model.panos.lowestByScore([a.filters.atFloor(t), a.filters.isPanoAligned()], [a.scoreFunctions.distance(this.currentPano), a.scoreFunctions.direction(this.position, new B.Vector3(0,e,0)), a.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], E),
  22081. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  22082. this.history.push(e, this.currentPano),
  22083. this.flyToPano({
  22084. pano: E.pano
  22085. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  22086. }
  22087. ),
  22088. t.prototype.gotoFloor = function(e) {
  22089. var t = e - this.model.currentFloor.floorIndex;
  22090. this.changeFloor(t)
  22091. }
  22092. ,
  22093. t.prototype.getDirection = function(e) {
  22094. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  22095. }
  22096. ,
  22097. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  22098. if (r = r || $.Deferred(),
  22099. this.mode === V.TRANSITIONING)
  22100. return Y.warn("should not be transitioning here"),
  22101. n && n(!1),
  22102. r.reject().promise();
  22103. var o = i || !1
  22104. , a = i ? i.position : this.position
  22105. , s = this.position.clone()
  22106. , l = this.currentPano;
  22107. if (Y.debug("New pose in mode " + this.mode),
  22108. !e || (retryCallback = function() {
  22109. j.delayOneFrame(function() {
  22110. this.flyToSameMode(e, t, i, n, r)
  22111. }
  22112. .bind(this))
  22113. }
  22114. .bind(this),
  22115. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  22116. var c = function() {
  22117. this.emit(W.FlyingEnded, a, s, e, l),
  22118. n && n(!0)
  22119. }
  22120. .bind(this)
  22121. , h = k[this.mode]
  22122. , u = void 0 !== t ? t : h.transitionTime
  22123. , d = new B.Vector3
  22124. , p = new B.Vector3;
  22125. if (this.emit(W.FlyingStarted, a, s, e, l),
  22126. this.mode === V.PANORAMA)
  22127. Y.warn("we should not be here for panorama views");
  22128. else if (this.mode === V.DOLLHOUSE)
  22129. if (o) {
  22130. var f = new B.Vector3(0,1,0);
  22131. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  22132. this.model.warpDestFloors(i.floorVisibility),
  22133. p.copy(i.position);
  22134. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  22135. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  22136. , v = 3;
  22137. m.length ? (d.copy(m[0].point),
  22138. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  22139. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  22140. var y = (new B.Matrix4).lookAt(p, d, f)
  22141. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  22142. , C = d.distanceTo(p)
  22143. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  22144. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  22145. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  22146. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  22147. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  22148. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  22149. this.path.burnsDir = Math.sign(b.y);
  22150. var w = new B.Euler(0,0,0,k.warp.eOrder)
  22151. , T = new B.Vector3;
  22152. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  22153. G.start(function(e, t) {
  22154. w.x = E.x + e * b.x,
  22155. w.y = E.y + e * b.y,
  22156. w.z = E.z + e * b.z;
  22157. var i = _ + e * (C - _);
  22158. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  22159. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  22160. }
  22161. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  22162. G.start(function(e, t) {
  22163. this.cameraControls.controls[V.DOLLHOUSE].update(),
  22164. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  22165. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  22166. }
  22167. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  22168. } else
  22169. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  22170. else if (this.path.placeCpm(),
  22171. this.path.fadeInCpm(k.path.fadeInTime),
  22172. i) {
  22173. this.model.warpDestFloors(i.floorVisibility);
  22174. var x = this.cameraControls.cameras[V.FLOORPLAN]
  22175. , S = this.cameraControls.controls[V.FLOORPLAN]
  22176. , M = S.target.clone()
  22177. , R = i.position.clone().sub(M)
  22178. , P = x.position.clone().sub(S.target).length()
  22179. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  22180. , L = Math.atan2(S.offset.x, S.offset.z)
  22181. , D = Math.atan2(O.x, O.z)
  22182. , N = S.absoluteScale
  22183. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  22184. G.start(function(e, t) {
  22185. S.target.copy(R).multiplyScalar(e).add(M);
  22186. var i = L + (D - L) * e;
  22187. S.offset.x = P * Math.sin(i),
  22188. S.offset.z = P * Math.cos(i),
  22189. x.position.copy(S.target).add(S.offset),
  22190. S.absoluteScale = N + e * (F - N),
  22191. S.update(),
  22192. this.quaternion.copy(x.quaternion),
  22193. this.position.copy(x.position),
  22194. this.target.copy(S.target),
  22195. this.camera.projectionMatrix.copy(x.projectionMatrix)
  22196. }
  22197. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  22198. } else
  22199. Y.info("flyToSameMode() funny floorplan view? skipping");
  22200. return G.setTimeout(function(e) {
  22201. this.mode = e,
  22202. c(),
  22203. r.resolve(!0)
  22204. }
  22205. .bind(this, this.mode), u, q.FlyToSameMode),
  22206. this.mode = V.TRANSITIONING,
  22207. r.promise()
  22208. }
  22209. }
  22210. ,
  22211. t.prototype.flyToNewMode = function(e, t) {
  22212. var i = (e = e || {}).mode
  22213. , n = e.pano
  22214. , r = e.duration
  22215. , o = e.warpDest
  22216. , a = e.callback
  22217. , s = e.force
  22218. , l = e.quaternion;
  22219. if (t = t || $.Deferred(),
  22220. this.isWarping())
  22221. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  22222. a && a(!1),
  22223. t.reject("Cannot change mode during tour transition").promise();
  22224. if (this.mode === V.TRANSITIONING)
  22225. return a && a(!1),
  22226. t.reject("Cannot change mode during mode transition").promise();
  22227. if (i === this.mode)
  22228. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  22229. t.promise()) : (a && a(!1),
  22230. t.reject("Already in " + i + " mode").promise());
  22231. var c = o || !1;
  22232. Y.debug("Switching mode to " + i);
  22233. var h = function() {
  22234. j.delayOneFrame(function() {
  22235. this.flyToNewMode(e, t)
  22236. }
  22237. .bind(this))
  22238. }
  22239. .bind(this);
  22240. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  22241. return t.promise();
  22242. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  22243. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  22244. this.model.waitForLoad(this.model, function() {
  22245. return this.model.meshTexturesLoaded
  22246. }
  22247. .bind(this)),
  22248. this.model.loadMeshTextures().done(h),
  22249. t.promise();
  22250. this.history.invalidate(),
  22251. this.updateLastView();
  22252. var u = this.mode
  22253. , d = this.cameraControls.cameras[i];
  22254. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  22255. var p = void 0 !== r ? r : e.transitionTime;
  22256. this.emit(W.ModeChanging, u, i, n),
  22257. n && (this.currentPano = n),
  22258. this.switchCameraMode(i, l),
  22259. G.cancelById(q.LookTransition);
  22260. var f = (new B.Vector3).copy(this.position);
  22261. this.modeTran = this.mode + "-" + i;
  22262. if(this.mode == "floorplan" && window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)){
  22263. VisiSet.finishSetPanoVisible()
  22264. VisiSet.finishSetTagVisible()
  22265. VisiSet.finishSetPanoLog()
  22266. }
  22267. if(editTool.atPanel == "screen"){
  22268. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  22269. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  22270. }
  22271. if(i == "panorama"){
  22272. this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
  22273. }else{
  22274. this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
  22275. }
  22276. if (i === V.PANORAMA)
  22277. this.emit(W.PanoChosen, n, n),
  22278. setTimeout(function() {
  22279. n.floor.enter(i)
  22280. }
  22281. .bind(this), p / 2),
  22282. this.path.fadeOutCpm(k.path.fadeOutTime);
  22283. else if (i === V.DOLLHOUSE) {
  22284. if (c && (this.model.stayPut = !0),
  22285. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  22286. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  22287. this.path.placeCpm(),
  22288. this.path.fadeInCpm(k.path.fadeInTime),
  22289. c) {
  22290. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  22291. f.set(15, 10, 15);
  22292. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  22293. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  22294. v.length ? (g.copy(v[0].point),
  22295. f.copy(o.position),
  22296. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(.75 * f.distanceTo(g), !0)) : (Y.warn("Tried to restore dollhouse mode that did not intersect...", o.position, o.quaternion),
  22297. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  22298. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  22299. f.add(this.model.position),
  22300. d.position.copy(f),
  22301. this.cameraControls.controls[V.DOLLHOUSE].update()
  22302. }
  22303. } else if (this.path.placeCpm(),
  22304. this.path.fadeInCpm(k.path.fadeInTime),
  22305. o) {
  22306. this.model.warpDestFloors(o.floorVisibility);
  22307. var y = this.cameraControls.cameras[V.FLOORPLAN]
  22308. , A = this.cameraControls.controls[V.FLOORPLAN]
  22309. , C = y.position.clone().sub(A.target)
  22310. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  22311. , E = Math.atan2(I.x, I.z);
  22312. A.target.copy(o.position);
  22313. var _ = C.length();
  22314. A.offset.x = _ * Math.sin(E),
  22315. A.offset.y = 0,
  22316. A.offset.z = _ * Math.cos(E),
  22317. y.position.copy(A.target).add(A.offset),
  22318. A.target.clone().sub(d.position),
  22319. d.quaternion.copy(o.quaternion),
  22320. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  22321. A.absoluteScale = A.currentScale,
  22322. A.update()
  22323. } else
  22324. this.model.currentFloor.enter(i);
  22325. var b = this.currentPano
  22326. , w = this.position.clone();
  22327. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  22328. this.flying = !0,
  22329. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  22330. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  22331. d.controls.update()),
  22332. e.blackoutStyle = P.FADEIN,
  22333. p = k.show360Views.transitionTime,
  22334. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  22335. this.mode = i,
  22336. this.path && this.path.popOutCpm(),
  22337. e.blackoutStyle = P.END,
  22338. p = k.show360Views.transitionTime,
  22339. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  22340. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  22341. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  22342. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  22343. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  22344. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  22345. G.setTimeout(function() {
  22346. this.flying = !1,
  22347. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  22348. this.currentPano.enter(),
  22349. this.path.placeCpm(),
  22350. this.path.fadeOutCpm(k.path.fadeOutTime),
  22351. this.spider.draw()),
  22352. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  22353. this.mode = i,
  22354. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  22355. if (this.afterCModeFuc) {
  22356. //手动加的函数
  22357. var cf = this.afterCModeFuc;
  22358. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  22359. cf();
  22360. }
  22361. this.updateMarkerVisi();//add
  22362. (this.mode == u.PANORAMA) && this.updateHotVisible()//add
  22363. if(this.mode == "panorama" ){
  22364. EditOverlay.updatePano()
  22365. editTool.hotpoint.updatePano()
  22366. }
  22367. //this.mode == u.PANORAMA && this.transitionPos({type:"flyDone", this.currentPano})//add
  22368. if(this.mode == V.PANORAMA){
  22369. Overlay.updateVisibles([this.currentPano])
  22370. }else{
  22371. Overlay.updateVisibles(true)
  22372. this.overlayGroup.children.forEach(overlay=>{
  22373. if(overlay.animateInfo){
  22374. GifTexDeal.start(overlay.animation)
  22375. }
  22376. })
  22377. }
  22378. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  22379. t.resolve())
  22380. }
  22381. .bind(this), p, q.FlyToNewMode),
  22382. this.mode = V.TRANSITIONING,
  22383. EditOverlay.updatePano(),//add
  22384. editTool.hotpoint.updatePano(),//add
  22385. u == "panorama" && this.updateHotVisible(),
  22386. t.promise()
  22387. }
  22388. ,
  22389. t.prototype.fade360View = function(e, t, i) {
  22390. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  22391. $(this.domElement).fadeOut(.5 * e, function() {
  22392. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  22393. this.model.alpha = i.modelAlpha,
  22394. this.position.copy(t.position),
  22395. this.quaternion.copy(t.quaternion),
  22396. this.camera.projectionMatrix.copy(t.projectionMatrix),
  22397. $(this.domElement).fadeIn(.5 * e)
  22398. }
  22399. .bind(this))
  22400. }
  22401. ,
  22402. t.prototype.findDefaultViews = function() {
  22403. this.findDefaultView(this.lastInsideView, !0),
  22404. this.findDefaultView(this.last360View, !1)
  22405. }
  22406. ,
  22407. t.prototype.findDefaultView = function(e, i) {
  22408. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  22409. if (e.cameraMode !== V.PANORAMA)
  22410. return !1;
  22411. var t = r.get(e.panoId);
  22412. return t && t.isAligned() === i
  22413. });
  22414. 0 <= o ? (t = r.get(n[o].panoId),
  22415. e.update({
  22416. cameraMode: V.PANORAMA,
  22417. pano: t,
  22418. position: n[o].position,
  22419. quaternion: n[o].quaternion
  22420. })) : 0 <= (o = r.list.findIndex(function(e) {
  22421. return e.isAligned() === i
  22422. })) ? (t = r.list[o],
  22423. e.update({
  22424. cameraMode: V.PANORAMA,
  22425. pano: t,
  22426. position: t.position
  22427. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  22428. }
  22429. ,
  22430. t.prototype.updateLastView = function() {
  22431. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  22432. pano: this.currentPano,
  22433. position: this.position,
  22434. quaternion: this.quaternion
  22435. })
  22436. }
  22437. ,
  22438. t.prototype.goToLastView = function(e, t) {
  22439. var i = $.Deferred()
  22440. , n = i.resolve.bind(i)
  22441. , r = i.reject.bind(i)
  22442. , o = e ? this.lastInsideView : this.last360View;
  22443. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22444. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22445. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22446. mode: o.cameraMode,
  22447. pano: o.pano,
  22448. quaternion: o.quaternion,
  22449. callback: t
  22450. }).done(n).fail(r),
  22451. i.promise()
  22452. }
  22453. ,
  22454. t.prototype.fadeToView = function(e, t, i, n) {
  22455. var r = $.Deferred()
  22456. , o = r.resolve.bind(r)
  22457. , a = r.reject.bind(r);
  22458. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  22459. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  22460. a("Cannot go to illegal view"),
  22461. r.promise();
  22462. var s = (k[t.cameraMode],
  22463. function() {
  22464. $(this.domElement).fadeIn(.5 * i),
  22465. n && n(),
  22466. o()
  22467. }
  22468. .bind(this))
  22469. , l = e ? P.FADEIN : P.END;
  22470. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22471. $(this.domElement).fadeOut(.5 * i, function() {
  22472. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  22473. t.cameraMode === V.PANORAMA ? this.flyToPano({
  22474. pano: t.pano,
  22475. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22476. duration: 0
  22477. }, s) : this.flyToNewMode({
  22478. mode: t.cameraMode,
  22479. quaternion: t.quaternion,
  22480. duration: 0,
  22481. callback: s
  22482. })
  22483. }
  22484. .bind(this)),
  22485. r.promise()
  22486. }
  22487. ,
  22488. t.prototype.startWarp = function(e, t, i, n, r, o) {
  22489. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22490. this.flying)
  22491. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  22492. o && o(),
  22493. !1;
  22494. null != e || (e = M.Show),
  22495. this.history.invalidate(),
  22496. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  22497. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  22498. return this.emit(W.WarpStarted, a, i, n, r),
  22499. n = n || P.MIDDLE,
  22500. this.path.warpToPano(i, n, r, function() {
  22501. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  22502. this.emit(W.WarpEnded, i),
  22503. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22504. o && o()
  22505. }
  22506. .bind(this)),
  22507. e === M.Hide && this.path.discardPathObject(),
  22508. !0
  22509. }
  22510. ,
  22511. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22512. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22513. s && s(),
  22514. !1)
  22515. }
  22516. ,
  22517. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22518. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22519. a && a(),
  22520. !1)
  22521. }
  22522. ,
  22523. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22524. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22525. }
  22526. ,
  22527. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22528. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22529. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22530. t && t(),
  22531. !1)
  22532. }
  22533. ,
  22534. t.prototype.aimTourCamera = function(e, t, i, n) {
  22535. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22536. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22537. }
  22538. ,
  22539. t.prototype.showPathToHeroLocation = function(e) {
  22540. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  22541. }
  22542. ,
  22543. t.prototype.tourInterlude = function(e, t) {
  22544. this.history.invalidate(),
  22545. this.path.discardSlow();
  22546. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  22547. var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
  22548. var current = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  22549. var rotTime = currentLocation && currentLocation.musicInfo.music ? currentLocation.musicInfo.time - current : 2e3;
  22550. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  22551. var timeEachItem = 2000;//假设每个item飞的时间
  22552. var rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  22553. }
  22554. rotTime = Math.max(0, rotTime)
  22555. console.log("rotTime "+rotTime +" at item "+this.director.currentItem + ",musicCurrentTime:"+current)
  22556. this.path.waitNextStep(e, function() {//等待音乐播放一段时间再下一步,此时镜头会缓慢旋转
  22557. t && t()
  22558. }
  22559. .bind(this), rotTime)
  22560. }
  22561. ,
  22562. t.prototype.stopInterlude = function() {
  22563. this.interruptAndFastForward(null, 0)
  22564. }
  22565. ,
  22566. t.prototype.interruptAndFastForward = function(e, t) {
  22567. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  22568. this.flying && this.emit(W.FlyingInterrupted),
  22569. this.path.interruptAndFastForward(e, t)
  22570. }
  22571. ,
  22572. t.prototype.setSize = function(e, t) {
  22573. var i = e / t;
  22574. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  22575. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  22576. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  22577. this.cameraControls.cameras) {
  22578. var o = this.cameraControls.cameras[r];
  22579. o.fov = this.baseFov * (1 / this.zoomLevel),
  22580. o.updateAspect(i)
  22581. }
  22582. }
  22583. ,
  22584. t.prototype.toJSON = function() {
  22585. var e = {};
  22586. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  22587. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22588. return e.hidden ? 0 : 1
  22589. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22590. e
  22591. }
  22592. ,
  22593. t.prototype.getCurrentNodePanos = function(e) {
  22594. if (this.model.panos.map,
  22595. e.length = 0,
  22596. this.path.nodes)
  22597. for (var t = 0; t < this.path.nodes.length; t++) {
  22598. var i = this.path.nodes[t];
  22599. e.push(this.model.panos.get(i))
  22600. }
  22601. }
  22602. ,
  22603. t.prototype.zoomIncrementally = function(e) {
  22604. var t = this.zoomLevel;
  22605. this.zoomTo(this.zoomLevel + e),
  22606. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22607. }
  22608. ,
  22609. t.prototype.zoomInIncrementally = function(e) {
  22610. e = e || this.defaultZoomIncrement,
  22611. this.zoomIncrementally(e)
  22612. }
  22613. ,
  22614. t.prototype.zoomOutIncrementally = function(e) {
  22615. e = e || -this.defaultZoomIncrement,
  22616. this.zoomIncrementally(e)
  22617. }
  22618. ,
  22619. t.prototype.zoomBy = function(e) {
  22620. this.zoomTo(this.zoomLevel * e)
  22621. }
  22622. ,
  22623. t.prototype.zoomIn = function() {
  22624. this.zoomBy(1 + this.zoomSpeed)
  22625. }
  22626. ,
  22627. t.prototype.zoomOut = function() {
  22628. this.zoomBy(1 - this.zoomSpeed)
  22629. }
  22630. ,
  22631. t.prototype.zoomTo = function(e, t) {
  22632. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  22633. e > k.zoom.max && (e = k.zoom.max),
  22634. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  22635. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  22636. e === k.zoom.min && this.emit(m.ZoomMin)),
  22637. this.cameraControls.activeControl)) {
  22638. var i = this.cameraControls.activeControl.camera;
  22639. this.zoomLevel = e,
  22640. i.fov = this.baseFov * (1 / this.zoomLevel),
  22641. i.updateProjectionMatrix(),
  22642. this.zoomFov = i.fov
  22643. }
  22644. }
  22645. ,
  22646. t.prototype.increaseZoomSpeed = function() {
  22647. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22648. }
  22649. ,
  22650. t.prototype.decreaseZoomSpeed = function() {
  22651. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22652. }
  22653. ,
  22654. t.prototype.clampZoomSpeed = function(e) {
  22655. return e < 0 ? 0 : e
  22656. }
  22657. ,
  22658. t.prototype.activatePersistentZooming = function(e) {
  22659. this.zooming = e ? 1 : -1
  22660. }
  22661. ,
  22662. t.prototype.deactivatePersistentZooming = function() {
  22663. this.zooming = 0
  22664. }
  22665. ,
  22666. t.prototype.zoomDefault = function() {
  22667. this.zoomTo(1, !0)
  22668. }
  22669. window.fovTranId = 333;//add
  22670. t.prototype.smoothZoomToDefault = function(e, t) {
  22671. G.cancelById(window.fovTranId)
  22672. var i, n = this.zoomLevel, r = function(e) {
  22673. 1 < e && (e = 1),
  22674. i = n * (1 - e) + e,
  22675. this.zoomTo(i, !0)
  22676. }
  22677. .bind(this), o = function() {
  22678. this.zoomDefault(),
  22679. t && window.setTimeout(t, 50)
  22680. }
  22681. .bind(this);
  22682. G.start(r, e, o, null, 0, z[k.transition.blendEasing], null, window.fovTranId)
  22683. }
  22684. ,
  22685. t.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  22686. G.cancelById(window.fovTranId)
  22687. var i,
  22688. n = this.zoomLevel,
  22689. aimLevel = zoomLevel || this.baseFov / fov
  22690. if (n == aimLevel) return
  22691. var fun = function (e) {
  22692. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0)
  22693. }.bind(this)
  22694. G.start(fun, dur, callback, null, 0, z[k.transition.easeInCubic], null, window.fovTranId)
  22695. }
  22696. ,
  22697. t.prototype.updateZoomPano = function() {
  22698. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22699. var e = this.currentPano;
  22700. if (e) {
  22701. var t = this.zoomLevel > k.zoom.activationThreshold
  22702. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  22703. t);
  22704. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  22705. this.panoRenderer.setZoomingActive(i, e, !0);
  22706. var n = function(e, t) {
  22707. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22708. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22709. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22710. e.setZoomed(t)
  22711. }
  22712. .bind(this);
  22713. i && !e.zoomed ? (n(e, !0),
  22714. this.panoRenderer.enableUltraHighQualityMode(function() {
  22715. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  22716. i && n(e, !0)
  22717. }
  22718. .bind(this))) : !t && e.zoomed && n(e, !1)
  22719. }
  22720. }
  22721. },
  22722. //--------
  22723. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  22724. var f2;
  22725. if (this.mode == mode) {
  22726. f1 && f1()
  22727. } else {
  22728. f2 = f1;
  22729. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22730. this.afterCModeFuc = function() {
  22731. this.afterCModeFuc = f2
  22732. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  22733. }.bind(this)
  22734. } else {
  22735. this.afterCModeFuc = f2;//飞入后执行
  22736. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22737. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  22738. }catch(e){}
  22739. }
  22740. }
  22741. }
  22742. ,
  22743. t.prototype.checkHasNeighbor = function(pano){//add
  22744. for(var i in pano.neighbourPanos ){
  22745. if(i == pano.id)continue;
  22746. if(pano.neighbourPanos[i]){
  22747. return true;
  22748. }
  22749. }
  22750. }
  22751. ,
  22752. ee.exports = t
  22753. }
  22754. ).call(this, "/js/player.js")
  22755. }
  22756. , {
  22757. "./constants": 8,
  22758. "./enum/AlignmentType": 17,
  22759. "./enum/BlackoutStyle": 18,
  22760. "./enum/ControlEvents": 21,
  22761. "./enum/Keys": 30,
  22762. "./enum/ModelManagerEvents": 33,
  22763. "./enum/PanoSizeClass": 36,
  22764. "./enum/PanoramaEvents": 37,
  22765. "./enum/PathDiscardMode": 38,
  22766. "./enum/PathDisplayMode": 39,
  22767. "./enum/PlayerEvents": 40,
  22768. "./enum/TagStates": 44,
  22769. "./enum/Vectors": 50,
  22770. "./enum/Viewmode": 51,
  22771. "./enum/WarpStyle": 52,
  22772. "./enum/ZoomEvents": 53,
  22773. "./exception/BasicException": 55,
  22774. "./model/ModelManager": 140,
  22775. "./objects/NSpider": 147,
  22776. "./objects/Panorama": 148,
  22777. "./objects/Reticule": 149,
  22778. "./objects/ShowPath": 151,
  22779. "./objects/Snapshot": 153,
  22780. "./objects/View": 154,
  22781. "./settings": 166,
  22782. "./shaders": 167,
  22783. "./tile/TileDownloader": 171,
  22784. "./tile/TilePrioritizer": 172,
  22785. "./util/ZoomStats": 179,
  22786. "./util/browser": 182,
  22787. "./util/camera": 183,
  22788. "./util/cameraLight": 184,
  22789. "./util/common": 185,
  22790. "./util/easing": 186,
  22791. "./util/history": 187,
  22792. "./util/lerp": 188,
  22793. "./util/logger": 189,
  22794. "./util/math": 190,
  22795. "./util/transitions": 195,
  22796. hot: "hot",
  22797. scaleImg: "scaleImg",
  22798. events: 202,
  22799. three: 217
  22800. }],
  22801. scaleImg: [function(e, t) {
  22802. var i = t;
  22803. (function() {
  22804. function e(e, t, i, n) {
  22805. function r() {
  22806. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22807. U.height = p,
  22808. H = U.getContext("2d")
  22809. }
  22810. function o(e) {
  22811. if (e) {
  22812. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22813. for (t = 0; t < ie; t += 4)
  22814. n[t] = e[t] * ne | 0,
  22815. n[t + 1] = e[t + 1] * ne | 0,
  22816. n[t + 2] = e[t + 2] * ne | 0,
  22817. n[t + 3] = e[t + 3] * ne | 0;
  22818. return delete e,
  22819. i
  22820. }
  22821. return H.getImageData(0, 0, d, p)
  22822. }
  22823. function a(e, t, i, n, r) {
  22824. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22825. }
  22826. var s, l;
  22827. if (t || (t = e.input,
  22828. i = e.output,
  22829. n = e.inputRemovable,
  22830. e.scale && (e = e.scale)),
  22831. t.src)
  22832. if (s = document.createElement("canvas"),
  22833. null != t.naturalWidth)
  22834. s.width = t.naturalWidth,
  22835. s.height = t.naturalHeight;
  22836. else if (null != t.runtimeStyle) {
  22837. var c = t.runtimeStyle
  22838. , h = c.width
  22839. , u = c.height;
  22840. c.width = "auto",
  22841. c.height = "auto",
  22842. s.width = t.width,
  22843. s.height = t.height,
  22844. c.width = h,
  22845. c.height = u
  22846. } else {
  22847. h = t.width,
  22848. u = t.height;
  22849. t.removeAttribute && (t.removeAttribute("width"),
  22850. t.removeAttribute("height")),
  22851. s.width = t.width,
  22852. s.height = t.height,
  22853. t.width = h,
  22854. t.height = u
  22855. }
  22856. else
  22857. s = t;
  22858. l = s.getContext("2d"),
  22859. t.src && l.drawImage(t, 0, 0);
  22860. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22861. if (!f || !g)
  22862. return !1;
  22863. (t.src || n) && s.clearRect(0, 0, f, g),
  22864. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22865. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22866. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22867. e * g + .5 | 0);
  22868. var v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J = d << 2, $ = f << 2, ee = 0, te = 0, ie = J * p, ne = 255.99 / 255, re = d / f, oe = p / g, ae = re * oe;
  22869. if (1 < re || 1 < oe)
  22870. for (r(),
  22871. G = (z = o()).data,
  22872. C = 0; C < p; C++)
  22873. for (V = (y = C / oe) - (w = 0 | y),
  22874. j = w * $,
  22875. W = w < 1 ? j : j - $,
  22876. w < g - 2 ? (Y = j + $,
  22877. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22878. A = 0; A < d; A++,
  22879. te += 4)
  22880. Z = (b = 0 | (v = A / re)) << 2,
  22881. b < f - 2 ? (K = Z + 4,
  22882. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22883. D = a(V, a(k = v - b, m[W + (X = b < 1 ? Z : Z - 4)], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22884. ++Z,
  22885. ++K,
  22886. ++Q,
  22887. F = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22888. ++Z,
  22889. ++K,
  22890. ++Q,
  22891. B = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22892. ++Z,
  22893. ++K,
  22894. ++Q,
  22895. N = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22896. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22897. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22898. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22899. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22900. else {
  22901. if (le.Float32Array)
  22902. L = new Float32Array(ie);
  22903. else
  22904. for (L = [],
  22905. te = 0; te < ie; ++te)
  22906. L[te] = 0;
  22907. for (y = 0; y < g; y++)
  22908. for (I = (_ = 0 | (C = y * oe)) * J,
  22909. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22910. R = C + oe - _ - 1),
  22911. v = 0; v < f; v++,
  22912. ee += 4)
  22913. switch (A = v * re,
  22914. E = 0 | A,
  22915. te = I + (E << 2),
  22916. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22917. P && (x = 1 + E - A,
  22918. S = A + re - E - 1),
  22919. D = m[ee],
  22920. F = m[ee + 1],
  22921. B = m[ee + 2],
  22922. N = m[ee + 3],
  22923. P + O) {
  22924. case 0:
  22925. L[te] += D * ae,
  22926. L[te + 1] += F * ae,
  22927. L[te + 2] += B * ae,
  22928. L[te + 3] += N * ae;
  22929. break;
  22930. case 1:
  22931. T = x * oe,
  22932. L[te] += D * T,
  22933. L[te + 1] += F * T,
  22934. L[te + 2] += B * T,
  22935. L[te + 3] += N * T,
  22936. T = S * oe,
  22937. L[te + 4] += D * T,
  22938. L[te + 5] += F * T,
  22939. L[te + 6] += B * T,
  22940. L[te + 7] += N * T;
  22941. break;
  22942. case 2:
  22943. T = re * M,
  22944. L[te] += D * T,
  22945. L[te + 1] += F * T,
  22946. L[te + 2] += B * T,
  22947. L[te + 3] += N * T,
  22948. T = re * R,
  22949. L[te += J] += D * T,
  22950. L[te + 1] += F * T,
  22951. L[te + 2] += B * T,
  22952. L[te + 3] += N * T;
  22953. break;
  22954. default:
  22955. T = x * M,
  22956. L[te] += D * T,
  22957. L[te + 1] += F * T,
  22958. L[te + 2] += B * T,
  22959. L[te + 3] += N * T,
  22960. T = S * M,
  22961. L[te + 4] += D * T,
  22962. L[te + 5] += F * T,
  22963. L[te + 6] += B * T,
  22964. L[te + 7] += N * T,
  22965. T = x * R,
  22966. L[te += J] += D * T,
  22967. L[te + 1] += F * T,
  22968. L[te + 2] += B * T,
  22969. L[te + 3] += N * T,
  22970. T = S * R,
  22971. L[te + 4] += D * T,
  22972. L[te + 5] += F * T,
  22973. L[te + 6] += B * T,
  22974. L[te + 7] += N * T
  22975. }
  22976. delete m,
  22977. r(),
  22978. z = o(L)
  22979. }
  22980. if (H.putImageData(z, 0, 0),
  22981. "string" == typeof i) {
  22982. var se;
  22983. if ("png" === i || "jpeg" === i)
  22984. return (se = n && t.src ? t : new Image).width = d,
  22985. se.height = p,
  22986. se.src = U.toDataURL("image/" + i, .85),
  22987. se;
  22988. if ("png-src" === i || "jpeg-src" === i)
  22989. return U.toDataURL("image/" + i.split("-")[0], .85)
  22990. }
  22991. return U
  22992. }
  22993. var le = this;
  22994. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22995. exports.scale = e) : c = e
  22996. }
  22997. ).call(this),
  22998. i.exports = c
  22999. }
  23000. , {}],
  23001. 156: [function(i, n, e) {
  23002. (function(e) {
  23003. "use strict";
  23004. function t(e, t) {
  23005. this.model = e,
  23006. this.panos = e.panos,
  23007. this.player = t,
  23008. this.imagePanos = this.listImagePanos(),
  23009. this.retryMinimumTime = 1e4
  23010. }
  23011. var r = (i("three"),
  23012. i("./enum/Viewmode"))
  23013. , o = (i("./settings"),
  23014. i("./objects/Panorama"))
  23015. , a = new (i("./util/logger"))(e);
  23016. t.prototype.start = function() {
  23017. this.loadNextPano(function(e) {
  23018. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  23019. setTimeout(function() {
  23020. this.start()
  23021. }
  23022. .bind(this), 1e3))
  23023. }
  23024. .bind(this))
  23025. }
  23026. ,
  23027. t.prototype.validLoadTarget = function(e) {
  23028. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  23029. }
  23030. ,
  23031. t.prototype.listImagePanos = function() {
  23032. var i = []
  23033. , n = this;
  23034. return this.model.images.forEach(function(e) {
  23035. if (e.metadata && e.metadata.scan_id) {
  23036. var t = n.model.panos.get(e.metadata.scan_id);
  23037. t && !t.isLoaded("high") && i.push(t)
  23038. }
  23039. }),
  23040. i
  23041. }
  23042. ,
  23043. t.prototype.nextNotLoadedImage = function() {
  23044. for (; 0 < this.imagePanos.length; ) {
  23045. var e = this.imagePanos[0];
  23046. if (!e.isLoaded("high"))
  23047. return e;
  23048. this.imagePanos.shift()
  23049. }
  23050. return null
  23051. }
  23052. ,
  23053. t.prototype.loadNextPano = function(e) {
  23054. var t, i, n = this.model.waitQueue.filter(function(e) {
  23055. return e.object instanceof o
  23056. });
  23057. 0 < n.length ? (t = n[0].object,
  23058. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  23059. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  23060. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  23061. t = this.imagePanos[0],
  23062. a.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())])) && a.debug("Normal pano selection: neighbor " + t.id),
  23063. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  23064. a.debug("Preloading " + i + "-res pano " + t.id),
  23065. t.loadCube(i).done(e).fail(function() {
  23066. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  23067. e()
  23068. })) : e && e(null)
  23069. }
  23070. ,
  23071. n.exports = t
  23072. }
  23073. ).call(this, "/js/preloaders.js")
  23074. }
  23075. , {
  23076. "./enum/Viewmode": 51,
  23077. "./objects/Panorama": 148,
  23078. "./settings": 166,
  23079. "./util/logger": 189,
  23080. three: 217
  23081. }],
  23082. 157: [function(a, s, e) {
  23083. (function(e) {
  23084. "use strict";
  23085. function t(e, t, i, n, r) {
  23086. this.qualityManager = e,
  23087. this.scene = t,
  23088. this.camera = i,
  23089. this.container = r,
  23090. this.controls = n,
  23091. this.controls.enabled = !0,
  23092. this.controls.locked = !0,
  23093. this.quickstartCamera = n.camera,
  23094. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  23095. this.skybox = null
  23096. }
  23097. var i = a("three")
  23098. , n = a("../util/logger")
  23099. , o = a("../constants")
  23100. , h = (a("../util/transitions"),
  23101. a("../util/lerp"),
  23102. a("../util/easing"),
  23103. a("../enum/Vectors"))
  23104. , u = a("../enum/PanoSizeClass")
  23105. , r = (a("../materials/ModelTextureMaterial"),
  23106. a("../materials/CubemapMaterial"))
  23107. , d = (a("../cameras/PanoramaCamera"),
  23108. a("../controls/PanoramaControls"),
  23109. a("../tile/TileUtils"),
  23110. a("../util/camera"),
  23111. a("../util/cameraLight"))
  23112. , p = (a("../util/browser"),
  23113. a("../settings"),
  23114. a("../gui/helpManager"),
  23115. new n(e));
  23116. t.prototype.load = function(e) {
  23117. e.pano.shouldRedrawOnBaseLoaded = !0;
  23118. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  23119. this.controls.lookAt(r.add(this.quickstartCamera.position));
  23120. var a = this.qualityManager.getPanoSize(u.BASE)
  23121. , s = this.qualityManager.getPanoSize(u.STANDARD);
  23122. if (e.pano.tiled) {
  23123. p.warn("Loading startPano, TILED", e.pano.id);
  23124. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  23125. , c = this.quickstartCamera.fov;
  23126. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  23127. t = e.pano.loadTiledPano(s, r, {
  23128. hFov: l,
  23129. vFov: c
  23130. }, !1, !1, !0),
  23131. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  23132. } else
  23133. p.warn("Loading startPano", e.pano.id),
  23134. t = e.pano.loadCube("high");
  23135. return $.when(t).then(function() {
  23136. n.init(e.pano, e.quaternion),
  23137. e.pano.tiled ? i.done(function() {
  23138. e.pano.lockUntilRenderingComplete = !1,
  23139. this.controls.locked = !1
  23140. }
  23141. .bind(this)) : this.controls.locked = !1
  23142. }
  23143. .bind(this))
  23144. }
  23145. ,
  23146. t.prototype.init = function(e, t) {
  23147. p.info("Quickstart done loading, adding scene objects"),
  23148. e.lockUntilRenderingComplete = !0,
  23149. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  23150. side: i.BackSide
  23151. })),
  23152. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  23153. this.skybox.quaternion.copy(e.quaternion),
  23154. this.scene.add(this.skybox),
  23155. $(this.container).show()
  23156. }
  23157. ,
  23158. t.prototype.update = function(e) {
  23159. this.controls.update(e),
  23160. this.camera.copy(this.quickstartCamera)
  23161. }
  23162. ,
  23163. t.prototype.setSize = function(e, t) {
  23164. this.quickstartCamera.updateAspect(e / t)
  23165. }
  23166. ,
  23167. t.prototype.destroy = function() {
  23168. this.scene.remove(this.skybox)
  23169. }
  23170. ,
  23171. s.exports = t
  23172. }
  23173. ).call(this, "/js/scene/QuickstartManager.js")
  23174. }
  23175. , {
  23176. "../cameras/PanoramaCamera": 7,
  23177. "../constants": 8,
  23178. "../controls/PanoramaControls": 13,
  23179. "../enum/PanoSizeClass": 36,
  23180. "../enum/Vectors": 50,
  23181. "../gui/helpManager": 68,
  23182. "../materials/CubemapMaterial": 117,
  23183. "../materials/ModelTextureMaterial": 118,
  23184. "../settings": 166,
  23185. "../tile/TileUtils": 174,
  23186. "../util/browser": 182,
  23187. "../util/camera": 183,
  23188. "../util/cameraLight": 184,
  23189. "../util/easing": 186,
  23190. "../util/lerp": 188,
  23191. "../util/logger": 189,
  23192. "../util/transitions": 195,
  23193. three: 217
  23194. }],
  23195. 158: [function(e, t, i) {
  23196. "use strict";
  23197. function h(e, t, i) {
  23198. this.scene = e,
  23199. this.camera = t,
  23200. this.renderer = null,
  23201. this.effects = i,
  23202. this.animateCallback = null,
  23203. this.composer = null,
  23204. this.qualityManager = null,
  23205. e.renderWidth = 0,
  23206. e.renderHeight = 0,
  23207. this.updateClock = new M.Clock,
  23208. this.components = [],
  23209. this.updateListeners = [],
  23210. this.resizeListeners = [],
  23211. this.forceUpdateSize = !1,
  23212. this.started = !1,
  23213. this.textures = {},
  23214. this.suspendedObjects = []
  23215. }
  23216. var o, a, n, M = e("three"), R = e("../shaders"), r = e("../enum/SceneRendererEvents"), f = e("../enum/GLTextureType"), s = e("../enum/GLCubeFaces"), l = e("../exception/BasicException"), c = e("../exception/RendererCreationException"), u = e("../util/browser"), d = e("../settings"), p = e("events").EventEmitter;
  23217. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  23218. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  23219. this.components.push(e),
  23220. e.update && this.updateListeners.push(e),
  23221. e.setSize && (this.resizeListeners.push(e),
  23222. this.forceUpdateSize = !0)
  23223. }
  23224. ,
  23225. h.prototype.removeComponent = function(t) {
  23226. function e(e) {
  23227. return e !== t
  23228. }
  23229. this.components = this.components.filter(e),
  23230. this.updateListeners = this.updateListeners.filter(e),
  23231. this.resizeListeners = this.resizeListeners.filter(e)
  23232. }
  23233. ,
  23234. h.prototype.start = function(e) {
  23235. if (this.started)
  23236. throw new l("Can't start SceneRenderer, already started");
  23237. this.createContext(e),
  23238. //u.isMobile() && this.boluoVrInit(),
  23239. this.initComposer(),
  23240. this.started = !0,
  23241. (b = b.bind(this))()
  23242. }
  23243. ,
  23244. h.prototype.createContext = function(e) {
  23245. try {
  23246. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  23247. this.renderer.autoClear = !0,
  23248. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  23249. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  23250. this.emit(r.ContextCreated)
  23251. } catch (e) {
  23252. throw new c("Unable to create a WebGL rendering context")
  23253. }
  23254. d.profiling.enabled && this.overrideTextures(),
  23255. e.appendChild(this.renderer.domElement)
  23256. }
  23257. ,
  23258. h.prototype.overrideTextures = function() {
  23259. var d = this.renderer.context
  23260. , t = 0
  23261. , i = d.createTexture;
  23262. d.createTexture = function() {
  23263. var e = i.call(d);
  23264. return e.id = t++,
  23265. this.textures[e.id] = e
  23266. }
  23267. .bind(this);
  23268. var p = d.texImage2D;
  23269. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  23270. var c, h = this.getTextureTypeFromTarget(d, e);
  23271. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  23272. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  23273. s = r,
  23274. n = (l = o).naturalWidth,
  23275. r = l.naturalHeight,
  23276. p.call(d, e, t, i, a, s, l));
  23277. var u = this.textures[c.id];
  23278. u.width = h === f.TextureCube ? 6 * n : n,
  23279. u.height = r
  23280. }
  23281. .bind(this);
  23282. var n = d.deleteTexture;
  23283. d.deleteTexture = function(e) {
  23284. delete this.textures[e.id],
  23285. n.call(d, e)
  23286. }
  23287. .bind(this)
  23288. }
  23289. ,
  23290. h.prototype.updateTextureMemory = (n = null,
  23291. function() {
  23292. var e = 0;
  23293. for (var t in this.textures) {
  23294. var i = this.textures[t];
  23295. i.width && i.height && (e += i.width * i.height * 4)
  23296. }
  23297. e !== n && this.emit(r.MemoryUsageUpdated, e),
  23298. n = e
  23299. }
  23300. ),
  23301. h.prototype.getTextureTypeFromTarget = function(e, t) {
  23302. switch (t) {
  23303. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  23304. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  23305. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  23306. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23307. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  23308. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23309. return f.TextureCube;
  23310. case e.TEXTURE_2D:
  23311. return f.Texture2D;
  23312. default:
  23313. return null
  23314. }
  23315. }
  23316. ,
  23317. h.prototype.initComposer = function() {
  23318. this.composer = new M.EffectComposer(this.renderer),
  23319. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  23320. this.composer.addPass(this.effects.hblurPass),
  23321. this.composer.addPass(this.effects.vblurPass)
  23322. }
  23323. ,
  23324. h.prototype.setSize = function(e, t, i) {
  23325. this.renderWidth = e,
  23326. this.renderHeight = t,
  23327. this.effects.aspect = e / t,
  23328. this.renderer.setSize(e, t, !1, i),
  23329. this.composer.setSize(e, t);
  23330. for (var n = 0; n < this.resizeListeners.length; n++)
  23331. this.resizeListeners[n].setSize(e, t)
  23332. }
  23333. ,
  23334. h.prototype.render = function() {
  23335. 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  23336. }
  23337. ,
  23338. h.prototype.boluoVrInit = function() {
  23339. console.log("boluoVrInit"),
  23340. this.isHuawei5X = u.detectHUAWEI5X(),
  23341. this.oldRenderer = this.renderer,
  23342. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  23343. window.panoCamera = this.camera;
  23344. var i = this;
  23345. window._vrEnabled = !1,
  23346. Object.defineProperty(window, "vrEnabled", {
  23347. get: function() {
  23348. return window._vrEnabled
  23349. },
  23350. set: function(e) {
  23351. (e = !!e) ? (i.renderer = i.newRenderer,
  23352. window.vrMarkers.forEach(function(e) {
  23353. e.visible = !0
  23354. })) : (i.renderer = i.oldRenderer,
  23355. window.vrMarkers.forEach(function(e) {
  23356. e.visible = !1
  23357. })),
  23358. i.cursor.visible = e,
  23359. i.setSize($("#player").width(), $("#player").height()),
  23360. window._vrEnabled = e,
  23361. setTimeout(function() {
  23362. console.log(player.cameraControls.activeControl.camera.fov)
  23363. }, 500)
  23364. }
  23365. }),
  23366. this.createCursor(.5, !1, 1, 16777215, 0);
  23367. var e = {
  23368. setSize: function(e, t) {
  23369. i.camera.aspect = e / t
  23370. }
  23371. };
  23372. this.resizeListeners.push(e),
  23373. this.vrLoadingInit()
  23374. }
  23375. ,
  23376. h.prototype.vrLoadingInit = function() {
  23377. var e = new (e = function(camera) {
  23378. var t = this
  23379. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  23380. , i = new M.MeshBasicMaterial({
  23381. color: 4967932,
  23382. side: M.DoubleSide
  23383. })
  23384. , n = new M.Mesh(e,i);
  23385. (this.mesh = n).position.z = -2,
  23386. n.scale.set(.08, .08, .08),
  23387. n.visible = !1,
  23388. //window.player.camera.add(n),
  23389. camera.add(n),
  23390. t.enabled = !1,
  23391. this.update = function(e) {
  23392. 1 == t.enabled && (n.rotation.z += 15 * e)
  23393. }
  23394. }
  23395. )(this.camera);
  23396. window.Loading = e,
  23397. this.updateListeners.push(e)
  23398. }
  23399. ,
  23400. h.prototype.createCursor = function(e, t, i, n, r) {
  23401. var o, a = new M.SpriteMaterial({
  23402. opacity: i,
  23403. color: n,
  23404. transparent: t,
  23405. map: this.boluoGetTexture("images/cursor.png"),
  23406. needsUpdate: !0,
  23407. side: M.DoubleSide
  23408. });
  23409. a.map.offset = new M.Vector2(1 / 17 * r,0),
  23410. a.map.repeat = new M.Vector2(1 / 17,1),
  23411. a.depthTest = !1,
  23412. a.blending = M.AdditiveBlending,
  23413. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  23414. o.position.z = -2,
  23415. o.visible = !1,
  23416. o.name = "cursor",
  23417. this.camera.add(o),
  23418. this.scene.add(this.camera),
  23419. this.cursor = o;
  23420. var s = new this.CursorAnimation(this.scene,o,this.camera);
  23421. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  23422. this.updateListeners.push(s)
  23423. }
  23424. ,
  23425. h.prototype.CursorAnimation = function(e, t, o) {
  23426. this.cursor = t,
  23427. this.raycaster = new M.Raycaster,
  23428. this.targetEventObj = {},
  23429. this.type = 1,
  23430. this.tweenFlag = !0;
  23431. var s = this;
  23432. this.target = o,
  23433. console.log(o.uuid),
  23434. this.euler = new M.Euler,
  23435. this.q0 = new M.Quaternion,
  23436. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  23437. this.zee = new M.Vector3(0,0,1),
  23438. this.alpha = -1e3,
  23439. this.beta = -1e3,
  23440. this.gamma = -1e3,
  23441. this.orient = M.Math.degToRad(window.orientation || 0),
  23442. window.addEventListener("orientationchange", function() {
  23443. s.orient = M.Math.degToRad(window.orientation || 0)
  23444. }),
  23445. window.addEventListener("deviceorientation", function(e) {
  23446. var t = M.Math.degToRad(e.alpha)
  23447. , i = M.Math.degToRad(e.beta)
  23448. , n = M.Math.degToRad(e.gamma);
  23449. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  23450. -1e3 === s.beta && (s.beta = i),
  23451. -1e3 === s.gamma && (s.gamma = n),
  23452. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  23453. .006 < Math.abs(i - s.beta) && (s.beta = i),
  23454. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  23455. s.beta = i,
  23456. s.gamma = n),
  23457. h.vrDebug) {
  23458. $("#info-device-orientation").css("display", "block");
  23459. var r = "";
  23460. r += "alpha=(" + s.alpha + ")<BR/>",
  23461. r += "beta=(" + s.beta + ")<BR/>",
  23462. r += "gamma=" + s.gamma + "<BR/>",
  23463. document.getElementById("info-device-orientation").innerHTML = r
  23464. }
  23465. }),
  23466. this.setObjectQuaternion = function(e, t, i, n, r) {
  23467. s.euler.set(i, t, -n, "YXZ"),
  23468. e.setFromEuler(s.euler),
  23469. e.multiply(s.q1),
  23470. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  23471. o.updateMatrixWorld()
  23472. }
  23473. ,
  23474. parent !== window && window.addEventListener("message", function(e) {
  23475. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  23476. o && o.alpha && o.beta && o.gamma && (t = a,
  23477. i = M.Math.degToRad(o.alpha),
  23478. n = M.Math.degToRad(o.beta),
  23479. r = M.Math.degToRad(o.gamma),
  23480. t ? (-1e3 === s.alpha && (s.alpha = i),
  23481. -1e3 === s.beta && (s.beta = n),
  23482. -1e3 === s.gamma && (s.gamma = r),
  23483. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  23484. .006 < Math.abs(n - s.beta) && (s.beta = n),
  23485. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  23486. s.beta = n,
  23487. s.gamma = r))
  23488. }),
  23489. this.update = function(e) {
  23490. TWEEN.update(),
  23491. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  23492. this.triggerTargetEvent())
  23493. }
  23494. ,
  23495. this.triggerTargetEvent = function() {
  23496. var e = this.choseObj()
  23497. , t = e ? e.object : void 0;
  23498. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  23499. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  23500. t && t.enabled && this.startAnimate(function() {
  23501. this.clickCallback(t)
  23502. }
  23503. .bind(this))) : this.type,
  23504. this.targetEventObj.lastObj = t)
  23505. }
  23506. ,
  23507. this.choseObj = function() {
  23508. this.raycaster.setFromCamera({
  23509. x: 0,
  23510. y: 0
  23511. }, o);
  23512. var e = (this.raycaster.ray,
  23513. window.vrMarkers)
  23514. , t = this.raycaster.intersectObjects(e);
  23515. if (0 < t.length)
  23516. return t[0]
  23517. }
  23518. ,
  23519. this.clickCallback = function(e) {
  23520. this.runTHREEAction(e, "onclick")
  23521. }
  23522. ,
  23523. this.runTHREEAction = function(e, t) {
  23524. switch (t) {
  23525. case "onclick":
  23526. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  23527. e()
  23528. });
  23529. break;
  23530. case "onhover":
  23531. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  23532. e()
  23533. });
  23534. break;
  23535. case "onout":
  23536. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  23537. e()
  23538. })
  23539. }
  23540. }
  23541. ,
  23542. this.startAnimate = function(e) {
  23543. this.tweenFlag && this.initAnimation(e)
  23544. }
  23545. ,
  23546. this.initAnimation = function(e) {
  23547. var t = this
  23548. , i = this.cursor.material.map.offset;
  23549. t.tweenFlag = !1,
  23550. this.cursorAnimate = new TWEEN.Tween(i).to({
  23551. x: 1
  23552. }, 1e3).onStart(function() {
  23553. t.tweenFlag = !1
  23554. }).onStop(function() {
  23555. t.tweenFlag = !0,
  23556. this.x = 0,
  23557. i.x = 0
  23558. }).onUpdate(function() {}).onComplete(function() {
  23559. e(),
  23560. i.x = 0,
  23561. setTimeout(function() {
  23562. t.tweenFlag = !0
  23563. }, 1500)
  23564. }),
  23565. this.cursorAnimate.easing(function(e) {
  23566. return Math.floor(17 * e) / 17
  23567. }),
  23568. this.cursorAnimate.start()
  23569. }
  23570. ,
  23571. this.autoCursorPosition = function(e) {
  23572. this.cursor.scale.set(.3, .3, .3)
  23573. }
  23574. }
  23575. ,
  23576. h.prototype.vrRenderer = function(a, i, e) {
  23577. var s = new i.vrCamera(e);
  23578. s.bananaAspect = .8,
  23579. this.width,
  23580. this.height;
  23581. i = this;
  23582. this.setSize = function(e, t) {
  23583. a.setSize.call(this, e, t),
  23584. i.width = e,
  23585. i.height = t
  23586. }
  23587. ,
  23588. this.render = function(e, t, i, n) {
  23589. var r, o;
  23590. if (window.cameraQua = t.quaternion.clone(),
  23591. t.__RESS__SKIP__STEREO__)
  23592. return a.render(e, t, i, n);
  23593. if ("PerspectiveCamera" === t.type)
  23594. r = s.cameraL,
  23595. o = s.cameraR,
  23596. e.updateMatrixWorld(),
  23597. null === t.parent && t.updateMatrixWorld(),
  23598. s.vrCameraUpdate(t);
  23599. else {
  23600. if ("OrthographicCamera" !== t.type)
  23601. return DEBUG && console.error("Unsupported renderer: ", t.type);
  23602. r = o = t
  23603. }
  23604. a.setScissorTest(!0),
  23605. a.setScissor(0, 0, this.width / 2, this.height),
  23606. a.setViewport(0, 0, this.width / 2, this.height),
  23607. a.render.call(this, e, r, i, n),
  23608. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23609. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23610. a.render.call(this, e, o, i, n),
  23611. a.setScissorTest(!1)
  23612. }
  23613. ,
  23614. this.__proto__ = {
  23615. __proto__: a
  23616. }
  23617. }
  23618. ,
  23619. h.prototype.vrCamera = function(e) {
  23620. this.type = "StereoCamera",
  23621. this._aspect = 1,
  23622. this._overlap = .064,
  23623. this.cameraL = new M.PerspectiveCamera,
  23624. this.cameraL.layers.enable(1),
  23625. this.cameraL.matrixAutoUpdate = !1,
  23626. this.cameraR = new M.PerspectiveCamera,
  23627. this.cameraR.layers.enable(2),
  23628. this.cameraR.matrixAutoUpdate = !1,
  23629. this.eyeRight = new M.Matrix4,
  23630. this.eyeLeft = new M.Matrix4,
  23631. this.vrCameraNeedsUpdate = !0,
  23632. window.vrCameraL = this.cameraL,
  23633. Object.defineProperty(this, "bananaAspect", {
  23634. get: function() {
  23635. return this._aspect
  23636. },
  23637. set: function(e) {
  23638. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  23639. this._aspect = e
  23640. }
  23641. }),
  23642. Object.defineProperty(this, "overlap", {
  23643. get: function() {
  23644. return this._overlap
  23645. },
  23646. set: function(e) {
  23647. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  23648. this._overlap = e
  23649. }
  23650. }),
  23651. this.vrCameraUpdate = function(e) {
  23652. if (this.vrCameraNeedsUpdate = !0,
  23653. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  23654. this.vrCameraNeedsUpdate) {
  23655. this.vrCameraNeedsUpdate = !1,
  23656. console.debug("vrCameraUpdate"),
  23657. this.bananaFocus = e.focus,
  23658. this.bananaFov = e.fov,
  23659. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  23660. this.bananaNear = e.near,
  23661. this.bananaFar = e.far,
  23662. console.debug(e.aspect),
  23663. this.bananaFocus = 10;
  23664. var t, i, n = e.projectionMatrix.clone(), r = this.overlap / 2, o = r * this.bananaNear / this.bananaFocus, a = this.bananaNear * Math.tan(Math.PI / 180 * this.bananaFov * .5);
  23665. this.eyeLeft.elements[12] = -r,
  23666. this.eyeRight.elements[12] = r,
  23667. t = -a * this.bananaReal_aspect + o,
  23668. i = a * this.bananaReal_aspect + o,
  23669. n.elements[0] = 2 * this.bananaNear / (i - t),
  23670. n.elements[8] = (i + t) / (i - t),
  23671. this.cameraL.projectionMatrix.copy(n),
  23672. t = -a * this.bananaReal_aspect - o,
  23673. i = a * this.bananaReal_aspect - o,
  23674. n.elements[0] = 2 * this.bananaNear / (i - t),
  23675. n.elements[8] = (i + t) / (i - t),
  23676. this.cameraR.projectionMatrix.copy(n)
  23677. }
  23678. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  23679. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23680. }
  23681. }
  23682. ,
  23683. h.prototype.boluoGetTexture = function(e) {
  23684. var t = new M.TextureLoader;
  23685. return t.crossOrigin = "anonymous",
  23686. t.load(e)
  23687. }
  23688. ,
  23689. h.prototype.updateScreenSize = function(e) {
  23690. var t, i, n, r = !1;
  23691. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  23692. n = e.height,
  23693. r = !0,
  23694. t = 1) : (i = $("#player").width(),
  23695. n = $("#player").height(),
  23696. e && e.resize && (o = this.renderWidth,
  23697. a = this.renderHeight),
  23698. i === o && n === a && !this.forceUpdateSize || (o = i,
  23699. a = n,
  23700. r = !0,
  23701. t = window.devicePixelRatio)),
  23702. r && (this.setSize(i, n, t),
  23703. this.forceUpdateSize = !1)
  23704. }
  23705. ,
  23706. h.prototype.updateComponents = function() {
  23707. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23708. this.updateListeners[t].update(e)
  23709. }
  23710. ,
  23711. h.prototype.suspend = function() {
  23712. this.started = !1,
  23713. this.suspendedObjects = this.scene.children.map(function(e) {
  23714. return this.scene.remove(e),
  23715. e
  23716. }
  23717. .bind(this)),
  23718. this.render()
  23719. }
  23720. ,
  23721. h.prototype.resume = function() {
  23722. this.suspendedObjects.forEach(function(e) {
  23723. this.scene.add(e)
  23724. }
  23725. .bind(this)),
  23726. this.suspendedObjects = [],
  23727. this.started = !0,
  23728. b()
  23729. }
  23730. ;
  23731. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  23732. this.started && (window.requestAnimationFrame(b),
  23733. this.updateScreenSize(),
  23734. this.updateComponents(),
  23735. this.updateTextureMemory(),
  23736. this.render(),
  23737. this.emit(r.AfterRender))
  23738. };
  23739. h.prototype.getImageData = (E = document.createElement("canvas"),
  23740. _ = E.getContext("2d"),
  23741. function(e, t, i) {
  23742. return E.width === t && E.height === i || (E.width = t,
  23743. E.height = i),
  23744. _.drawImage(e, 0, 0, t, i),
  23745. _.getImageData(0, 0, t, i)
  23746. }
  23747. ),
  23748. h.prototype.initSizedTexture2D = function(e, t, i) {
  23749. var n = this.renderer
  23750. , r = n.context
  23751. , o = n.state
  23752. , a = new M.Texture(null);
  23753. !(a.flipY = !1) !== i && (i = !1),
  23754. a.generateMipmaps = i;
  23755. var s = n.paramThreeToGL(a.format)
  23756. , l = n.paramThreeToGL(a.type)
  23757. , c = n.properties.get(a)
  23758. , h = r.createTexture();
  23759. o.bindTexture(r.TEXTURE_2D, h),
  23760. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23761. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23762. a.wrapS = t,
  23763. a.wrapT = t;
  23764. var u = n.paramThreeToGL(t);
  23765. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23766. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23767. i ? (a.magFilter = M.LinearFilter,
  23768. a.minFilter = M.LinearMipMapLinearFilter,
  23769. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23770. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23771. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23772. a.minFilter = M.LinearFilter,
  23773. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23774. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23775. o.bindTexture(r.TEXTURE_2D, null),
  23776. c.__webglTexture = h,
  23777. a
  23778. }
  23779. ,
  23780. h.prototype.initSizedCubeMap = function(e, t) {
  23781. var i = this.renderer
  23782. , n = i.context
  23783. , r = i.state
  23784. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23785. o.flipY = !1,
  23786. o.generateMipmaps = t;
  23787. var a = i.paramThreeToGL(o.format)
  23788. , s = i.paramThreeToGL(o.type)
  23789. , l = i.properties.get(o)
  23790. , c = n.createTexture();
  23791. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23792. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23793. for (var h = 0; h < 6; h++)
  23794. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23795. return t ? (o.magFilter = M.LinearFilter,
  23796. o.minFilter = M.LinearMipMapLinearFilter,
  23797. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23798. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23799. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23800. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23801. o.minFilter = M.LinearFilter,
  23802. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23803. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23804. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23805. l.__image__webglTextureCube = c,
  23806. o
  23807. }
  23808. ,
  23809. h.prototype.deallocateCubeTexture = function(e) {
  23810. var t = this.renderer
  23811. , i = t.context
  23812. , n = t.properties.get(e);
  23813. i.deleteTexture(n.__image__webglTextureCube)
  23814. }
  23815. ,
  23816. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23817. var a = this.renderer
  23818. , s = a.context
  23819. , l = a.state
  23820. , c = a.properties.get(t);
  23821. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23822. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23823. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23824. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23825. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23826. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23827. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23828. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23829. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23830. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23831. l.bindTexture(s.TEXTURE_2D, null)
  23832. }
  23833. ,
  23834. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23835. var s = this.renderer
  23836. , l = s.context
  23837. , c = s.state
  23838. , h = s.properties.get(t);
  23839. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23840. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23841. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23842. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23843. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23844. }
  23845. ,
  23846. h.prototype.rebuildMipMaps2D = function(e) {
  23847. var t = this.renderer
  23848. , i = t.context
  23849. , n = t.state;
  23850. t.properties.get(e),
  23851. i.generateMipmap(i.TEXTURE_2D),
  23852. n.bindTexture(i.TEXTURE_2D, null)
  23853. }
  23854. ,
  23855. h.prototype.rebuildMipMaps3D = function(e) {
  23856. var t = this.renderer
  23857. , i = t.context
  23858. , n = t.state
  23859. , r = t.properties.get(e);
  23860. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23861. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23862. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23863. }
  23864. ,
  23865. h.prototype.renderToCubeMap = (P = !1,
  23866. F = N = D = L = O = null,
  23867. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23868. this.renderer.context,
  23869. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23870. (O = new M.Scene).add(L),
  23871. D = new M.ShaderMaterial({
  23872. uniforms: {
  23873. tDiffuse: {
  23874. type: "t",
  23875. value: null
  23876. },
  23877. alpha: {
  23878. type: "f",
  23879. value: 1
  23880. }
  23881. },
  23882. vertexShader: R.basicTextured.vertexShader,
  23883. fragmentShader: R.basicTextured.fragmentShader,
  23884. depthWrite: !1,
  23885. depthTest: !1,
  23886. side: M.DoubleSide
  23887. }),
  23888. N = new M.PlaneBufferGeometry(1,1),
  23889. (F = new M.Mesh(N,D)).position.z = 0,
  23890. O.add(F),
  23891. P = !0);
  23892. var m = N.getAttribute("uv");
  23893. m.setDynamic(!0),
  23894. m.needsUpdate = !0;
  23895. var v = m.array
  23896. , y = r / i
  23897. , A = o / n
  23898. , C = a / i
  23899. , I = s / n;
  23900. v[0] = y,
  23901. v[1] = A + I,
  23902. v[2] = y + C,
  23903. v[3] = A + I,
  23904. v[4] = y,
  23905. v[5] = A,
  23906. v[6] = y + C,
  23907. v[7] = A;
  23908. var E = N.getAttribute("position");
  23909. E.setDynamic(!0),
  23910. E.needsUpdate = !0;
  23911. var _ = E.array
  23912. , b = l / t.width - .5
  23913. , w = c / t.height - .5
  23914. , T = h / t.width
  23915. , x = u / t.height;
  23916. _[0] = b,
  23917. _[1] = w + x,
  23918. _[3] = b + T,
  23919. _[4] = w + x,
  23920. _[6] = b,
  23921. _[7] = w,
  23922. _[9] = b + T,
  23923. _[10] = w,
  23924. this.renderer.properties.get(e),
  23925. D.uniforms.tDiffuse.value = e,
  23926. D.blending = p || M.NoBlending,
  23927. D.transparent = !!f,
  23928. null != g || (g = 1),
  23929. D.uniforms.alpha.value = g,
  23930. D.needUpdate = !0,
  23931. t.activeCubeFace = d,
  23932. t.viewport.set(0, 0, t.width, t.height);
  23933. var S = this.renderer.autoClear;
  23934. this.renderer.autoClear = !1,
  23935. this.renderer.render(O, L, t, !1),
  23936. this.renderer.autoClear = S
  23937. }
  23938. ),
  23939. h.prototype.copyCubeMap = (g = !1,
  23940. C = A = y = v = m = null,
  23941. I = new M.Euler,
  23942. new M.Vector3,
  23943. function(e, t, i, n, r, o, a, s, l) {
  23944. this.renderer,
  23945. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23946. (m = new M.Scene).add(v),
  23947. y = new M.ShaderMaterial({
  23948. uniforms: {
  23949. tDiffuse: {
  23950. type: "t",
  23951. value: null
  23952. },
  23953. alpha: {
  23954. type: "f",
  23955. value: 1
  23956. }
  23957. },
  23958. vertexShader: R.copyCubeMap.vertexShader,
  23959. fragmentShader: R.copyCubeMap.fragmentShader,
  23960. depthWrite: !1,
  23961. depthTest: !1,
  23962. side: M.DoubleSide
  23963. }),
  23964. A = new M.BoxGeometry(2,2,2),
  23965. C = new M.Mesh(A,y),
  23966. m.add(C),
  23967. g = !0);
  23968. for (var c = 0; c < 6; c++)
  23969. h.getCubeOrientationForCubeFace(c, I),
  23970. C.rotation.copy(I),
  23971. C.matrixWorldNeedsUpdate = !0,
  23972. C.updateMatrixWorld(),
  23973. y.uniforms.tDiffuse.value = e,
  23974. y.blending = a || M.NoBlending,
  23975. y.transparent = !!s,
  23976. null != l || (l = 1),
  23977. y.uniforms.alpha.value = l,
  23978. y.needUpdate = !0,
  23979. t.activeCubeFace = c,
  23980. t.viewport.set(0, 0, r, o),
  23981. this.renderer.render(m, v, t, !1)
  23982. }
  23983. ),
  23984. h.getLookAtForCubeFace = function(e, t) {
  23985. switch (e) {
  23986. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23987. t.set(1, 0, 0);
  23988. break;
  23989. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23990. t.set(-1, 0, 0);
  23991. break;
  23992. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23993. t.set(0, 1, 0);
  23994. break;
  23995. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23996. t.set(0, -1, 0);
  23997. break;
  23998. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23999. t.set(0, 0, 1);
  24000. break;
  24001. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24002. t.set(0, 0, -1)
  24003. }
  24004. }
  24005. ,
  24006. h.getCubeOrientationForCubeFace = function(e, t) {
  24007. switch (e) {
  24008. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  24009. t.set(0, -Math.PI / 2, 0);
  24010. break;
  24011. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  24012. t.set(0, Math.PI / 2, 0);
  24013. break;
  24014. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  24015. t.set(Math.PI / 2, Math.PI, 0);
  24016. break;
  24017. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24018. t.set(-Math.PI / 2, Math.PI, 0);
  24019. break;
  24020. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  24021. t.set(0, -Math.PI, 0);
  24022. break;
  24023. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24024. t.set(0, 0, 0)
  24025. }
  24026. }
  24027. ,
  24028. t.exports = h
  24029. }
  24030. , {
  24031. "../enum/GLCubeFaces": 25,
  24032. "../enum/GLTextureType": 26,
  24033. "../enum/SceneRendererEvents": 43,
  24034. "../exception/BasicException": 55,
  24035. "../exception/RendererCreationException": 57,
  24036. "../settings": 166,
  24037. "../shaders": 167,
  24038. "../util/browser": 182,
  24039. events: 202,
  24040. three: 217
  24041. }],
  24042. 159: [function(e, t, i) {
  24043. "use strict";
  24044. function n(e) {
  24045. this.messenger = new a(e),
  24046. this.clientKey = null
  24047. }
  24048. var o = e("../util/ajax")
  24049. , r = e("./PostMessageType")
  24050. , a = e("./postmessage")
  24051. , s = e("./VersionInfo")
  24052. , l = e("events").EventEmitter
  24053. , c = window.location.origin + "/api/v1/user/";
  24054. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  24055. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  24056. }
  24057. ,
  24058. n.prototype.waitForConnection = function() {
  24059. return new Promise(function(t, i) {
  24060. this.messenger.on(r.CONNECT, function(e) {
  24061. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  24062. }
  24063. .bind(this))
  24064. }
  24065. .bind(this))
  24066. }
  24067. ,
  24068. n.prototype.onConnectionReceived = function(i) {
  24069. return this.messenger.setTarget(i.source, i.origin),
  24070. this.verifyConnection(i).then(function(e, t) {
  24071. this.messenger.send({
  24072. type: r.ACCEPT,
  24073. toId: i.fromId,
  24074. warning: t
  24075. }),
  24076. this.clientKey = e,
  24077. this.messenger.removeAllListeners(r.CONNECT),
  24078. this.bindEvents()
  24079. }
  24080. .bind(this), function(e) {
  24081. this.messenger.send({
  24082. type: r.REJECT,
  24083. toId: i.fromId,
  24084. reason: e
  24085. }),
  24086. this.messenger.setTarget()
  24087. }
  24088. .bind(this))
  24089. }
  24090. ,
  24091. n.prototype.verifyConnection = function(r) {
  24092. return new Promise(function(e, t) {
  24093. var i;
  24094. if (s.isDeprecated(r.sdkVersion))
  24095. i = "这个版本正在被弃用";
  24096. else if (!s.isSupported(r.sdkVersion))
  24097. return t("不支持此版本的SDK");
  24098. var n = {
  24099. cache: !1,
  24100. headers: {
  24101. "X-port-Application-Key": r.applicationKey,
  24102. "X-port-Referrer": r.origin
  24103. }
  24104. };
  24105. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  24106. }
  24107. )
  24108. }
  24109. ,
  24110. n.prototype.onMessageReceived = function(t) {
  24111. if (this.validateClientApplicationKey(t.applicationKey)) {
  24112. var i = this;
  24113. t.onDone = function(e) {
  24114. e.toId = t.fromId,
  24115. e.uid = t.uid,
  24116. e.type = r.RESPONSE,
  24117. i.messenger.send(e)
  24118. }
  24119. ,
  24120. this.emit(r.ACTION, t)
  24121. }
  24122. }
  24123. ,
  24124. n.prototype.validateClientApplicationKey = function(e) {
  24125. return this.clientKey === e
  24126. }
  24127. ,
  24128. n.prototype.sendEvent = function(e, t) {
  24129. this.messenger.send({
  24130. type: r.EVENT,
  24131. eventType: e,
  24132. eventData: t
  24133. })
  24134. }
  24135. ,
  24136. t.exports = n
  24137. }
  24138. , {
  24139. "../util/ajax": 181,
  24140. "./PostMessageType": 160,
  24141. "./VersionInfo": 163,
  24142. "./postmessage": 165,
  24143. events: 202
  24144. }],
  24145. 160: [function(e, t, i) {
  24146. "use strict";
  24147. t.exports = Object.freeze({
  24148. CONNECT: "postmessage.connect",
  24149. ACCEPT: "postmessage.accept",
  24150. REJECT: "postmessage.reject",
  24151. ACTION: "postmessage.action",
  24152. RESPONSE: "postmessage.response",
  24153. EVENT: "postmessage.event"
  24154. })
  24155. }
  24156. , {}],
  24157. 161: [function(e, t, i) {
  24158. "use strict";
  24159. t.exports = Object.freeze({
  24160. MOVE: "sdk.move",
  24161. ENTER_PANO: "sdk.enterpano",
  24162. MODEL_LOADED: "sdk.modelloaded"
  24163. })
  24164. }
  24165. , {}],
  24166. 162: [function(e, t, i) {
  24167. "use strict";
  24168. t.exports = Object.freeze({
  24169. FLY: "transition.fly",
  24170. FADEOUT: "transition.fade",
  24171. INSTANT: "transition.instant"
  24172. })
  24173. }
  24174. , {}],
  24175. 163: [function(e, t, i) {
  24176. "use strict";
  24177. t.exports = {
  24178. current: "1.0",
  24179. supported: ["1.0"],
  24180. deprecated: [],
  24181. isSupported: function(e) {
  24182. return -1 !== this.supported.indexOf(e)
  24183. },
  24184. isDeprecated: function(e) {
  24185. return -1 !== this.deprecated.indexOf(e)
  24186. },
  24187. isValid: function(e) {
  24188. return this.isSupported(e) || this.isDeprecated(e)
  24189. }
  24190. }
  24191. }
  24192. , {}],
  24193. 164: [function(q, X, e) {
  24194. (function(e) {
  24195. "use strict";
  24196. function r(e, t, i) {
  24197. e = e && e.toLowerCase().trim();
  24198. var n = new C.UP.clone
  24199. , r = Math.PI / 3
  24200. , o = Math.PI / 2;
  24201. switch (e) {
  24202. case "left":
  24203. i.copy(t),
  24204. i.applyAxisAngle(n, o);
  24205. break;
  24206. case "right":
  24207. i.copy(t),
  24208. i.applyAxisAngle(n, -o);
  24209. break;
  24210. case "forwardleft":
  24211. i.copy(t),
  24212. i.applyAxisAngle(n, r);
  24213. break;
  24214. case "forwardright":
  24215. i.copy(t),
  24216. i.applyAxisAngle(n, -r);
  24217. break;
  24218. case "forward":
  24219. default:
  24220. i.copy(t)
  24221. }
  24222. return i
  24223. }
  24224. function o(e, t) {
  24225. if (e) {
  24226. var i = {
  24227. pano: e,
  24228. lookAtPoint: null,
  24229. duration: null,
  24230. maxDistanceOverride: null,
  24231. skipWarpingCheck: !1
  24232. };
  24233. this.player.flyToPano(i, function() {
  24234. t && t({
  24235. success: !0,
  24236. message: "Transition complete."
  24237. })
  24238. })
  24239. } else
  24240. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  24241. t && t({
  24242. success: !1,
  24243. error: "Unable to find pano."
  24244. })
  24245. }
  24246. function a(e, t) {
  24247. t.copy(C.FORWARD),
  24248. e.getDirection(t)
  24249. }
  24250. function c(i) {
  24251. return {
  24252. panos: i.panos.list.map(function(e) {
  24253. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  24254. return {
  24255. uuid: e.id,
  24256. aligned: e.alignmentType === g.ALIGNED,
  24257. neighbourUUIDs: e.neighbourUUIDs.slice(),
  24258. position: function(e) {
  24259. return e.alignmentType !== g.ALIGNED ? null : {
  24260. x: e.position.x,
  24261. y: e.position.y,
  24262. z: e.position.z
  24263. }
  24264. }(e),
  24265. rotation: function(e) {
  24266. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  24267. return {
  24268. x: h.Math.radToDeg(t._x),
  24269. y: h.Math.radToDeg(t._y),
  24270. z: h.Math.radToDeg(t._z)
  24271. }
  24272. }(e),
  24273. thumbnail: t
  24274. }
  24275. })
  24276. }
  24277. }
  24278. var t, l, i, h = q("three"), u = q("./ApiHost"), n = q("../util/logger"), d = q("../util/common"), s = q("../util/math"), p = q("../enum/ModelManagerEvents"), f = q("./PostMessageType"), g = q("../enum/AlignmentType"), m = q("../enum/Direction"), v = q("./TransitionStyles"), y = q("../util/panorama"), A = q("../enum/GLCubeFaces"), C = q("../enum/Vectors"), I = q("../enum/Viewmode"), E = q("../enum/WarpStyle"), _ = (q("../enum/Keys"),
  24279. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  24280. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  24281. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  24282. N.angle = 0,
  24283. N.angleTravelled = 0,
  24284. N.playerDirection = new h.Vector3,
  24285. N.lastFacingDirection = new h.Vector3,
  24286. N.onDone = null,
  24287. N.player = null,
  24288. N.start = function(e, t, i, n) {
  24289. N.active = !0,
  24290. e && t && (t = 0),
  24291. N.angle = e || t,
  24292. N.xAngle = e,
  24293. N.yAngle = t,
  24294. N.angleTravelled = 0,
  24295. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24296. i.getDirection(N.playerDirection),
  24297. N.lastFacingDirection.copy(N.playerDirection),
  24298. N.projectVectors(),
  24299. N.onDone = n,
  24300. N.player = i,
  24301. N()
  24302. }
  24303. ,
  24304. N.projectVectors = function() {
  24305. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  24306. N.lastFacingDirection.projectOnPlane(C.UP))
  24307. }
  24308. ,
  24309. N), P = (i = new h.Vector3,
  24310. function(e) {
  24311. e ? (i.copy(e.position),
  24312. i.add(e.discPosition),
  24313. s.projectPositionToCanvas(i, this.player.camera, i),
  24314. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  24315. }
  24316. ), O = (l = new h.Vector3,
  24317. function(e) {
  24318. var t = this.player.getDirection();
  24319. l.copy(t);
  24320. var i = l.y;
  24321. l.y = 0,
  24322. l.normalize();
  24323. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  24324. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  24325. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  24326. 0;
  24327. this.player.mode === I.DOLLHOUSE && (n = -n);
  24328. var r = function() {
  24329. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  24330. }
  24331. .call(this) - .1
  24332. , o = function() {
  24333. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  24334. }
  24335. .call(this) + .1
  24336. , a = n + e;
  24337. r < a ? a = r : a < o && (a = o);
  24338. var s = a - n;
  24339. return 0 < e && s < .01 && (s = 0),
  24340. e < 0 && -.01 < s && (s = 0),
  24341. s
  24342. }
  24343. ), L = (t = new h.Euler,
  24344. function(e) {
  24345. return t.setFromQuaternion(e.quaternion, "YXZ"),
  24346. {
  24347. position: {
  24348. x: e.position.x,
  24349. y: e.position.y,
  24350. z: e.position.z
  24351. },
  24352. rotation: {
  24353. x: h.Math.radToDeg(t.x),
  24354. y: h.Math.radToDeg(t.y),
  24355. z: 0
  24356. },
  24357. pano: e.currentPano ? e.currentPano.id : null,
  24358. mode: e.mode
  24359. }
  24360. }
  24361. ), D = null;
  24362. function N() {
  24363. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24364. N.player.getDirection(N.playerDirection),
  24365. N.projectVectors();
  24366. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  24367. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  24368. N.onDone && (0,
  24369. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  24370. window.setTimeout(N, 4))
  24371. }
  24372. X.exports = {
  24373. init: function(e, t, i, n, r) {
  24374. Y.init(e, t, i, r),
  24375. D = new Promise(function(e, t) {
  24376. i.on(_.Ready, function() {
  24377. e()
  24378. })
  24379. }
  24380. .bind(this));
  24381. var o = new u(window)
  24382. , a = o.waitForConnection();
  24383. a.then(function(e) {
  24384. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  24385. });
  24386. var s, l = (s = Date.now(),
  24387. function() {
  24388. if (!(Date.now() - s < 100)) {
  24389. var e = L(i);
  24390. o.sendEvent(b.MOVE, {
  24391. state: e
  24392. }),
  24393. s = Date.now()
  24394. }
  24395. }
  24396. );
  24397. i.on(_.Move, l),
  24398. i.on(_.ViewChanged, l),
  24399. n.on(p.ActiveModelChanged, function(e) {
  24400. function t(e) {
  24401. var t, i = e.newPano.id;
  24402. e.oldPano && (t = e.oldPano.id),
  24403. i !== t && o.sendEvent(b.ENTER_PANO, {
  24404. oldPano: t,
  24405. newPano: i
  24406. })
  24407. }
  24408. var i = e.model
  24409. , n = e.oldModel;
  24410. Y.model = i,
  24411. a.then(function() {
  24412. o.sendEvent(b.MODEL_LOADED, {
  24413. metadata: c(i)
  24414. })
  24415. }),
  24416. n && n.panos.forEach(function(e) {
  24417. e.removeEventListener("enter", t)
  24418. }),
  24419. i.panos.forEach(function(e) {
  24420. e.on("enter", t)
  24421. })
  24422. })
  24423. }
  24424. };
  24425. var F, B, V, k, U, H, z, G, W, j, Y = {
  24426. director: null,
  24427. player: null,
  24428. controls: null,
  24429. sceneRenderer: null,
  24430. model: null,
  24431. init: function(e, t, i, n) {
  24432. this.director = e,
  24433. this.player = i,
  24434. this.controls = t,
  24435. this.sceneRenderer = n
  24436. },
  24437. handleToObject: {},
  24438. objectToHandle: {},
  24439. handleCount: 0,
  24440. onMessageReceive: function(e) {
  24441. if (e) {
  24442. var t = e.targetFunction
  24443. , i = e.params
  24444. , n = e.onDone;
  24445. t && this[t] && this[t](i, n)
  24446. }
  24447. },
  24448. waitForInit: function(e, t) {
  24449. D.then(t.bind({
  24450. success: !0,
  24451. message: "Init complete."
  24452. }))
  24453. },
  24454. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  24455. j = new h.Quaternion,
  24456. function(e, t) {
  24457. var i = e.pano
  24458. , n = e.rotation
  24459. , r = e.transition;
  24460. if (!this.model)
  24461. return t({
  24462. success: !1,
  24463. error: "The model has not been loaded yet"
  24464. });
  24465. var o = this.model.panos.get(i);
  24466. if (!o)
  24467. return t({
  24468. success: !1,
  24469. error: i + " does not exist in this model"
  24470. });
  24471. if (!n)
  24472. return t({
  24473. sucess: !1,
  24474. erorr: n + " is not a valid rotation"
  24475. });
  24476. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  24477. console.log(n.z);
  24478. var a = {
  24479. success: !0,
  24480. message: i
  24481. };
  24482. if (r === v.FADEOUT)
  24483. j.setFromEuler(W),
  24484. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  24485. else {
  24486. var s, l;
  24487. r === v.INSTANT && (l = s = 0);
  24488. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  24489. this.player.flyToPano({
  24490. pano: o,
  24491. lookAtPoint: c,
  24492. duration: s,
  24493. aimDuration: l
  24494. }, t.bind(this, a))
  24495. }
  24496. }
  24497. ),
  24498. moveInDirection: function(e, t) {
  24499. var i = e.direction;
  24500. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  24501. void (t && t({
  24502. success: !1,
  24503. error: "Invalid direction."
  24504. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  24505. t(e ? {
  24506. success: !0,
  24507. message: "moved " + i
  24508. } : {
  24509. success: !1,
  24510. error: "Cannot move in direction: " + i
  24511. })
  24512. })
  24513. },
  24514. getPose: function(e, t) {
  24515. return this.player.camera.position,
  24516. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  24517. t({
  24518. success: !0,
  24519. message: L(this.player)
  24520. })
  24521. },
  24522. takeScreenShot: (z = new h.PerspectiveCamera,
  24523. G = new h.WebGLRenderTarget,
  24524. function(e, t) {
  24525. if (!e.resolution)
  24526. return t({
  24527. success: !1,
  24528. error: "An invalid resolution was specified"
  24529. });
  24530. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  24531. var i = this.sceneRenderer.renderer.getSize();
  24532. e.resolution.width = i.width,
  24533. e.resolution.height = i.height
  24534. }
  24535. z.layers.set(T.DEFAULT),
  24536. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  24537. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  24538. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  24539. var n = e.resolution.width
  24540. , r = e.resolution.height
  24541. , o = n / r;
  24542. z.position.copy(this.sceneRenderer.camera.position),
  24543. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24544. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24545. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  24546. G.setSize(n, r),
  24547. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  24548. var a = new Uint8Array(n * r * 4);
  24549. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  24550. var s = S.encode({
  24551. data: a,
  24552. width: n,
  24553. height: r,
  24554. heading: 180,
  24555. pitch: 0
  24556. }, {
  24557. quality: 75,
  24558. flipY: !0
  24559. });
  24560. t({
  24561. success: !0,
  24562. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  24563. })
  24564. }
  24565. ),
  24566. findRankedPano: (U = new h.Vector3,
  24567. H = new h.Vector3,
  24568. function(e, t) {
  24569. a(this.player, H),
  24570. r(t, H, U);
  24571. var i = this.player.rankedPanoInDirection(e, U);
  24572. if (i) {
  24573. var n = this.objectToHandle[i.id];
  24574. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  24575. this.handleToObject[n] = i),
  24576. n
  24577. }
  24578. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  24579. -1
  24580. }
  24581. ),
  24582. findRankedtag: (V = new h.Vector3,
  24583. k = new h.Vector3,
  24584. function(e, t) {
  24585. a(this.player, k),
  24586. r(t, k, V);
  24587. var i = this.player.rankedtagInDirection(e, V);
  24588. if (i) {
  24589. var n = this.objectToHandle[i.sid];
  24590. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  24591. this.handleToObject[n] = i),
  24592. n
  24593. }
  24594. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  24595. -1
  24596. }
  24597. ),
  24598. clickNearesttag: function(e) {
  24599. this.clickRankedtag(0, e)
  24600. },
  24601. clickRankedtag: function(e, t) {
  24602. var i = function(e, t) {
  24603. var i = this.findRankedtag(e, t);
  24604. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24605. null)
  24606. }
  24607. .call(this, e, t);
  24608. i && P.call(this, i)
  24609. },
  24610. clickNearestPano: function(e, t) {
  24611. this.clickRankedPano(0, e, t)
  24612. },
  24613. clickRankedPano: function(e, t, i) {
  24614. var n = function(e, t) {
  24615. var i = this.findRankedPano(e, t);
  24616. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24617. null)
  24618. }
  24619. .call(this, e, t);
  24620. n ? o.call(this, n, i) : i(null)
  24621. },
  24622. clickPano: function(e, t) {
  24623. var i = this.handleTable[e];
  24624. i ? o.call(this, i, t) : t(null)
  24625. },
  24626. rotateDirection: function(e, t) {
  24627. var i = e.direction
  24628. , n = e.angle;
  24629. if (!R.active) {
  24630. var r = 0
  24631. , o = 0
  24632. , a = 0
  24633. , s = 0;
  24634. if (!n || isNaN(n))
  24635. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24636. void (t && t({
  24637. success: !1,
  24638. error: "Invalid rotation angle."
  24639. }));
  24640. if (this.player.mode === I.TRANSITIONING)
  24641. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24642. void (t && t({
  24643. success: !1,
  24644. error: "Cannot rotate while transitioning"
  24645. }));
  24646. if (i === m.RIGHT || i === m.LEFT)
  24647. i === m.RIGHT && (n = -n),
  24648. r = 0 < n ? -1 : 1,
  24649. a = n;
  24650. else {
  24651. if (i !== m.UP && i !== m.DOWN)
  24652. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24653. void (t && t({
  24654. success: !1,
  24655. error: "Invalid direction for rotation."
  24656. }));
  24657. if (this.player.mode === I.FLOORPLAN)
  24658. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24659. void (t && t({
  24660. success: !1,
  24661. error: "Cannot rotate " + i + " in floorplan mode"
  24662. }));
  24663. if (i === m.DOWN && (n = -n),
  24664. 0 === (n = O.call(this, n)))
  24665. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24666. void (t && t({
  24667. success: !1,
  24668. error: "Already at maximum rotation in direction: " + i
  24669. }));
  24670. o = 0 < n ? 1 : -1,
  24671. s = n
  24672. }
  24673. var l = n;
  24674. n = h.Math.degToRad(n),
  24675. a = h.Math.degToRad(a),
  24676. s = h.Math.degToRad(s);
  24677. var c = this.controls.activeControl;
  24678. c.startRotating(r, o),
  24679. R.start(a, s, this.player, function() {
  24680. c.stopRotating(!0),
  24681. t && t({
  24682. success: !0,
  24683. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24684. })
  24685. })
  24686. }
  24687. },
  24688. rotate: (F = new h.Vector3,
  24689. B = new h.Vector3,
  24690. function(e, t) {
  24691. var i = e.xAngle
  24692. , n = e.yAngle;
  24693. if (!R.active) {
  24694. if (i = i || 0,
  24695. n = n || 0,
  24696. isNaN(i) || isNaN(n))
  24697. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  24698. void (t && t({
  24699. success: !1,
  24700. error: "Invalid rotation angle."
  24701. }));
  24702. if (this.player.mode === I.TRANSITIONING)
  24703. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24704. void (t && t({
  24705. success: !1,
  24706. error: "Cannot rotate while transitioning"
  24707. }));
  24708. Math.abs(i) < .01 && (i = 0),
  24709. Math.abs(n) < .01 && (n = 0);
  24710. var r = n;
  24711. n = O.call(this, n);
  24712. var o = 0 < r ? "UP" : "DOWN";
  24713. if (!(i = -i) && r && !n)
  24714. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  24715. void (t && t({
  24716. success: !1,
  24717. error: "Already at maximum rotation in direction: " + o
  24718. }));
  24719. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  24720. var a = n;
  24721. n = h.Math.degToRad(n),
  24722. i = h.Math.degToRad(i),
  24723. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24724. this.player.getDirection(F),
  24725. B.copy(F).applyAxisAngle(C.UP, i),
  24726. B.applyAxisAngle(C.RIGHT, n);
  24727. var s = (F.angleTo(B),
  24728. 0 < i ? -1 : i < 0 ? 1 : 0)
  24729. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  24730. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  24731. var c = this.controls.activeControl;
  24732. c.startRotating(s, l),
  24733. R.start(i, n, this.player, function() {
  24734. c.stopRotating(!0),
  24735. t && t({
  24736. success: !0,
  24737. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  24738. })
  24739. })
  24740. }
  24741. }
  24742. ),
  24743. panCamera: function(e, i) {
  24744. function t(e) {
  24745. switch (r.removeAllListeners(w.AutoPanComplete),
  24746. r.removeAllListeners(w.AutoPanInterrupt),
  24747. r.removeAllListeners(w.AutoPanClamped),
  24748. e) {
  24749. case w.AutoPanInterrupt:
  24750. i({
  24751. success: !0,
  24752. message: "Camera panning interrupted."
  24753. });
  24754. break;
  24755. case w.AutoPanClamped:
  24756. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24757. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24758. return void i({
  24759. success: !1,
  24760. error: "Already at edge of current model bounds."
  24761. });
  24762. var t = "The view point is outside the bounds for the current model. ";
  24763. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24764. console.warn(t)
  24765. }
  24766. case w.AutoPanComplete:
  24767. i({
  24768. success: !0,
  24769. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24770. })
  24771. }
  24772. }
  24773. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24774. return i({
  24775. success: !1,
  24776. error: "Camera panning is not available in the current mode: " + this.player.mode
  24777. });
  24778. var n = e.position
  24779. , r = this.player.control;
  24780. r.setAutoPanPosition(n.x, n.z),
  24781. r.autoPan = !0;
  24782. var o = function(e, t) {
  24783. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24784. };
  24785. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24786. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24787. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24788. },
  24789. click: function(e, t) {
  24790. var i = e.x
  24791. , n = e.y;
  24792. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24793. n = n / 100 * $("#player").height()),
  24794. this.player.handleInputStart(i, n),
  24795. this.player.updateIntersect(),
  24796. this.player.handleInputEnd(i, n)
  24797. },
  24798. mouseOver: function(e, t) {
  24799. var i = e.x
  24800. , n = e.y;
  24801. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24802. n = n / 100 * $("#player").height()),
  24803. this.player.handleInputMove(i, n),
  24804. this.player.updateIntersect()
  24805. },
  24806. moveToMode: function(e, t) {
  24807. function i(e) {
  24808. t(e ? {
  24809. success: !1,
  24810. error: "Failed to load new mode: " + e
  24811. } : {
  24812. success: !0,
  24813. message: "Moved to new mode: " + n
  24814. })
  24815. }
  24816. var n = e.mode;
  24817. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24818. i()
  24819. }, function(e) {
  24820. i(e)
  24821. }) : t({
  24822. success: !1,
  24823. error: "Invalid mode selection"
  24824. })
  24825. }
  24826. }
  24827. }
  24828. ).call(this, "/js/sdk/automation.js")
  24829. }
  24830. , {
  24831. "../constants": 8,
  24832. "../enum/AlignmentType": 17,
  24833. "../enum/ControlEvents": 21,
  24834. "../enum/Direction": 22,
  24835. "../enum/GLCubeFaces": 25,
  24836. "../enum/Keys": 30,
  24837. "../enum/ModelManagerEvents": 33,
  24838. "../enum/PlayerEvents": 40,
  24839. "../enum/RenderLayers": 41,
  24840. "../enum/Vectors": 50,
  24841. "../enum/Viewmode": 51,
  24842. "../enum/WarpStyle": 52,
  24843. "../lib/jpeg_encoder": 94,
  24844. "../sdk/SdkEvents": 161,
  24845. "../settings": 166,
  24846. "../util/common": 185,
  24847. "../util/logger": 189,
  24848. "../util/math": 190,
  24849. "../util/panorama": 191,
  24850. "./ApiHost": 159,
  24851. "./PostMessageType": 160,
  24852. "./TransitionStyles": 162,
  24853. three: 217
  24854. }],
  24855. 165: [function(e, t, i) {
  24856. "use strict";
  24857. function n(e) {
  24858. this.sourceWindow = e,
  24859. this.targetWindow = null,
  24860. this.targetOrigin = null,
  24861. this.id = Math.floor(1e5 * Math.random()),
  24862. this.bindEvents()
  24863. }
  24864. var r = e("./PostMessageType")
  24865. , o = e("events").EventEmitter;
  24866. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24867. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24868. }
  24869. ,
  24870. n.prototype.setTarget = function(e, t) {
  24871. this.targetWindow = e,
  24872. this.targetOrigin = t
  24873. }
  24874. ,
  24875. n.prototype.onPostmessageReceived = function(e) {
  24876. var t = e.origin || e.originalEvent.origin
  24877. , i = e.source;
  24878. switch (e.data.type) {
  24879. case r.CONNECT:
  24880. break;
  24881. case r.RESPONSE:
  24882. if (this.id !== e.data.toId)
  24883. return;
  24884. default:
  24885. if (!this.validateMessageOrigin(t))
  24886. return
  24887. }
  24888. var n = e.data;
  24889. n.source = i,
  24890. n.origin = t,
  24891. n.timestamp = Date.now(),
  24892. this.emit(e.data.type, n)
  24893. }
  24894. ,
  24895. n.prototype.validateMessageOrigin = function(e) {
  24896. return "*" === this.targetOrigin || e === this.targetOrigin
  24897. }
  24898. ,
  24899. n.prototype.send = function(e) {
  24900. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24901. this.targetWindow.postMessage(e, this.targetOrigin))
  24902. }
  24903. ,
  24904. t.exports = n
  24905. }
  24906. , {
  24907. "./PostMessageType": 160,
  24908. events: 202
  24909. }],
  24910. 166: [function(e, t, i) {
  24911. "use strict";
  24912. var n = e("three")
  24913. , r = e("./util/browser")
  24914. , o = e("./enum/Viewmode")
  24915. , a = e("./enum/VROption")
  24916. , s = e("./enum/Colors")
  24917. , l = e("./enum/WarpStyle")
  24918. , c = e("./util/easing")
  24919. , h = e("./util/common")
  24920. , u = e("./util/showcase")
  24921. , d = e("./constants")
  24922. , p = {
  24923. debug: !1,
  24924. version: "2.25.6-0-gd87e5b1",
  24925. languageTag: r.valueFromHash("lang", null),
  24926. pageTitle: "四维虚拟漫游",
  24927. authorizationHeader: u.getAuthorizationHeader(),
  24928. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24929. logLevel: r.valueFromHash("log", 2),
  24930. skyboxRadius: 2500,
  24931. modelBoundsPadding: 5,
  24932. showNeighbors: !1,
  24933. brand: r.valueFromHash("brand", !0),
  24934. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24935. startHighlights: r.valueFromHash("hl", -1),
  24936. specialEdition: r.valueFromHash("bn", 0),
  24937. useWheel: r.valueFromHash("wh", !0),
  24938. crossOrigin: "anonymous",
  24939. fancierTransition: !1,
  24940. wireframe: !1,
  24941. skyboxWireframe: !1,
  24942. modelAlpha: 1,
  24943. highlightPanoSelection: !1,
  24944. showSweeps: !0,
  24945. showSkyboxes: !1,
  24946. showMesh: !0,
  24947. showFloors: !1,
  24948. showFloorDuration: 300,
  24949. showFloorDelay: 300,
  24950. hideFloorDuration: 300,
  24951. hideFloorDelay: 0,
  24952. reticuleOpacityTransitionTime: 250,
  24953. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue,
  24954. markerOpacityTransitionTime: 500,
  24955. guiAnimationSpeed: 250,
  24956. highlightAnimationDuration: 500,
  24957. modelComponentLoadSpinnerDelay: 150,
  24958. captureErrors: !1,
  24959. maxMobileTextures: 6,
  24960. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24961. startupFlyinDelay: 3e3,
  24962. dollhouseDefault: {
  24963. minDistance: 1,//15, //编辑页面给近一些
  24964. maxDistance: 50,
  24965. minPolarAngle: n.Math.degToRad(10),
  24966. maxPolarAngle: n.Math.degToRad(90)
  24967. },
  24968. hideReticuleTimeout: 1e3,
  24969. analytics: {
  24970. inactivityThreshold: 30,
  24971. sessionTrackingRate: .15,
  24972. maxTrackedErrors: 20,
  24973. sessionDurationPingFrequency: 10,
  24974. sessionDurationTimeout: 15
  24975. },
  24976. flydown: {
  24977. movementEasing: "easeInOutQuad",
  24978. movementDelay: .001,
  24979. rotationEasing: "easeInOutQuad",
  24980. rotationDelay: .5,
  24981. modelTextureDelay: .75,
  24982. skyboxDelay: .75
  24983. },
  24984. transition: {
  24985. flySpeed: .001,
  24986. flyTime: 750,
  24987. flytimeMaxDistanceThreshold: 5,
  24988. flytimeDistanceMultiplier: 150,
  24989. aimTime: 1500,
  24990. aimSlowFactor: 1.5,
  24991. blur: .8,
  24992. movementEasing: "easeInOutQuad",
  24993. blendEasing: "easeInOutQuad",
  24994. fastForwardFactor: 3
  24995. },
  24996. show360Views: {
  24997. enabled: !0,
  24998. transitionTime: 1e3
  24999. },
  25000. quickstart: {
  25001. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  25002. animation: 1400,
  25003. showTextDelay: 500,
  25004. fadeOutDelay: 3e3,
  25005. fovChange: 10
  25006. },
  25007. appConfig: {
  25008. webvr_version: null,
  25009. segment_key: null,
  25010. embedly_key: null,
  25011. branch_key: null,
  25012. keen_write_key: null,
  25013. keen_project_id: null
  25014. },
  25015. vr: {
  25016. enabled: !0,
  25017. allowWebVR: !1,
  25018. option: r.valueFromHash("vr", a.CONTEXTUAL)
  25019. },
  25020. share: {
  25021. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  25022. },
  25023. input: {
  25024. longTapThreshold: 200,
  25025. moveToleranceNDC: .08,
  25026. touchMoveThreshold: 25
  25027. },
  25028. help: {
  25029. modalStayDuration: 600
  25030. },
  25031. immersive: {
  25032. timeToShowAgain: 1250,
  25033. uiStayDuration: 600
  25034. },
  25035. tourInteraction: {
  25036. disabled: "0" === r.valueFromHash("tourcta", null),
  25037. showPauseButton: 1e3,
  25038. showModal: 1500,
  25039. allowNextClick: 200,
  25040. largeModal: "1" === r.valueFromHash("tourcta", null),
  25041. smallModal: "2" === r.valueFromHash("tourcta", null)
  25042. },
  25043. labels: {
  25044. enabled: !1,
  25045. hideUntilStart: !0,
  25046. fadeInDuration: 250,
  25047. fadeInDelay: 250,
  25048. fadeOutDuration: 250,
  25049. fadeOutDelay: 0,
  25050. zoomHideThreshhold: {
  25051. mobile: r.isSmallScreen() ? .45 : .6,
  25052. desktop: 2
  25053. },
  25054. zoomTruncateThreshhold: {
  25055. mobile: r.isSmallScreen() ? .35 : .45,
  25056. desktop: .85
  25057. },
  25058. minLengthForTruncate: 16,
  25059. truncateLength: 12,
  25060. truncateSuffix: "..."
  25061. },
  25062. tags: {
  25063. enabled: r.valueFromHash("mt", 1),
  25064. startup: {
  25065. hideUntilStart: !0,
  25066. fadeInDuration: 500,
  25067. fadeInDelay: 100
  25068. },
  25069. visibility: {
  25070. anyDistance: !0,
  25071. visibleDistance: 8,
  25072. cameraClearance: .1,
  25073. alphaTestLevel: .05,
  25074. hideViaFloor: !0,
  25075. hideOffScreenDisc: !1,
  25076. hideOffScreenObject: !1
  25077. },
  25078. disc: {
  25079. opacity: 1,
  25080. disabledOpacity: .5,
  25081. scale: {
  25082. nearBound: 1.5,
  25083. farBound: 4.8,
  25084. linkFarBound: !1,
  25085. linkPercent: 40,
  25086. maxSize: 80,
  25087. minSize: 40,
  25088. baseViewportSize: 800,
  25089. responsiveness: 100
  25090. }
  25091. },
  25092. pole: {
  25093. enabled: !0,
  25094. height: .5,
  25095. width: 2,
  25096. opacity: .5,
  25097. color: "white"
  25098. },
  25099. navigate: {
  25100. nearestPano: !0,
  25101. lineOfSight: !0,
  25102. reactivate: !0,
  25103. aimAt: "disc",
  25104. tiltTolerance: 25,
  25105. rotateSpeedFactor: .6
  25106. }
  25107. },
  25108. path: {
  25109. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue,
  25110. colorUp: s._desat(s.newBlue, .5),
  25111. colorDown: s._darken(s.newBlue, .35),
  25112. opacity: .5,
  25113. style: "ribbon",
  25114. height: .025,
  25115. ribbonWidth: .24,
  25116. outsideHeight: .5,
  25117. waypointRadius: .5,
  25118. waypointIndoorRadius: .24,
  25119. waypointPulse: 1e3,
  25120. typ: l.BLACK,
  25121. meshFree: r.valueFromHash("mf", 1),
  25122. mapGuides: r.valueFromHash("guides", !0),
  25123. fadeInTime: 400,
  25124. fadeOutTime: 300
  25125. },
  25126. warp: {
  25127. nearPanoDist: .1,
  25128. matchCam: !1,
  25129. blur: .33,
  25130. fastTime: 1500,
  25131. teleportTime: 1500,
  25132. outsideTime: 2e3,
  25133. lookAheadMax: .3,
  25134. lookAheadDist: 2.5,
  25135. softPushDist: .37,
  25136. softPushEnd: .3,
  25137. softBendAngle: 8,
  25138. softBendTilt: 4,
  25139. softBendEnd: .3,
  25140. doBurns: !0,
  25141. burnsAngle: 8,
  25142. minBurnsAngle: 35,
  25143. minDownAngle: -35,
  25144. maxTurnPerSec: 280,
  25145. maxAimPerSec: 35,
  25146. minRotation: 12,
  25147. maxAimRotation: 33.2,
  25148. turnFriction: .2,
  25149. flySpeed: .01,
  25150. minWarpTime: 1200,
  25151. warpInterruptionRedirectTime: 500,
  25152. tourStepDelay: r.valueFromHash("st", 0),
  25153. walkDelay: 0,
  25154. walkMaxDist: 50,
  25155. walkMinDist: .8,
  25156. walkSlideShowThreshhold: 3e3,
  25157. walkExtraPanosDistance: .4,
  25158. timePerMeter: 1200,
  25159. motionLeadTime: 5e3,
  25160. movementEasing: "easeInOutQuad",
  25161. blendEasing: "easeInOutQuad",
  25162. showBunny: !1,
  25163. loop: r.valueFromHash("lp", !1),
  25164. auto: r.valueFromHash("ts", -1),
  25165. eOrder: "YXZ",
  25166. stepFactor: .25,
  25167. brakeStrength: 2,
  25168. minBrakeAngle: .1,
  25169. maxBrakeAngle: 1.8,
  25170. climbEffort: 4
  25171. },
  25172. rotationFriction: .05,
  25173. rotationAccelerationInside: 4.5,
  25174. rotationAccelerationOutside: .15,
  25175. rotationAfterMoveMultiplier: 40,
  25176. rotationAfterMoveHistoryCount: 5,
  25177. panFriction: .09,
  25178. panAccelerationOutside: 60,
  25179. onload: r.valueFromHash("onload", o.PANORAMA),
  25180. zoomNearLimit: .1,
  25181. zoomFarLimit: 50,
  25182. navigation: {
  25183. panoScores: !1,
  25184. mouseDirection: !0,
  25185. filterStrictness: .75,
  25186. angleFactor: -30,
  25187. directionFactor: 10,
  25188. distanceFactor: -1,
  25189. optionalityFactor: 3
  25190. },
  25191. sdkInit: !1,
  25192. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  25193. console: r.valueFromHash("console", !1),
  25194. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  25195. panoramaNeighbourMaxDistance: 5,
  25196. panoFloorClickRadius: .35,
  25197. showScreenshotLocations: !1,
  25198. showAxis: !1,
  25199. showNeighbourRaycasts: !1,
  25200. colorMarkerOnLoad: !1,
  25201. colorMarkerByFloor: !1,
  25202. tiling: {
  25203. panoPreRenderRepeatDelay: 2500,
  25204. panoPreRenderDelay: 500,
  25205. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  25206. tilingFlagNames: ["usetiles", "tiles"],
  25207. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  25208. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  25209. overlayStyle: r.valueFromHash("tileoverlay", 0),
  25210. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  25211. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  25212. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  25213. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  25214. customCompression: r.valueFromHash("tilecustcomp", 0),
  25215. mobileHighQualityOverride: 1,
  25216. allowUltraHighResolution: !0
  25217. },
  25218. zoom: {
  25219. enabled: !0,
  25220. forceOff: r.valueFromHash("nozoom", 0),
  25221. overridemax: r.valueFromHash("maxzoom", null),
  25222. overridemin: r.valueFromHash("minzoom", null),
  25223. max: d.highQualityMaxZoom,
  25224. min: 1,
  25225. transitionStyle: r.valueFromHash("zoomtrans", 1),
  25226. activationThreshold: 1.1,
  25227. restoreTime: 500
  25228. },
  25229. profiling: {
  25230. enabled: r.valueFromHash("mem", !1)
  25231. }
  25232. };
  25233. (p = h.deepExtend(p, d, {
  25234. insideFOV: r.valueFromHash("fov", d.insideFOV),
  25235. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  25236. panorama: {
  25237. transitionTime: 1e3,
  25238. modelAlpha: 0,
  25239. modelAlphaDelay: p.flydown.modelTextureDelay,
  25240. modelAlphaLength: 1,
  25241. skyboxOpacity: 1,
  25242. skyboxOpacityDelay: p.flydown.skyboxDelay,
  25243. skyboxOpacityLength: .9,
  25244. fovLength: 1,
  25245. fovDelay: 0,
  25246. cameraMatrixDuration: .8,
  25247. cameraMatrixDelay: 0,
  25248. cameraMatrixEase: c.easeInCubic,
  25249. reticuleOpacity: 1,
  25250. markerOpacity: .3,
  25251. markerOpacityOnHover: 1
  25252. },
  25253. dollhouse: {
  25254. transitionTime: 1e3,
  25255. modelAlpha: 1,
  25256. modelAlphaDelay: 0,
  25257. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25258. skyboxOpacity: 0,
  25259. skyboxOpacityDelay: 0,
  25260. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25261. fovLength: 1,
  25262. fovDelay: 0,
  25263. cameraMatrixDuration: .8,
  25264. cameraMatrixDelay: .3,
  25265. cameraMatrixEase: c.easeInCubic,
  25266. reticuleOpacity: 1,
  25267. markerOpacity: 0,
  25268. markerOpacityOnHover: 0
  25269. },
  25270. floorplan: {
  25271. transitionTime: 1e3,
  25272. modelAlpha: 1,
  25273. modelAlphaDelay: 0,
  25274. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25275. skyboxOpacity: 0,
  25276. skyboxOpacityDelay: 0,
  25277. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25278. fovLength: 1,
  25279. fovDelay: 0,
  25280. cameraMatrixDuration: .5,
  25281. cameraMatrixDelay: 0,
  25282. cameraMatrixEase: c.easeOutCubic,
  25283. reticuleOpacity: 1,
  25284. markerOpacity: 0,
  25285. markerOpacityOnHover: 0,
  25286. cameraHeight: 50
  25287. },
  25288. transitioning: {
  25289. reticuleOpacity: 0,
  25290. markerOpacity: .3,
  25291. markerOpacityOnHover: 1
  25292. },
  25293. "floorplan-dollhouse": {
  25294. rotationDelay: 0,
  25295. rotationDuration: 1
  25296. },
  25297. "floorplan-panorama": {
  25298. rotationDelay: .5,
  25299. rotationDuration: 1
  25300. },
  25301. "dollhouse-panorama": {
  25302. rotationDelay: .5,
  25303. rotationDuration: 1
  25304. },
  25305. "dollhouse-floorplan": {
  25306. rotationDelay: 0,
  25307. rotationDuration: 1,
  25308. cameraMatrixDuration: 1.05,
  25309. cameraMatrixDelay: .5
  25310. },
  25311. "panorama-dollhouse": {
  25312. rotationDelay: 0,
  25313. rotationDuration: .5
  25314. },
  25315. "panorama-floorplan": {
  25316. transitionTime: 1500,
  25317. rotationDelay: 0,
  25318. rotationDuration: .5
  25319. }
  25320. })).path.meshFree && (p.path.typ = l.WALK),
  25321. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  25322. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  25323. t.exports = p
  25324. }
  25325. , {
  25326. "./constants": 8,
  25327. "./enum/Colors": 19,
  25328. "./enum/VROption": 47,
  25329. "./enum/Viewmode": 51,
  25330. "./enum/WarpStyle": 52,
  25331. "./util/browser": 182,
  25332. "./util/common": 185,
  25333. "./util/easing": 186,
  25334. "./util/showcase": 193,
  25335. three: 217
  25336. }],
  25337. 167: [function(e, t, i) {
  25338. "use strict";
  25339. var n = e("three")
  25340. , r = e("./settings")
  25341. , 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"
  25342. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  25343. t.exports = {
  25344. basicTextured: {
  25345. uniforms: {
  25346. tDiffuse: {
  25347. type: "t",
  25348. value: null
  25349. },
  25350. alpha: {
  25351. type: "f",
  25352. value: 1
  25353. }
  25354. },
  25355. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25356. 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}"
  25357. },
  25358. copyCubeMap: {
  25359. uniforms: {
  25360. tDiffuse: {
  25361. type: "t",
  25362. value: null
  25363. },
  25364. alpha: {
  25365. type: "f",
  25366. value: 1
  25367. }
  25368. },
  25369. 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}",
  25370. 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}"
  25371. },
  25372. cube: {
  25373. uniforms: {
  25374. map: {
  25375. type: "t",
  25376. value: null
  25377. },
  25378. opacity: {
  25379. type: "f",
  25380. value: 1
  25381. }
  25382. },
  25383. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  25384. 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"
  25385. },
  25386. model: {
  25387. uniforms: {
  25388. map: {
  25389. type: "t",
  25390. value: null
  25391. },
  25392. modelAlpha: {
  25393. type: "f",
  25394. value: r.modelAlpha
  25395. },
  25396. opacity: {
  25397. type: "f",
  25398. value: 1
  25399. },
  25400. progress: {
  25401. type: "f",
  25402. value: 0
  25403. },
  25404. blackout: {
  25405. type: "i",
  25406. value: 0
  25407. },
  25408. pano0Map: {
  25409. type: "t",
  25410. value: null
  25411. },
  25412. pano0Position: {
  25413. type: "v3",
  25414. value: new n.Vector3
  25415. },
  25416. pano0Matrix: {
  25417. type: "m4",
  25418. value: new n.Matrix4
  25419. },
  25420. pano1Map: {
  25421. type: "t",
  25422. value: null
  25423. },
  25424. pano1Position: {
  25425. type: "v3",
  25426. value: new n.Vector3
  25427. },
  25428. pano1Matrix: {
  25429. type: "m4",
  25430. value: new n.Matrix4
  25431. }
  25432. },
  25433. vertexShader: o + "uniform vec3 pano0Position;\nuniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\nuniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\nvoid main() {\n\n vUv = uv;\n vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n\n vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;\n vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;\n vWorldPosition0.x *= -1.0;\n\n vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;\n vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;\n vWorldPosition1.x *= -1.0;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25434. fragmentShader: a + "uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\nuniform float progress;\nuniform int blackout;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\nvoid main() {\n\tconst vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);\n\tconst vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);\n\n\tvec4 colorFromPanos;\n\tvec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);\n\tvec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);\n\n\tif (blackout == 0) {\n\t\tcolorFromPanos = mix(colorFromPano0, colorFromPano1, progress);\n\t} else if (blackout == 1) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));\n\t\tcolorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} else if (blackout == 2) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, progress);\n\t} else if (blackout == 3) {\n\t\tcolorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} \n\n\tvec4 colorFromTexture = texture2D( map, vUv );\n\tcolorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);\n\n\tfloat whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);\n\tcolorFromPanos = mix(colorFromPanos, GREY, whiteness);\n\tgl_FragColor = vec4(colorFromPanos.rgb, opacity);\n}\n"
  25435. },
  25436. hot: {
  25437. uniforms: {
  25438. color: {
  25439. type: "c",
  25440. value: new n.Color(16720384)
  25441. },
  25442. opac: {
  25443. type: "f",
  25444. value: 0
  25445. },
  25446. texture1: {
  25447. type: "t",
  25448. value: null
  25449. },
  25450. texture2: {
  25451. type: "t",
  25452. value: null
  25453. }
  25454. },
  25455. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25456. 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"
  25457. },
  25458. modelOutside: {
  25459. uniforms: {
  25460. map: {
  25461. type: "t",
  25462. value: null
  25463. },
  25464. opacity: {
  25465. type: "f",
  25466. value: 1
  25467. }
  25468. },
  25469. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25470. 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"
  25471. },
  25472. ribbon: {
  25473. uniforms: {
  25474. map: {
  25475. type: "t",
  25476. value: null
  25477. },
  25478. opacity: {
  25479. type: "f",
  25480. value: 1
  25481. },
  25482. color: {
  25483. type: "c",
  25484. value: new n.Color(r.path.color)
  25485. }
  25486. },
  25487. 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",
  25488. 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"
  25489. },
  25490. waypoint: {
  25491. uniforms: {
  25492. map: {
  25493. type: "t",
  25494. value: null
  25495. },
  25496. opacity: {
  25497. type: "f",
  25498. value: 1
  25499. },
  25500. pulse: {
  25501. type: "f",
  25502. value: 1
  25503. },
  25504. nearFade: {
  25505. type: "v2",
  25506. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  25507. },
  25508. color: {
  25509. type: "c",
  25510. value: new n.Color(r.reticuleColor)
  25511. }
  25512. },
  25513. 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",
  25514. 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"
  25515. },
  25516. modelDebug: {
  25517. uniforms: {
  25518. map: {
  25519. type: "t",
  25520. value: null
  25521. },
  25522. modelAlpha: {
  25523. type: "f",
  25524. value: r.modelAlpha
  25525. },
  25526. depthmapRatio: {
  25527. type: "f",
  25528. value: 0
  25529. },
  25530. opacity: {
  25531. type: "f",
  25532. value: 1
  25533. },
  25534. progress: {
  25535. type: "f",
  25536. value: 0
  25537. },
  25538. considerOcclusion: {
  25539. type: "i",
  25540. value: r.fancierTransition
  25541. },
  25542. highlightPanoSelection: {
  25543. type: "i",
  25544. value: 0
  25545. },
  25546. useThirdPano: {
  25547. type: "i",
  25548. value: r.useThirdPano
  25549. },
  25550. pano0Map: {
  25551. type: "t",
  25552. value: null
  25553. },
  25554. pano0Depth: {
  25555. type: "t",
  25556. value: null
  25557. },
  25558. pano0Position: {
  25559. type: "v3",
  25560. value: new n.Vector3
  25561. },
  25562. pano0Matrix: {
  25563. type: "m4",
  25564. value: new n.Matrix4
  25565. },
  25566. pano0Weight: {
  25567. type: "f",
  25568. value: r.transition.pano0Weight
  25569. },
  25570. pano1Map: {
  25571. type: "t",
  25572. value: null
  25573. },
  25574. pano1Depth: {
  25575. type: "t",
  25576. value: null
  25577. },
  25578. pano1Position: {
  25579. type: "v3",
  25580. value: new n.Vector3
  25581. },
  25582. pano1Matrix: {
  25583. type: "m4",
  25584. value: new n.Matrix4
  25585. },
  25586. pano1Weight: {
  25587. type: "f",
  25588. value: r.transition.pano1Weight
  25589. },
  25590. pano2Map: {
  25591. type: "t",
  25592. value: null
  25593. },
  25594. pano2Depth: {
  25595. type: "t",
  25596. value: null
  25597. },
  25598. pano2Position: {
  25599. type: "v3",
  25600. value: new n.Vector3
  25601. },
  25602. pano2Matrix: {
  25603. type: "m4",
  25604. value: new n.Matrix4
  25605. },
  25606. pano2Weight: {
  25607. type: "f",
  25608. value: r.transition.pano2Weight
  25609. }
  25610. },
  25611. 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",
  25612. 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"
  25613. },
  25614. customDepth: {
  25615. uniforms: {
  25616. panoPosition: {
  25617. type: "v3",
  25618. value: new n.Vector3
  25619. }
  25620. },
  25621. 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",
  25622. 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"
  25623. },
  25624. skysphere: {
  25625. uniforms: {
  25626. radius: {
  25627. type: "f",
  25628. value: 0
  25629. }
  25630. },
  25631. 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",
  25632. 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"
  25633. },
  25634. tagDisc: {
  25635. uniforms: {
  25636. opacity: {
  25637. type: "f",
  25638. value: 0
  25639. },
  25640. color: {
  25641. type: "c",
  25642. value: new n.Color
  25643. },
  25644. bg: {
  25645. type: "t",
  25646. value: null
  25647. },
  25648. mask: {
  25649. type: "t",
  25650. value: null
  25651. }
  25652. },
  25653. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25654. 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"
  25655. }
  25656. }
  25657. window.shaders = t.exports;
  25658. }
  25659. , {
  25660. "./settings": 166,
  25661. three: 217
  25662. }],
  25663. 168: [function(E, _, e) {
  25664. (function(e) {
  25665. "use strict";
  25666. var t = E("three")
  25667. , i = (E("url"),
  25668. E("./util/ajax"))
  25669. , n = E("./settings")
  25670. , r = E("./util/logger")
  25671. , o = E("./util/math")
  25672. , a = E("./util/showcase")
  25673. , s = E("./objects/Panorama")
  25674. , l = new r(e)
  25675. , c = E("./model/Model")
  25676. , h = E("./shaders")
  25677. , u = E("./util/transitions")
  25678. , d = E("./objects/Chunk")
  25679. , p = E("./objects/Reticule")
  25680. , f = E("./objects/Skybox")
  25681. , g = E("./objects/Floor")
  25682. , m = E("./cameras/DollhouseCamera")
  25683. , v = E("./cameras/FloorplanCamera")
  25684. , y = E("./cameras/PanoramaCamera")
  25685. , A = E("./controls/DollhouseControls")
  25686. , C = E("./controls/FloorplanControls")
  25687. , I = E("./controls/PanoramaControls");
  25688. t.ImageUtils.crossOrigin = n.crossOrigin,
  25689. _.exports = {
  25690. shaders: h,
  25691. transitions: u,
  25692. Model: c,
  25693. Chunk: d,
  25694. Floor: g,
  25695. Skybox: f,
  25696. Reticule: p,
  25697. Panorama: s,
  25698. DollhouseCamera: m,
  25699. FloorplanCamera: v,
  25700. PanoramaCamera: y,
  25701. DollhouseControls: A,
  25702. FloorplanControls: C,
  25703. PanoramaControls: I,
  25704. getModel: function(e) {
  25705. if (!e.url)
  25706. throw 'getModel(): missing parameter "url"';
  25707. e.autoload = void 0 === e.autoload || e.autoload;
  25708. var t = a.parseSidUrl(e.url);
  25709. e.urlBase = t.urlBase,
  25710. e.urlModel = t.urlModel,
  25711. e.urlFiles = t.urlFiles;
  25712. var i = this._getPlatformError();
  25713. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25714. this._loadModel().then(this._buildModel.bind(this)))
  25715. },
  25716. _getPlatformError: function() {
  25717. 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"
  25718. },
  25719. _loadModel: function() {
  25720. return i.get(this.options.urlModel, {
  25721. responseType: "json",
  25722. prefetchFrom: "model",
  25723. auth: a.getAuthorizationHeader()
  25724. }).then(null, function() {
  25725. return l.warn("Model loading failed at initial metadata load"),
  25726. "loading-failed"
  25727. })
  25728. },
  25729. _buildModel: function(e) {
  25730. e = a.normalizeModeldata(e, o);
  25731. var t = new c(this.options,e);
  25732. return this.options.autoload ? t.load(!0) : $.when(t)
  25733. }
  25734. }
  25735. }
  25736. ).call(this, "/js/showcase.js")
  25737. }
  25738. , {
  25739. "./cameras/DollhouseCamera": 5,
  25740. "./cameras/FloorplanCamera": 6,
  25741. "./cameras/PanoramaCamera": 7,
  25742. "./controls/DollhouseControls": 10,
  25743. "./controls/FloorplanControls": 11,
  25744. "./controls/PanoramaControls": 13,
  25745. "./model/Model": 139,
  25746. "./objects/Chunk": 144,
  25747. "./objects/Floor": 146,
  25748. "./objects/Panorama": 148,
  25749. "./objects/Reticule": 149,
  25750. "./objects/Skybox": 152,
  25751. "./settings": 166,
  25752. "./shaders": 167,
  25753. "./util/ajax": 181,
  25754. "./util/logger": 189,
  25755. "./util/math": 190,
  25756. "./util/showcase": 193,
  25757. "./util/transitions": 195,
  25758. three: 217,
  25759. url: 208
  25760. }],
  25761. 169: [function(e, t, i) {
  25762. "use strict";
  25763. function l(e) {
  25764. var t = {
  25765. renderTarget: null,
  25766. inUse: !1,
  25767. size: -1,
  25768. pano: null
  25769. };
  25770. return t.inUse = !0,
  25771. t.size = e,
  25772. function(e) {
  25773. O.push(e)
  25774. }(t),
  25775. t
  25776. }
  25777. function c(e) {
  25778. for (var t = 0; t < O.length; t++) {
  25779. var i = O[t];
  25780. if (i.renderTarget === e)
  25781. return !(i.inUse = !1)
  25782. }
  25783. return !1
  25784. }
  25785. function n() {
  25786. this.tileDirectory = {},
  25787. this.activeRenderTargetDescriptors = {},
  25788. this.activePanos = [],
  25789. this.panoLODDescriptors = {},
  25790. this.panoDescriptors = {},
  25791. this.tileTrees = {},
  25792. this.sceneRenderer = null,
  25793. this.tileDownloader = null,
  25794. this.forceQueue = [],
  25795. this.uploadQueues = {},
  25796. this.uploadInterval = null,
  25797. this.uploadIntervalCancelled = !1,
  25798. this.usingTileOverlay = !1,
  25799. this.overlayTilesLoaded = !1,
  25800. this.overlayTileBase = null,
  25801. this.overlayTilesBasic = {},
  25802. this.overlayTilesEnhanced = {},
  25803. this.zoomRenderTarget = null,
  25804. this.zoomPano = null,
  25805. this.zoomingActive = !1,
  25806. this.zoomPanoId = null,
  25807. this.zoomPanoRenderingDisabled = !1,
  25808. this.direction = new _.Vector3,
  25809. this.initTime = -1,
  25810. this.maxBaseUploadsPerFrame = R,
  25811. this.maxNonBaseUploadsPerFrame = M
  25812. }
  25813. var I, E, r, o, a, h, s, _ = e("three"), u = e("../exception/BasicException"), d = e("../settings"), p = e("../enum/PanoSizeClass"), b = (e("../objects/Panorama"),
  25814. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25815. e("../objects/Panorama"),
  25816. e("./TileTree")), y = (e("./TileDownloader"),
  25817. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25818. e("../util/browser"),
  25819. e("../util/panorama")), w = e("events").EventEmitter, T = !1, x = d.tiling.uploadIntervalDelay, S = d.tiling.initialIntervalDelay, M = d.tiling.maxNonBaseUploadsPerFrame, R = d.tiling.maxBaseUploadsPerFrame, P = {
  25820. Base: 0,
  25821. Remaining: 1
  25822. }, O = [];
  25823. function L(e) {
  25824. var t = e.shift();
  25825. return t.uploadQueued = !1,
  25826. t
  25827. }
  25828. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25829. this.sceneRenderer = e,
  25830. this.tileDownloader = t,
  25831. this.qualityManager = i,
  25832. this.bindEvents(),
  25833. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25834. this.initTime = performance.now()
  25835. }
  25836. ,
  25837. n.prototype.getActivePanoTextures = function(e) {
  25838. e = e || [];
  25839. for (var t = 0; t < O.length; t++) {
  25840. var i = O[t];
  25841. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25842. }
  25843. }
  25844. ,
  25845. n.prototype.hasQueuedTiles = function() {
  25846. var e = this.peekNextFromUploadQueue();
  25847. return null != e
  25848. }
  25849. ,
  25850. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25851. return this.activeRenderTargetDescriptors[e]
  25852. }
  25853. ,
  25854. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25855. this.activeRenderTargetDescriptors[e] = t
  25856. }
  25857. ,
  25858. n.prototype.loadOverlayTiles = function() {
  25859. if (0 !== d.tiling.overlayStyle) {
  25860. var n = 0
  25861. , e = function(e, t, i) {
  25862. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25863. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25864. ++n === r.length && (this.overlayTilesLoaded = !0)
  25865. }
  25866. .bind(this)
  25867. , r = [["images/outlineBase.png", e.bind(this, this.overlayTileBase, null)], ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 256)], ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 512)], ["images/outlineBasic1024.png", e.bind(this, this.overlayTilesBasic, 1024)], ["images/outlineBasic2048.png", e.bind(this, this.overlayTilesBasic, 2048)], ["images/outlineBasic4096.png", e.bind(this, this.overlayTilesBasic, 4096)], ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 256)], ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 512)], ["images/outlineEnhanced1024.png", e.bind(this, this.overlayTilesEnhanced, 1024)], ["images/outlineEnhanced2048.png", e.bind(this, this.overlayTilesEnhanced, 2048)], ["images/outlineEnhanced4096.png", e.bind(this, this.overlayTilesEnhanced, 4096)]];
  25868. r.forEach(function(e) {
  25869. this.tileDownloader.loadImage(e[0], 0, e[1])
  25870. }
  25871. .bind(this)),
  25872. this.usingTileOverlay = !0
  25873. } else
  25874. this.usingTileOverlay = !1
  25875. }
  25876. ,
  25877. n.prototype.bindEvents = function() {
  25878. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25879. }
  25880. ,
  25881. n.prototype.setupZoomRenderTarget = function() {
  25882. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25883. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25884. return;
  25885. var e = this.zoomRenderTarget;
  25886. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25887. e) {
  25888. var t = e.width
  25889. , i = this.zoomRenderTarget.width;
  25890. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25891. e.texture.dispose(),
  25892. e.texture.loaded = !1,
  25893. e.texture.version = 0,
  25894. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25895. e.texture = null
  25896. }
  25897. this.zoomPanoRenderingDisabled = !1
  25898. } else
  25899. this.zoomPanoRenderingDisabled = !0
  25900. }
  25901. ,
  25902. n.prototype.enableUltraHighQualityMode = function(t) {
  25903. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25904. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25905. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25906. e && (this.qualityManager.enableUltraHighQualityMode(),
  25907. this.setupZoomRenderTarget(),
  25908. t())
  25909. }
  25910. .bind(this))
  25911. }
  25912. }
  25913. ,
  25914. n.prototype.activateTiledPano = function(e, t, i) {
  25915. i && this.clearAllQueuedUploads();
  25916. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25917. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25918. this.linkAllTilesAndNodes(e);
  25919. var r = this.getActiveRenderTargetDescriptor(e.id)
  25920. , o = t;
  25921. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25922. !r || o !== r.size) {
  25923. if (r && c(r.renderTarget),
  25924. !(r = function(e) {
  25925. for (var t = 0; t < O.length; t++) {
  25926. var i = O[t];
  25927. if (!i.inUse && i.size === e)
  25928. return i.inUse = !0,
  25929. i
  25930. }
  25931. return null
  25932. }(o))) {
  25933. var a = this.initTiledPano(o, !1);
  25934. (r = l(a.width)).renderTarget = a
  25935. }
  25936. r.pano = e,
  25937. this.resetPanoDescriptor(e.id),
  25938. this.resetPanoLODDescriptors(e.id),
  25939. this.resetRenderStatus(e.id, !0, !0)
  25940. }
  25941. this.setActiveRenderTargetDescriptor(e.id, r);
  25942. var s = i ? 0 : 1;
  25943. return this.updateActivePanos(e, s),
  25944. r.renderTarget
  25945. }
  25946. ,
  25947. n.prototype.deactivateTiledPano = function(e) {
  25948. var t = this.getActiveRenderTargetDescriptor(e.id);
  25949. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  25950. this.setActiveRenderTargetDescriptor(e.id, null);
  25951. var i = this.getUploadQueueForPano(e.id);
  25952. this.clearUploadQueue(i),
  25953. this.updateActivePanos()
  25954. }
  25955. ,
  25956. n.prototype.updateActivePanos = (s = [],
  25957. function(e, t) {
  25958. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  25959. e && s.length === t && s.push(e);
  25960. var n = this.activePanos[i]
  25961. , r = this.getActiveRenderTargetDescriptor(n.id);
  25962. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25963. }
  25964. e && t >= s.length && s.push(e),
  25965. this.activePanos.length = 0,
  25966. this.activePanos.push.apply(this.activePanos, s)
  25967. }
  25968. ),
  25969. n.prototype.getActivePanoCount = function() {
  25970. return this.activePanos.length
  25971. }
  25972. ,
  25973. n.prototype.resetRenderStatus = function(e, r, o, t) {
  25974. var i = null;
  25975. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  25976. for (var n = function(e, t, i, n) {
  25977. o && (t.tile.zoomUploaded = !1),
  25978. r && (t.tile.uploaded = !1)
  25979. }, a = 0; a < A.FACES_PER_PANO; a++) {
  25980. this.getTileTree(e, a).breadthFirst({
  25981. callback: n.bind(this, a),
  25982. minLevel: i
  25983. })
  25984. }
  25985. }
  25986. ,
  25987. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25988. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25989. t.tile.zoomUploaded = t.tile.uploaded,
  25990. t.zoomCovered = t.covered
  25991. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25992. this.getTileTree(e, n).breadthFirst({
  25993. callback: i.bind(this, n),
  25994. maxLevel: t
  25995. })
  25996. }
  25997. }
  25998. ,
  25999. n.prototype.renderPanoTiles = (h = [],
  26000. function(e, t, i, n) {
  26001. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  26002. t = t || this.direction || m.FORWARD;
  26003. var r = this.getActiveRenderTargetDescriptor(e);
  26004. if (!this.isRenderTargetDescriptorValid(r))
  26005. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  26006. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  26007. var a = this.getTileTree(e, o);
  26008. h.length = 0,
  26009. a.breadthFirst({
  26010. saveVisited: h
  26011. });
  26012. for (var s = 0; s < h.length; s++) {
  26013. var l = h[s];
  26014. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  26015. }
  26016. }
  26017. this.updateDirection(t)
  26018. }
  26019. ),
  26020. n.prototype.isRenderTargetDescriptorValid = function(e) {
  26021. return e && e.renderTarget
  26022. }
  26023. ,
  26024. n.prototype.isPanoActive = function(e) {
  26025. var t = this.getActiveRenderTargetDescriptor(e);
  26026. return this.isRenderTargetDescriptorValid(t)
  26027. }
  26028. ,
  26029. n.prototype.isPanoZoomed = function(e) {
  26030. return this.zoomingActive && this.zoomPanoId === e
  26031. }
  26032. ,
  26033. n.prototype.initTileTree = function(e, t, i) {
  26034. var n = this.tileTrees[e];
  26035. n || (n = [],
  26036. this.tileTrees[e] = n);
  26037. var r = n[t];
  26038. if (!r) {
  26039. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  26040. r = new v(A.TILE_SIZE,o),
  26041. n[t] = r
  26042. }
  26043. }
  26044. ,
  26045. n.prototype.getTileTree = function(e, t) {
  26046. var i = this.tileTrees[e];
  26047. if (!i)
  26048. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  26049. var n = i[t];
  26050. if (!n)
  26051. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  26052. return n
  26053. }
  26054. ,
  26055. n.prototype.initTiledPano = function(e, t) {
  26056. var i = this.sceneRenderer.renderer
  26057. , n = (i.context,
  26058. new _.WebGLRenderTargetCube(e,e,{
  26059. stencilBuffer: !1
  26060. }))
  26061. , r = new _.CubeTexture([]);
  26062. (n.texture = r).image = [null, null, null, null, null, null],
  26063. r.flipY = !0,
  26064. t ? (r.generateMipmaps = !0,
  26065. r.magFilter = _.LinearFilter,
  26066. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  26067. r.magFilter = _.LinearFilter,
  26068. r.minFilter = _.LinearFilter),
  26069. r.format = _.RGBAFormat,
  26070. i.setRenderTarget(n),
  26071. i.setRenderTarget(null);
  26072. var o = i.properties.get(r);
  26073. return o.__image__webglTextureCube = o.__webglTexture,
  26074. n
  26075. }
  26076. ,
  26077. n.prototype.getUploadQueueForPano = function(e) {
  26078. var t = this.uploadQueues[e];
  26079. return t || (t = [],
  26080. this.uploadQueues[e] = t),
  26081. t
  26082. }
  26083. ,
  26084. n.prototype.isTileUploaded = function(e) {
  26085. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  26086. }
  26087. ,
  26088. n.prototype.setUploaded = function(e, t) {
  26089. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  26090. }
  26091. ,
  26092. n.prototype.queueTileUpload = function(e, t, i) {
  26093. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  26094. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  26095. var r = this.getUploadQueueForPano(e.panoId);
  26096. 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),
  26097. e.uploadQueued = !0,
  26098. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  26099. }
  26100. }
  26101. ,
  26102. n.prototype.shoulPushToFrontOfQueue = function(e) {
  26103. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  26104. }
  26105. ,
  26106. n.prototype.getTopUploadQueue = function() {
  26107. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  26108. for (var n = 0; n < this.activePanos.length; n++)
  26109. if (e = this.activePanos[n],
  26110. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  26111. switch (i) {
  26112. case P.Base:
  26113. if (0 === t[0].level)
  26114. return t;
  26115. break;
  26116. case P.Remaining:
  26117. return t
  26118. }
  26119. return null
  26120. }
  26121. ,
  26122. n.prototype.getNextFromUploadQueue = function() {
  26123. if (0 < this.forceQueue.length)
  26124. return L(this.forceQueue);
  26125. var e = this.getTopUploadQueue();
  26126. return e && 0 < e.length ? L(e) : null
  26127. }
  26128. ,
  26129. n.prototype.peekNextFromUploadQueue = function() {
  26130. if (0 < this.forceQueue.length)
  26131. return this.forceQueue[0];
  26132. var e = this.getTopUploadQueue();
  26133. return e && 0 < e.length ? e[0] : null
  26134. }
  26135. ,
  26136. n.prototype.clearAllQueuedUploads = function() {
  26137. this.clearAllUploadQueues(null, 0)
  26138. }
  26139. ,
  26140. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  26141. this.clearAllUploadQueues(e, 0)
  26142. }
  26143. ,
  26144. n.prototype.clearAllUploadQueues = function(e, t) {
  26145. if (e)
  26146. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  26147. this.clearUploadQueue(this.forceQueue, t, e);
  26148. else {
  26149. for (var i = 0; i < this.activePanos.length; i++) {
  26150. var n = this.activePanos[i];
  26151. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  26152. }
  26153. this.clearUploadQueue(this.forceQueue, t)
  26154. }
  26155. }
  26156. ,
  26157. n.prototype.clearUploadQueue = function(e, t, i) {
  26158. null != t || (t = 0);
  26159. for (var n = 0; n < e.length; ) {
  26160. var r = e[n];
  26161. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  26162. e.splice(n, 1)) : n++
  26163. }
  26164. }
  26165. ,
  26166. n.prototype.refreshUploadInterval = (a = null,
  26167. function(e) {
  26168. this.uploadIntervalCancelled || (a = a || function() {
  26169. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  26170. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26171. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  26172. }
  26173. .bind(this),
  26174. null != e || (e = x),
  26175. T || (e = S),
  26176. this.uploadInterval = window.setTimeout(a, e),
  26177. this.uploadIntervalDelay = e)
  26178. }
  26179. ),
  26180. n.prototype.update = (r = performance.now(),
  26181. o = 0,
  26182. function() {
  26183. this.uploadIntervalCancelled = !0,
  26184. window.clearTimeout(this.uploadInterval),
  26185. this.uploadInterval = null;
  26186. var e = performance.now() - r;
  26187. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26188. r = performance.now()),
  26189. o++
  26190. }
  26191. ),
  26192. n.prototype.updateUploadQueue = function(e, t) {
  26193. e = e || 1;
  26194. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  26195. var r = this.getNextFromUploadQueue();
  26196. if (!r)
  26197. break;
  26198. if (0 !== r.level ? i++ : n++,
  26199. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  26200. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  26201. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  26202. }
  26203. }
  26204. }
  26205. ,
  26206. n.prototype.updateDirection = function(e) {
  26207. if (e = e || this.direction) {
  26208. this.direction = e;
  26209. for (var t = 0; t < this.activePanos.length; t++) {
  26210. var i = this.activePanos[t]
  26211. , n = this.getUploadQueueForPano(i.id);
  26212. y.sortPanoTiles(n, i, this.direction)
  26213. }
  26214. }
  26215. }
  26216. ,
  26217. n.prototype.uploadTile = (I = {},
  26218. new _.Vector4,
  26219. E = d.tiling.overlayStyle,
  26220. function(e, t) {
  26221. var i = e.panoId
  26222. , n = e.image
  26223. , r = e.tileSize
  26224. , o = e.panoSize
  26225. , a = e.tileIndex
  26226. , s = (e.faceTileIndex,
  26227. e.totalTiles)
  26228. , l = (e.face,
  26229. e.tileX)
  26230. , c = e.tileY
  26231. , h = !0
  26232. , u = !1
  26233. , d = (this.getPanoDescriptor(i),
  26234. this.getPanoLODDescriptor(i, o))
  26235. , p = this.getActiveRenderTargetDescriptor(i)
  26236. , f = p.renderTarget
  26237. , g = p.size;
  26238. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  26239. g = this.qualityManager.getMaxZoomPanoSize()),
  26240. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  26241. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  26242. this.isTileUploaded(e) && (u = h = !1)),
  26243. h) {
  26244. var m = r / o * g
  26245. , v = l * r / o * g
  26246. , y = c * r / o * g;
  26247. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  26248. var A = I[r];
  26249. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  26250. 1 === E || 2 === E) {
  26251. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  26252. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  26253. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  26254. } else
  26255. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  26256. d.uploadCount++,
  26257. this.emit(b.TileRenderSuccess, i, o, a, s),
  26258. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  26259. this.setUploaded(e, !0),
  26260. this.addCoverageForNode(e.node)
  26261. } else
  26262. this.setUploaded(e, !1);
  26263. return e.uploadAttempted || (d.uploadAttempts++,
  26264. this.emit(b.TileUploadAttempted, i, o, a, s)),
  26265. e.uploadAttempted = !0,
  26266. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  26267. u
  26268. }
  26269. ),
  26270. n.prototype.linkTileAndNode = function(e, t) {
  26271. (t.tile = e).node = t
  26272. }
  26273. ,
  26274. n.prototype.linkAllTilesAndNodes = function(a) {
  26275. for (var e = function(e, t, i, n, r) {
  26276. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  26277. this.linkTileAndNode(o, i)
  26278. }, t = 0; t < A.FACES_PER_PANO; t++) {
  26279. var i = this.getTileTree(a.id, t);
  26280. i.breadthFirst({
  26281. callback: e.bind(this, i, t)
  26282. })
  26283. }
  26284. }
  26285. ,
  26286. n.prototype.anyUploaded = function(e) {
  26287. if (!e)
  26288. return !1;
  26289. if (e.tile && this.isTileUploaded(e.tile))
  26290. return !0;
  26291. if (e.children)
  26292. for (var t = 0; t < e.children.length; t++) {
  26293. var i = e.children[t];
  26294. if (this.anyUploaded(i))
  26295. return !0
  26296. }
  26297. return !1
  26298. }
  26299. ,
  26300. n.prototype.setNodeCovered = function(e, t) {
  26301. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  26302. }
  26303. ,
  26304. n.prototype.isNodeCovered = function(e) {
  26305. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  26306. }
  26307. ,
  26308. n.prototype.addCoverageForNode = function(e) {
  26309. if (this.setNodeCovered(e, !0),
  26310. e.parent && e.covered) {
  26311. var t = e.parent;
  26312. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  26313. }
  26314. }
  26315. ,
  26316. n.prototype.calcFullCoverage = function(e) {
  26317. var t = !1;
  26318. if (e.children)
  26319. for (var i = 0; i < e.children.length; i++) {
  26320. var n = e.children[i];
  26321. t = t || this.calcFullCoverage(n)
  26322. }
  26323. e.covered = e.tile.uploaded || t
  26324. }
  26325. ,
  26326. n.prototype.nodeSubcovered = function(e) {
  26327. if (!e.children)
  26328. return !1;
  26329. for (var t = 0; t < e.children.length; t++)
  26330. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  26331. return !1;
  26332. return !0
  26333. }
  26334. ,
  26335. n.prototype.resetPanoDescriptor = function(e) {
  26336. this.getPanoDescriptor(e)
  26337. }
  26338. ,
  26339. n.prototype.getPanoDescriptor = function(e) {
  26340. var t = this.panoDescriptors[e];
  26341. return t || (t = {},
  26342. this.panoDescriptors[e] = t),
  26343. t
  26344. }
  26345. ,
  26346. n.prototype.resetPanoLODDescriptors = function(e) {
  26347. var t = this.getPanoLODDescriptors(e);
  26348. for (var i in t)
  26349. if (t.hasOwnProperty(i)) {
  26350. var n = t[i];
  26351. n.uploadCount = 0,
  26352. n.uploadAttempts = 0
  26353. }
  26354. }
  26355. ,
  26356. n.prototype.getPanoLODDescriptor = function(e, t) {
  26357. var i = this.getPanoLODDescriptors(e)
  26358. , n = i[t];
  26359. return n || (n = {
  26360. uploadCount: 0,
  26361. uploadAttempts: 0
  26362. },
  26363. i[t] = n),
  26364. n
  26365. }
  26366. ,
  26367. n.prototype.getPanoLODDescriptors = function(e) {
  26368. var t = this.panoLODDescriptors[e];
  26369. return t || (t = {},
  26370. this.panoLODDescriptors[e] = t),
  26371. t
  26372. }
  26373. ,
  26374. n.prototype.onTileDownloaded = function(e) {
  26375. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  26376. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  26377. if (i.downloaded = !0,
  26378. i.image = e.image,
  26379. i.panoSize = e.panoSize,
  26380. i.tileX = e.tileX,
  26381. i.tileY = e.tileY,
  26382. i.totalTiles = e.totalTiles,
  26383. i.tileIndex = e.tileIndex,
  26384. i.faceTileIndex = e.faceTileIndex,
  26385. i.face = e.face,
  26386. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  26387. i.panoId = e.panoId,
  26388. i.tileSize = e.tileSize,
  26389. i.direction = (new _.Vector3).copy(e.direction),
  26390. i.node = null,
  26391. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  26392. this.isPanoActive(i.panoId)) {
  26393. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  26394. this.linkTileAndNode(i, n),
  26395. this.queueTileUpload(i, !0)
  26396. }
  26397. }
  26398. ,
  26399. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  26400. var r = this.tileDirectory[e];
  26401. r || (r = {},
  26402. this.tileDirectory[e] = r);
  26403. var o = 16384 * t + 1024 * i + n
  26404. , a = r[o];
  26405. return a || (a = {
  26406. downloaded: !1,
  26407. uploaded: !1,
  26408. zoomUploaded: !1
  26409. },
  26410. r[o] = a),
  26411. a._key = e + ":" + t + ":" + i + ":" + n,
  26412. a._tileKey = o,
  26413. a
  26414. }
  26415. ,
  26416. n.prototype.setZoomingActive = function(e, t, i) {
  26417. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  26418. this.zoomPanoId = t.id,
  26419. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  26420. }
  26421. ,
  26422. n.prototype.updateZoomedPanoFromBase = function(e) {
  26423. if (!this.zoomPanoRenderingDisabled) {
  26424. var t = this.getActiveRenderTargetDescriptor(e.id);
  26425. if (t && t.renderTarget) {
  26426. var i = this.qualityManager.getMaxZoomPanoSize()
  26427. , n = t.renderTarget
  26428. , r = t.size;
  26429. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  26430. this.copyBaseRenderStatusToZoomed(e.id)
  26431. }
  26432. }
  26433. }
  26434. ,
  26435. t.exports = n
  26436. }
  26437. , {
  26438. "../enum/GLCubeFaces": 25,
  26439. "../enum/PanoRendererEvents": 35,
  26440. "../enum/PanoSizeClass": 36,
  26441. "../enum/SceneRendererEvents": 43,
  26442. "../enum/TileDownloaderEvents": 45,
  26443. "../enum/Vectors": 50,
  26444. "../exception/BasicException": 55,
  26445. "../objects/Panorama": 148,
  26446. "../settings": 166,
  26447. "../util/browser": 182,
  26448. "../util/panorama": 191,
  26449. "./TileDownloader": 171,
  26450. "./TilePrioritizer": 172,
  26451. "./TileTree": 173,
  26452. "./TileUtils": 174,
  26453. events: 202,
  26454. three: 217
  26455. }],
  26456. 170: [function(e, t, i) {
  26457. "use strict";
  26458. function n(e, t, i) {
  26459. this.maxNavPanoSize = -1,
  26460. this.maxZoomPanoSize = -1,
  26461. this.devicePixelDensity = e,
  26462. this.deviceScreenSize = t,
  26463. this.clientBandwidth = i,
  26464. this.panoSizeClassMap = {},
  26465. this.useHighResolutionPanos = !0,
  26466. this.useUltraHighResolutionPanos = !1,
  26467. this.modelHasUltraHighPanos = !1
  26468. }
  26469. var r = e("../enum/PanoSizeClass")
  26470. , o = e("../settings")
  26471. , a = e("../util/browser")
  26472. , s = e("../constants")
  26473. , l = e("../util/showcase")
  26474. , c = e("../enum/ModelManagerEvents");
  26475. n.prototype.init = function(e) {
  26476. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  26477. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  26478. this.highSize = this.getPanoSize(r.HIGH),
  26479. this.standardSize = this.getPanoSize(r.STANDARD),
  26480. this.baseSize = this.getPanoSize(r.BASE),
  26481. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  26482. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  26483. this.updateMaximums(),
  26484. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  26485. }
  26486. ,
  26487. n.prototype.updateFromModel = function(e) {
  26488. this.updateHighResolutionSettings(e),
  26489. this.updateUltraHighResolutionSettings(e)
  26490. }
  26491. ,
  26492. n.prototype.updateHighResolutionSettings = function(e) {
  26493. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  26494. this.updateMaximums()
  26495. }
  26496. ,
  26497. n.prototype.updateUltraHighResolutionSettings = function(e) {
  26498. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  26499. this.updateMaximums()
  26500. }
  26501. ,
  26502. n.prototype.enableUltraHighQualityMode = function() {
  26503. this.modelHasUltraHighPanos = !0,
  26504. this.updateUltraHighResolutionSettings(null)
  26505. }
  26506. ,
  26507. n.prototype.ultraHighQualityModeEnabled = function() {
  26508. return this.modelHasUltraHighPanos
  26509. }
  26510. ,
  26511. n.prototype.onModelChanged = function(e) {
  26512. this.updateFromModel(e.model),
  26513. this.updateMaximums()
  26514. }
  26515. ,
  26516. n.prototype.updateMaximums = function() {
  26517. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  26518. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  26519. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  26520. }
  26521. ,
  26522. n.prototype.buildPanoSizeClassMap = function() {
  26523. this.panoSizeClassMap[r.BASE] = 512,
  26524. this.panoSizeClassMap[r.STANDARD] = 1024,
  26525. this.panoSizeClassMap[r.HIGH] = 2048,
  26526. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  26527. }
  26528. ,
  26529. n.prototype.getPanoSize = function(e) {
  26530. return this.panoSizeClassMap[e]
  26531. }
  26532. ,
  26533. n.prototype.getMaxPossiblePanoSize = function() {
  26534. return this.getPanoSize(r.ULTRAHIGH)
  26535. }
  26536. ,
  26537. n.prototype.getMaxPanoSize = function() {
  26538. return this.maxZoomPanoSize
  26539. }
  26540. ,
  26541. n.prototype.getMaxNavPanoSize = function() {
  26542. return this.maxNavPanoSize
  26543. }
  26544. ,
  26545. n.prototype.getMaxZoomPanoSize = function() {
  26546. return this.maxZoomPanoSize
  26547. }
  26548. ,
  26549. n.prototype.detectMaxNavPanoSizeClass = function() {
  26550. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  26551. }
  26552. ,
  26553. n.prototype.detectMaxNavPanoSize = function() {
  26554. var e = this.detectMaxNavPanoSizeClass();
  26555. return this.getPanoSize(e)
  26556. }
  26557. ,
  26558. n.prototype.detectMaxZoomPanoSize = function() {
  26559. 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)
  26560. }
  26561. ,
  26562. t.exports = n
  26563. }
  26564. , {
  26565. "../constants": 8,
  26566. "../enum/ModelManagerEvents": 33,
  26567. "../enum/PanoSizeClass": 36,
  26568. "../settings": 166,
  26569. "../util/browser": 182,
  26570. "../util/showcase": 193
  26571. }],
  26572. 171: [function(A, C, e) {
  26573. (function(e) {
  26574. "use strict";
  26575. function i(e) {
  26576. this.panos = null,
  26577. this.retryMinimumTime = 1e4,
  26578. this.urls = null,
  26579. this.panoLoadCallbacks = {},
  26580. this.downloadDescriptors = {},
  26581. this.priorityQueue = [],
  26582. this.forceQueue = [],
  26583. this.activeDownloads = [],
  26584. this.qualityManager = null,
  26585. this.tilePrioritizer = null,
  26586. this.refreshInterval = null,
  26587. this.processPriorityQueue = !1,
  26588. this.concurrentDownloads = e.concurrentDownloads || 1,
  26589. this.downloadTestResults = {}
  26590. }
  26591. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  26592. A("../settings")), r = (A("../objects/Panorama"),
  26593. A("../util/logger")), o = (A("../enum/Vectors"),
  26594. A("../enum/PanoSizeClass"),
  26595. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  26596. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  26597. Object.freeze({
  26598. Testing: 1,
  26599. Success: 2,
  26600. Fail: 3
  26601. }));
  26602. i.prototype = Object.create(l.prototype),
  26603. i.IDLE_REFRESH_DELAY = 500,
  26604. i.ACTIVE_REFRESH_DELAY = 16,
  26605. i.DOWNLOAD_RETRIES = 4,
  26606. i.prototype.init = function(e) {
  26607. this.qualityManager = e
  26608. }
  26609. ,
  26610. i.prototype.setUrls = function(e) {
  26611. this.urls = e
  26612. }
  26613. ,
  26614. i.prototype.setPanoData = function(e, t, i) {
  26615. this.panos = e,
  26616. this.imagePanos = t,
  26617. this.panoGroupId = i
  26618. }
  26619. ,
  26620. i.prototype.start = function() {
  26621. this.refreshUpdateInterval(0)
  26622. }
  26623. ,
  26624. i.prototype.stop = function() {
  26625. window.cancel(this.refreshInterval)
  26626. }
  26627. ,
  26628. i.prototype.refreshUpdateInterval = function(e) {
  26629. e = e || 0,
  26630. this.refreshInterval = window.setTimeout(function() {
  26631. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26632. }
  26633. .bind(this), e)
  26634. }
  26635. ,
  26636. i.prototype.update = function() {
  26637. var e = 0 < this.forceQueue.length;
  26638. return this.processQueueForDownloading(this.forceQueue),
  26639. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26640. 0 < this.priorityQueue.length && (e = !0),
  26641. this.processQueueForDownloading(this.priorityQueue)),
  26642. e
  26643. }
  26644. ,
  26645. i.prototype.forceQueueTilesForPano = (p = [],
  26646. f = [],
  26647. function(e, t, i, n, r, o) {
  26648. p.length = 0;
  26649. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26650. var l = a[s];
  26651. l.status !== v.None && l.status !== v.Queued || p.push(l)
  26652. }
  26653. if (i && 0 < p.length) {
  26654. g.sortPanoTiles(p, e, i),
  26655. f.length = 0,
  26656. m.matchingTilesInDirection(e, t, i, n, r, f);
  26657. for (var c = 0, h = function(e) {
  26658. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26659. }; c < p.length; ) {
  26660. var u = p[c];
  26661. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26662. }
  26663. }
  26664. for (var d = 0; d < p.length; d++)
  26665. this.forceQueue.push(p[d]);
  26666. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  26667. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  26668. o && this.processQueueForDownloading(this.forceQueue, !0)
  26669. }
  26670. ),
  26671. i.prototype.clearForceQueue = function() {
  26672. this.clearQueue(this.forceQueue)
  26673. }
  26674. ,
  26675. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  26676. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26677. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26678. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26679. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26680. }
  26681. ,
  26682. i.prototype.clearQueue = function(e) {
  26683. this.setStatusForAllDescriptors(e, v.None),
  26684. e.length = 0
  26685. }
  26686. ,
  26687. i.prototype.clearFromQueue = function(e, t, i) {
  26688. for (var n = 0; n < e.length; n++) {
  26689. var r = e[n];
  26690. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26691. }
  26692. }
  26693. ,
  26694. i.prototype.setStatusForAllDescriptors = function(e, t) {
  26695. for (var i = 0; i < e.length; i++) {
  26696. var n = e[i];
  26697. n && (n.status = t)
  26698. }
  26699. }
  26700. ,
  26701. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26702. for (var i = 0; i < e.length; i++) {
  26703. var n = e[i];
  26704. n && (n.status !== t ? n.status = t : e[i] = null)
  26705. }
  26706. }
  26707. ,
  26708. i.prototype.getTileDownloadDescriptors = function(e, t) {
  26709. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26710. , n = i[t];
  26711. return n || (n = this.buildDownloadDescriptorArray(t),
  26712. i[t] = n,
  26713. this.initTileDownloadDescriptors(n, e, t)),
  26714. n
  26715. }
  26716. ,
  26717. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26718. var t = this.downloadDescriptors[e.id];
  26719. return t || (t = {},
  26720. this.downloadDescriptors[e.id] = t),
  26721. t
  26722. }
  26723. ,
  26724. i.prototype.processQueueForDownloading = function(e, t) {
  26725. if (this.cleanupActiveDownloads(),
  26726. this.activeDownloads.length < this.concurrentDownloads || t)
  26727. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26728. var r = e.shift();
  26729. r && (this.startDownload(r),
  26730. n++)
  26731. }
  26732. }
  26733. ,
  26734. i.prototype.testDownload = function(t, e, i) {
  26735. var n = this.downloadTestResults[t];
  26736. if (n)
  26737. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  26738. else {
  26739. this.downloadTestResults[t] = y.Testing;
  26740. var r = this.panos.list[0]
  26741. , o = this.getTileUrl(r.id, t, e, 0)
  26742. , a = function(e) {
  26743. this.downloadTestResults[t] = y.Success,
  26744. i(!0)
  26745. }
  26746. .bind(this)
  26747. , s = function() {
  26748. this.downloadTestResults[t] = y.Fail,
  26749. i(!1)
  26750. }
  26751. .bind(this);
  26752. this.loadImage(o, 0, a, s)
  26753. }
  26754. }
  26755. ,
  26756. i.prototype.startDownload = function(e) {
  26757. e.status = v.Downloading;
  26758. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26759. this.activeDownloads.push(e),
  26760. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26761. }
  26762. ,
  26763. i.prototype.downloadFailed = function(e, t) {}
  26764. ,
  26765. i.prototype.downloadComplete = function(e, t) {
  26766. if (e.panoGroupId === this.panoGroupId) {
  26767. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26768. e.status = v.Downloaded,
  26769. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26770. var n = {
  26771. panoId: e.pano.id,
  26772. image: t,
  26773. tileSize: e.tileSize,
  26774. panoSize: e.panoSize,
  26775. tileIndex: e.tileIndex,
  26776. faceTileIndex: e.faceTileIndex,
  26777. totalTiles: e.totalTiles,
  26778. face: e.face,
  26779. tileX: e.tileX,
  26780. tileY: e.tileY,
  26781. direction: e.direction
  26782. };
  26783. e.image = t,
  26784. this.emit(o.TileDownloadSuccess, n),
  26785. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26786. panoId: e.pano.id,
  26787. tileSize: e.tileSize,
  26788. panoSize: e.panoSize
  26789. },
  26790. this.emit(o.PanoDownloadComplete, n),
  26791. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26792. }
  26793. }
  26794. ,
  26795. i.prototype.cleanupActiveDownloads = (n = [],
  26796. function() {
  26797. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26798. var t = this.activeDownloads[e];
  26799. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26800. }
  26801. this.activeDownloads.length = 0,
  26802. this.activeDownloads.push.apply(this.activeDownloads, n)
  26803. }
  26804. ),
  26805. i.prototype.isPanoDownloaded = function(e, t) {
  26806. var i = this.getTileDownloadDescriptors(e, t);
  26807. if (i.length <= 0)
  26808. return !1;
  26809. for (var n = 0; n < i.length; n++) {
  26810. if (i[n].status !== v.Downloaded)
  26811. return !1
  26812. }
  26813. return !0
  26814. }
  26815. ,
  26816. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26817. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26818. this.panoLoadCallbacks[o] = {
  26819. onLoad: i,
  26820. onFail: n,
  26821. onProgress: r
  26822. }
  26823. }
  26824. ,
  26825. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26826. var i = e.id + ":" + t;
  26827. return this.panoLoadCallbacks[i]
  26828. }
  26829. ,
  26830. i.prototype.buildDownloadDescriptorArray = function(e) {
  26831. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26832. var r = this.buildDownloadDescriptor();
  26833. i.push(r)
  26834. }
  26835. return i
  26836. }
  26837. ,
  26838. i.prototype.buildDownloadDescriptor = function() {
  26839. return {
  26840. panoGroupId: null,
  26841. pano: null,
  26842. panoSize: -1,
  26843. tileSize: -1,
  26844. tileIndex: -1,
  26845. totalTiles: -1,
  26846. faceTileIndex: -1,
  26847. status: v.None,
  26848. url: null,
  26849. image: null,
  26850. direction: new t.Vector3,
  26851. face: -1,
  26852. cubeFace: -1,
  26853. tileX: -1,
  26854. tileY: -1
  26855. }
  26856. }
  26857. ,
  26858. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26859. for (var n = 0; n < e.length; n++) {
  26860. var r = e[n];
  26861. this.initTileDownloadDescriptor(r, t, i, n)
  26862. }
  26863. }
  26864. ,
  26865. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26866. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26867. e.face = m.getFaceForTile(i, n),
  26868. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26869. e.panoGroupId = this.panoGroupId,
  26870. e.pano = t,
  26871. e.panoSize = i,
  26872. e.tileSize = r,
  26873. e.tileIndex = n,
  26874. e.totalTiles = m.getTileCountForSize(i),
  26875. e.status = v.None,
  26876. e.image = null,
  26877. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26878. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26879. }
  26880. ,
  26881. i.prototype.getTileUrl = (c = {
  26882. 256: "256",
  26883. 512: "512",
  26884. 1024: "1k",
  26885. 2048: "2k",
  26886. 4096: "4k"
  26887. },
  26888. h = {
  26889. face: -1,
  26890. faceTileIndex: -1,
  26891. tileX: -1,
  26892. tileY: -1
  26893. },
  26894. function(e, t, i, n) {
  26895. m.getTileLocation(t, n, h);
  26896. var r = Math.floor(t / i)
  26897. , o = r * r
  26898. , a = Math.floor(n / o)
  26899. , s = "";
  26900. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26901. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26902. return d.changeIfTileGenerating(l)
  26903. }
  26904. ),
  26905. i.prototype.loadImage = function(e, t, i, n) {
  26906. s.getImage(e, t).then(function(e) {
  26907. i(e)
  26908. }).fail(n)
  26909. }
  26910. ,
  26911. C.exports = i
  26912. }
  26913. ).call(this, "/js/tile/TileDownloader.js")
  26914. }
  26915. , {
  26916. "../ab": 3,
  26917. "../enum/DownloadStatus": 24,
  26918. "../enum/GLCubeFaces": 25,
  26919. "../enum/PanoSizeClass": 36,
  26920. "../enum/TileDownloaderEvents": 45,
  26921. "../enum/Vectors": 50,
  26922. "../enum/Viewmode": 51,
  26923. "../objects/Panorama": 148,
  26924. "../settings": 166,
  26925. "../util/ajax": 181,
  26926. "../util/logger": 189,
  26927. "../util/panorama": 191,
  26928. "./TilePrioritizer": 172,
  26929. "./TileUtils": 174,
  26930. events: 202,
  26931. three: 217
  26932. }],
  26933. 172: [function(n, C, e) {
  26934. (function(e) {
  26935. "use strict";
  26936. function h(e, t, i, n, r) {
  26937. this.qualityManager = e,
  26938. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26939. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26940. this.baseSize = t,
  26941. this.standardSize = i,
  26942. this.highSize = n,
  26943. this.ultraHighSize = r,
  26944. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26945. }
  26946. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26947. n("../settings"),
  26948. n("../settings"),
  26949. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  26950. n("../enum/PanoSizeClass"),
  26951. n("../enum/ModelManagerEvents"),
  26952. n("../enum/GLCubeFaces"),
  26953. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  26954. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  26955. new t(e),
  26956. Object.freeze({
  26957. None: 0,
  26958. DirectionalFOV: 1
  26959. }));
  26960. h.PriorityCriteria = function(e, t, i, n, r) {
  26961. this.pano = e,
  26962. this.cameraPosition = (new o.Vector3).copy(t),
  26963. this.cameraDir = (new o.Vector3).copy(i),
  26964. this.panoSpaceDir = (new o.Vector3).copy(n),
  26965. this.upcomingPanos = r,
  26966. this.copy = function(e) {
  26967. this.pano = e.pano,
  26968. this.cameraPosition.copy(e.cameraPosition),
  26969. this.cameraDir.copy(e.cameraDir),
  26970. this.panoSpaceDir.copy(e.panoSpaceDir),
  26971. this.upcomingPanos = r
  26972. }
  26973. ,
  26974. this.zoomingActive = !1
  26975. }
  26976. ,
  26977. h.DIRECTIONAL_FOV = 180,
  26978. h.DIRECTIONAL_FOV_NARROW = 120,
  26979. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26980. h.MAX_SCORED_PANOS_TOADD = 2,
  26981. h.MAX_UPCOMING_PANOS_TOADD = 3,
  26982. h.DIRECTION_SCORE_STRICTNESS = .75,
  26983. h.appendQueue = function(e, t) {
  26984. if (e && t)
  26985. for (var i = 0; i < t.length; i++)
  26986. e.push(t[i])
  26987. }
  26988. ,
  26989. h.prototype.updateCriteria = function(e, t, i, n) {
  26990. this.priorityCriteria.pano = e,
  26991. this.priorityCriteria.cameraPosition.copy(t),
  26992. this.priorityCriteria.cameraDir.copy(i),
  26993. this.priorityCriteria.upcomingPanos = n,
  26994. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26995. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26996. }
  26997. ,
  26998. h.prototype.filterAndPrioritize = (u = [],
  26999. p = [],
  27000. f = [],
  27001. function(e, t, i) {
  27002. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  27003. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  27004. var n = this.baseSize
  27005. , r = this.standardSize
  27006. , o = this.highSize
  27007. , a = this.ultraHighSize;
  27008. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  27009. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  27010. f.length = 0,
  27011. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  27012. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27013. h.appendQueue(e, f),
  27014. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  27015. f.length = 0,
  27016. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  27017. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  27018. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27019. h.appendQueue(e, f),
  27020. f.length = 0,
  27021. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  27022. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  27023. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  27024. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27025. h.appendQueue(e, f),
  27026. this.queueTilesForPanos(e, u, i, n)
  27027. }
  27028. ),
  27029. h.prototype.canDownloadSize = function(e) {
  27030. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  27031. }
  27032. ,
  27033. h.prototype.populateNeighborPanos = function(e, t, i) {
  27034. (i = i || []).length = 0;
  27035. var n = t.getNeighbours(e);
  27036. for (var r in n)
  27037. if (n.hasOwnProperty(r)) {
  27038. var o = t.get(r);
  27039. i.push(o)
  27040. }
  27041. return i
  27042. }
  27043. ,
  27044. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  27045. (i = i || []).length = 0;
  27046. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  27047. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  27048. , s = t.sortByScore(o, a);
  27049. if (s)
  27050. for (var l = 0; l < s.length && l < r; l++) {
  27051. var c = s[l].pano;
  27052. i.push(c)
  27053. }
  27054. return i
  27055. }
  27056. ,
  27057. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  27058. for (var o = 0, a = 0; a < t.length; a++) {
  27059. var s = t[a];
  27060. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  27061. r && r <= o)
  27062. break
  27063. }
  27064. return o
  27065. }
  27066. ,
  27067. h.prototype.queueTilesForPano = (r = {
  27068. filter: a.None
  27069. },
  27070. function(e, t, i, n) {
  27071. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  27072. }
  27073. ),
  27074. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  27075. function(e, t, i, n, r, o, a, s) {
  27076. for (var l = 0, c = 0; c < i.length; c++) {
  27077. var h = i[c];
  27078. d.copy(h.position),
  27079. d.sub(r),
  27080. d.normalize();
  27081. var u = Math.max(Math.min(o.dot(d), 1), -1);
  27082. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  27083. s && s <= l))
  27084. break
  27085. }
  27086. return l
  27087. }
  27088. ),
  27089. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  27090. for (var l = 0, c = 0; c < i.length; c++) {
  27091. var h = i[c];
  27092. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  27093. s && s <= l)
  27094. break
  27095. }
  27096. return l
  27097. }
  27098. ,
  27099. h.prototype.queueTilesInDirectionForPano = (s = {
  27100. filter: a.DirectionalFOV,
  27101. direction: new o.Vector3,
  27102. fov: 60
  27103. },
  27104. l = new o.Vector3,
  27105. function(e, t, i, n, r, o, a) {
  27106. return l.copy(o),
  27107. m.getRelativeDirection(i.quaternion, l),
  27108. s.direction.copy(l),
  27109. s.fov = a,
  27110. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  27111. }
  27112. ),
  27113. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  27114. function(e, t, i, n, r) {
  27115. var o = t.getTileDownloadDescriptors(i, n);
  27116. c.length = 0,
  27117. this.filterTileDownloadDescriptors(i, o, c, r);
  27118. for (var a = 0, s = 0; s < c.length; s++) {
  27119. var l = c[s];
  27120. l && (e.push(l),
  27121. a++)
  27122. }
  27123. return a
  27124. }
  27125. ),
  27126. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  27127. function(e, t, i, n) {
  27128. var r, o;
  27129. switch (n.filter) {
  27130. case a.DirectionalFOV:
  27131. for (r = 0; r < t.length; r++)
  27132. o = t[r],
  27133. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  27134. break;
  27135. default:
  27136. for (r = 0; r < t.length; r++)
  27137. o = t[r],
  27138. i.push(o)
  27139. }
  27140. for (r = 0; r < i.length; r++)
  27141. o = i[r],
  27142. this.canIncludeDescriptor(o) || (i[r] = null)
  27143. }
  27144. ),
  27145. h.prototype.canIncludeDescriptor = function(e) {
  27146. return e.status !== i.Downloading && e.status !== i.Downloaded
  27147. }
  27148. ,
  27149. h.prototype.canIncludePano = function(e, t) {
  27150. return !e.isLoaded(t)
  27151. }
  27152. ,
  27153. h.getFOVDotThreshold = function(e) {
  27154. return Math.cos(o.Math.degToRad(e / 2))
  27155. }
  27156. ;
  27157. var y = (A._panoSpaceDir = new o.Vector3,
  27158. A._fovThreshold = -1,
  27159. A._fovThresholdNarrow = -1,
  27160. A);
  27161. function A(e, t) {
  27162. var i = A._panoSpaceDir
  27163. , n = A._fovThreshold
  27164. , r = A._fovThresholdNarrow
  27165. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  27166. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  27167. return e._dot = o,
  27168. t._dot = a,
  27169. n <= o && a < n ? -1 : o < n && n <= a ? 1 : r <= o && a < r ? -1 : o < r && r <= a ? 1 : e.panoSize > t.panoSize ? 1 : t.panoSize > e.panoSize ? -1 : -(o - a)
  27170. }
  27171. h.sortPanoTiles = function(e, t, i) {
  27172. y._panoSpaceDir.copy(i),
  27173. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  27174. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  27175. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  27176. e.sort(y)
  27177. }
  27178. ,
  27179. h.insertSortedPanoTile = function(e, t, i, n) {
  27180. y._panoSpaceDir.copy(n),
  27181. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  27182. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  27183. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  27184. for (var r = -1, o = 0; o < e.length; o++) {
  27185. if (y(t, e[o]) <= 0) {
  27186. r = o;
  27187. break
  27188. }
  27189. }
  27190. if (-1 === r)
  27191. e[e.length] = t;
  27192. else {
  27193. for (var a = e.length; r < a; a--)
  27194. e[a] = e[a - 1];
  27195. e[r] = t
  27196. }
  27197. }
  27198. ,
  27199. h.prototype.setZoomingActive = function(e) {
  27200. e !== this.zoomingActive && (this.zoomingActive = e)
  27201. }
  27202. ,
  27203. C.exports = h
  27204. }
  27205. ).call(this, "/js/tile/TilePrioritizer.js")
  27206. }
  27207. , {
  27208. "../enum/DownloadStatus": 24,
  27209. "../enum/GLCubeFaces": 25,
  27210. "../enum/ModelManagerEvents": 33,
  27211. "../enum/PanoSizeClass": 36,
  27212. "../enum/Vectors": 50,
  27213. "../enum/Viewmode": 51,
  27214. "../objects/Panorama": 148,
  27215. "../settings": 166,
  27216. "../util/browser": 182,
  27217. "../util/logger": 189,
  27218. "../util/math": 190,
  27219. "./TileUtils": 174,
  27220. events: 202,
  27221. three: 217
  27222. }],
  27223. 173: [function(e, t, i) {
  27224. "use strict";
  27225. function f(e, t) {
  27226. this.levels = t,
  27227. this.tileSize = e,
  27228. this.root = null,
  27229. this.allNodes = [],
  27230. function(e) {
  27231. e.root = function e(t, i, n) {
  27232. if (n > t.levels)
  27233. return null;
  27234. var r = new a(t,i);
  27235. t.allNodes.push(r);
  27236. for (var o = 0; o < s; o++)
  27237. r.children[o] = e(t, r, n + 1);
  27238. return r
  27239. }(e, null, 0)
  27240. }(this)
  27241. }
  27242. function a(e, t) {
  27243. this.tree = e,
  27244. this.parent = t,
  27245. this.children = [],
  27246. this.id = ++n
  27247. }
  27248. var g = (e("three"),
  27249. e("./TileUtils"),
  27250. e("../objects/Panorama"),
  27251. e("../util/panorama"),
  27252. e("events").EventEmitter,
  27253. 2)
  27254. , s = g * g;
  27255. f.TraversalType = Object.freeze({
  27256. PreOrder: 0,
  27257. PostOrder: 1
  27258. });
  27259. var n = 0;
  27260. f.getLevelCountForSize = function(e, t) {
  27261. var i = 0;
  27262. for (t < e && (t = e); !((t /= g) < e); )
  27263. i++;
  27264. return i
  27265. }
  27266. ,
  27267. f.getSizeForLevel = function(e, t) {
  27268. return Math.pow(g, t) * e
  27269. }
  27270. ,
  27271. f.prototype.getSubNode = function(e, t, i) {
  27272. (!t || e < this.tileSize) && (t = 0),
  27273. (!i || e < this.tileSize) && (i = 0),
  27274. e < this.tileSize && (e = this.tileSize);
  27275. var n = f.getLevelCountForSize(this.tileSize, e);
  27276. return function e(t, i, n, r, o) {
  27277. if (!t)
  27278. return null;
  27279. if (0 === n)
  27280. return t;
  27281. if (!t.children || 0 === t.children.length)
  27282. return null;
  27283. var a = Math.pow(g, n) / g
  27284. , s = r % a
  27285. , l = o % a
  27286. , c = Math.floor(o / a)
  27287. , h = Math.floor(r / a)
  27288. , u = c * g + h;
  27289. return e(t.children[u], i + 1, n - 1, s, l)
  27290. }(this.root, 0, n, t, i)
  27291. }
  27292. ,
  27293. f.prototype.breadthFirst = function(e) {
  27294. var t = !!(e = e || {}).nullLevelEnd
  27295. , i = e.maxLevel
  27296. , n = e.minLevel
  27297. , r = e.callback
  27298. , o = e.saveVisited
  27299. , a = []
  27300. , s = {}
  27301. , l = 0;
  27302. for (a.push(this.root),
  27303. a.push(s); 0 < a.length && !(i && i < l); ) {
  27304. var c = a.shift();
  27305. if (c === s)
  27306. (!n || n <= l) && (r && t && r(null),
  27307. o && t && o.push(null)),
  27308. 0 < a.length && a.push(s),
  27309. l++,
  27310. 0;
  27311. else {
  27312. if (c.children)
  27313. for (var h = 0; h < c.children.length; h++) {
  27314. c.children[h] && a.push(c.children[h])
  27315. }
  27316. var u = this.getFaceIndexFromNode(c);
  27317. (!n || n <= l) && (r && r(c, l, u),
  27318. o && o.push(c)),
  27319. 0
  27320. }
  27321. }
  27322. }
  27323. ,
  27324. f.prototype.getFaceIndexFromNode = function(e) {
  27325. if (!e)
  27326. return -1;
  27327. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  27328. var o = i.parent;
  27329. if (!o)
  27330. break;
  27331. for (var a = -1, s = 0; s < o.children.length; s++)
  27332. o.children[s] === i && (a = s);
  27333. n = a % g * t + n,
  27334. r = Math.floor(a / g) * t + r,
  27335. t *= g,
  27336. i = o
  27337. }
  27338. return r * t + n
  27339. }
  27340. ,
  27341. f.prototype.depthFirst = function(e, t, i) {
  27342. !function e(t, i, n, r, o, a, s, l) {
  27343. if (t) {
  27344. s = s || f.TraversalType.PreOrder;
  27345. var c = r * g + n;
  27346. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  27347. a && a.push(t)),
  27348. t.children && 0 !== t.children.length) {
  27349. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  27350. for (var p = 0; p < g; p++)
  27351. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  27352. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  27353. a && a.push(t))
  27354. }
  27355. }
  27356. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  27357. }
  27358. ,
  27359. t.exports = f
  27360. }
  27361. , {
  27362. "../objects/Panorama": 148,
  27363. "../util/panorama": 191,
  27364. "./TileUtils": 174,
  27365. events: 202,
  27366. three: 217
  27367. }],
  27368. 174: [function(e, t, i) {
  27369. "use strict";
  27370. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  27371. b.TILE_SIZE = 512,
  27372. b.FACES_PER_PANO = 6,
  27373. b.LocationOnTile = {
  27374. Center: 0,
  27375. UpperLeft: 1,
  27376. UpperRight: 2,
  27377. LowerRight: 3,
  27378. LowerLeft: 4
  27379. },
  27380. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  27381. var l = e / t
  27382. , c = t / e * 2
  27383. , h = c / 2
  27384. , u = n / l * 2 - 1 + h
  27385. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  27386. switch (o = o || b.LocationOnTile.Center) {
  27387. case b.LocationOnTile.UpperLeft:
  27388. u -= h,
  27389. d += h,
  27390. u += a * c;
  27391. break;
  27392. case b.LocationOnTile.UpperRight:
  27393. u += h,
  27394. d += h,
  27395. d -= a * c;
  27396. break;
  27397. case b.LocationOnTile.LowerRight:
  27398. u += h,
  27399. d -= h,
  27400. u -= a * c;
  27401. break;
  27402. case b.LocationOnTile.LowerLeft:
  27403. u -= h,
  27404. d -= h,
  27405. d += a * c;
  27406. break;
  27407. case b.LocationOnTile.Center:
  27408. }
  27409. switch (i) {
  27410. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  27411. _.setVector(s, -1, d, -u);
  27412. break;
  27413. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  27414. _.setVector(s, 1, d, u);
  27415. break;
  27416. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  27417. _.setVector(s, -u, 1, -d);
  27418. break;
  27419. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27420. _.setVector(s, -u, -1, d);
  27421. break;
  27422. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  27423. _.setVector(s, -u, d, 1);
  27424. break;
  27425. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27426. _.setVector(s, u, d, -1)
  27427. }
  27428. _.normalize(s)
  27429. }
  27430. ,
  27431. b.getFaceForTile = function(e, t) {
  27432. var i = b.TILE_SIZE;
  27433. e < b.TILE_SIZE && (i = e);
  27434. var n = Math.floor(e / i)
  27435. , r = n * n;
  27436. return Math.floor(t / r)
  27437. }
  27438. ,
  27439. b.getTileLocation = function(e, t, i) {
  27440. var n = b.TILE_SIZE;
  27441. e < b.TILE_SIZE && (n = e);
  27442. var r = b.getFaceForTile(e, t)
  27443. , o = Math.floor(e / n)
  27444. , a = t - r * (o * o);
  27445. i.tileX = a % o,
  27446. i.tileY = Math.floor(a / o),
  27447. i.face = r,
  27448. i.faceTileIndex = a
  27449. }
  27450. ,
  27451. b.getTileCountForSize = function(e) {
  27452. if (e <= b.TILE_SIZE)
  27453. return b.FACES_PER_PANO;
  27454. var t = Math.floor(e / b.TILE_SIZE);
  27455. return t * t * b.FACES_PER_PANO
  27456. }
  27457. ,
  27458. b.getRelativeDirection = (r = new _.Matrix4,
  27459. o = new _.Quaternion,
  27460. function(e, t) {
  27461. o.copy(e),
  27462. o.inverse(),
  27463. r.makeRotationFromQuaternion(o),
  27464. r.applyToVector3(t),
  27465. _.normalize(t)
  27466. }
  27467. ),
  27468. b.matchingTilesInDirection = (c = new _.Vector3,
  27469. h = new _.Vector3(0,0,-1),
  27470. u = new _.Quaternion,
  27471. l = {
  27472. face: -1,
  27473. faceTileIndex: -1,
  27474. tileX: -1,
  27475. tileY: -1
  27476. },
  27477. d = function(e, t, i) {
  27478. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  27479. b.getTileLocation(e, o, l),
  27480. t && !t(l) || (r++,
  27481. i && (a = l,
  27482. i.push({
  27483. face: a.face,
  27484. faceTileIndex: a.faceTileIndex,
  27485. tileX: a.tileX,
  27486. tileY: a.tileY
  27487. })));
  27488. var a;
  27489. return r
  27490. }
  27491. ,
  27492. function(e, t, i, n, r, o) {
  27493. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  27494. if (b.getTileCountForSize(t),
  27495. !n && !r)
  27496. return d(t, null, o);
  27497. var s = !!r;
  27498. return r = r || n,
  27499. r = Math.max(0, Math.min(r, 360)),
  27500. n = Math.max(0, Math.min(n, 360)),
  27501. _.copyVector(i, c),
  27502. b.getRelativeDirection(e.quaternion, c),
  27503. s ? (u.setFromUnitVectors(c, h),
  27504. d(t, function(e) {
  27505. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  27506. }, o)) : d(t, function(e) {
  27507. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  27508. }, o)
  27509. }
  27510. ),
  27511. b.isTileWithinFrustum = (E = new _.Vector3,
  27512. function(e, t, i, n, r, o, a, s) {
  27513. for (var l = Math.tan(.5 * s * _.RADIANS_PER_DEGREE), c = -l, h = Math.tan(.5 * a * _.RADIANS_PER_DEGREE), u = -h, d = b.mapFaceToCubemapFace(i), p = 0, f = 0, g = 0, m = 0, v = 0, y = b.LocationOnTile.Center; y <= b.LocationOnTile.LowerLeft; y++)
  27514. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  27515. _.applyQuaternionToVector(o, E),
  27516. -1e-5 <= E.z)
  27517. ;
  27518. else {
  27519. var A = -1 / E.z
  27520. , C = E.x * A
  27521. , I = E.y * A;
  27522. l < I ? p++ : I < c && f++,
  27523. h < C ? g++ : C < u && m++,
  27524. v++
  27525. }
  27526. return f !== v && p !== v && g !== v && m !== v
  27527. }
  27528. ),
  27529. b.isTileWithinFOV = (p = new _.Vector3,
  27530. f = new _.Vector3(0,1,0),
  27531. g = new _.Vector3(1,0,0),
  27532. function(e, t, i, n, r, o, a) {
  27533. var s = b.mapFaceToCubemapFace(i);
  27534. if (_.cross(o, f, g),
  27535. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  27536. b.isWithinFOV(p, o, a, null))
  27537. return !0;
  27538. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  27539. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  27540. if (b.getTileVector(e, t, s, n, r, d, h, p),
  27541. b.isWithinFOV(p, o, a, null))
  27542. return !0;
  27543. h += l
  27544. }
  27545. return !1
  27546. }
  27547. ),
  27548. b.isWithinFOV = (a = new _.Vector3,
  27549. s = new _.Vector3,
  27550. function(e, t, i, n) {
  27551. if (_.copyVector(e, s),
  27552. n) {
  27553. _.copyVector(n, a),
  27554. _.normalize(a);
  27555. var r = _.dot(a, e);
  27556. a.x *= r,
  27557. a.y *= r,
  27558. a.z *= r,
  27559. _.subVector(s, a)
  27560. }
  27561. var o = i / 2 * _.RADIANS_PER_DEGREE;
  27562. return Math.cos(o) <= _.dot(s, t)
  27563. }
  27564. ),
  27565. b.mapFaceToCubemapFace = (n = {
  27566. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27567. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27568. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27569. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27570. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27571. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27572. },
  27573. function(e) {
  27574. return n[e]
  27575. }
  27576. ),
  27577. t.exports = b
  27578. }
  27579. , {
  27580. "../enum/GLCubeFaces": 25,
  27581. "../util/MathLight": 176
  27582. }],
  27583. 175: [function(i, n, e) {
  27584. (function(e) {
  27585. "use strict";
  27586. function t() {
  27587. this.list = [],
  27588. this.index = {},
  27589. Object.defineProperty(this, "length", {
  27590. get: function() {
  27591. return this.list.length
  27592. }
  27593. })
  27594. }
  27595. new (i("./common"),
  27596. i("./logger"))(e),
  27597. t.prototype.forEach = function(e) {
  27598. this.list.forEach(e)
  27599. }
  27600. ,
  27601. t.prototype.add = function(e) {
  27602. this.list.push(e),
  27603. this.index[this.getIndex(e)] = e
  27604. }
  27605. ,
  27606. t.prototype.getIndex = function(e) {
  27607. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27608. }
  27609. ,
  27610. t.prototype.extend = function(e) {
  27611. for (var t = 0; t < e.length; t++)
  27612. this.add(e[t])
  27613. }
  27614. ,
  27615. t.prototype.get = function(e) {
  27616. return this.index[e]
  27617. }
  27618. ,
  27619. t.prototype.first = function() {
  27620. return this.list[0]
  27621. }
  27622. ,
  27623. t.prototype.last = function() {
  27624. return this.list[this.list.length - 1]
  27625. }
  27626. ,
  27627. t.prototype.reIndex = function() {
  27628. this.index = {};
  27629. var t = this;
  27630. this.forEach(function(e) {
  27631. t.index[t.getIndex(e)] = e
  27632. })
  27633. }
  27634. ,
  27635. t.prototype.filter = function(e) {
  27636. var t = this.list.filter(e);
  27637. return this.reIndex(),
  27638. t
  27639. }
  27640. ,
  27641. t.prototype.reduce = function(e, t) {
  27642. return this.list.reduce(e, t)
  27643. }
  27644. ,
  27645. t.prototype.sort = function(e) {
  27646. return this.list.sort(e)
  27647. }
  27648. ,
  27649. t.prototype.indexOf = function(e) {
  27650. for (var t = 0; t < this.list.length; ++t)
  27651. if (this.list[t] === e)
  27652. return t;
  27653. return -1
  27654. }
  27655. ,
  27656. n.exports = t
  27657. }
  27658. ).call(this, "/js/util/IndexedCollection.js")
  27659. }
  27660. , {
  27661. "./common": 185,
  27662. "./logger": 189
  27663. }],
  27664. 176: [function(e, t, i) {
  27665. "use strict";
  27666. e("../constants");
  27667. var n, r, o = {};
  27668. o.RADIANS_PER_DEGREE = Math.PI / 180,
  27669. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  27670. o.Vector3 = function(e, t, i) {
  27671. this.x = e || 0,
  27672. this.y = t || 0,
  27673. this.z = i || 0
  27674. }
  27675. ,
  27676. o.Matrix4 = function() {
  27677. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27678. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27679. }
  27680. ,
  27681. o.Matrix4.prototype = {
  27682. identity: function() {
  27683. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27684. this
  27685. },
  27686. copy: function(e) {
  27687. return this.elements.set(e.elements),
  27688. this
  27689. },
  27690. applyToVector3: function(e) {
  27691. var t = e.x
  27692. , i = e.y
  27693. , n = e.z
  27694. , r = this.elements;
  27695. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27696. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27697. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27698. this
  27699. },
  27700. getInverse: function(e, t) {
  27701. var i = this.elements
  27702. , n = e.elements
  27703. , r = n[0]
  27704. , o = n[1]
  27705. , a = n[2]
  27706. , s = n[3]
  27707. , l = n[4]
  27708. , c = n[5]
  27709. , h = n[6]
  27710. , u = n[7]
  27711. , d = n[8]
  27712. , p = n[9]
  27713. , f = n[10]
  27714. , g = n[11]
  27715. , m = n[12]
  27716. , v = n[13]
  27717. , y = n[14]
  27718. , A = n[15]
  27719. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  27720. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  27721. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  27722. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  27723. , b = r * C + o * I + a * E + s * _;
  27724. if (0 == b) {
  27725. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27726. if (t)
  27727. throw new Error(w);
  27728. return console.warn(w),
  27729. this.identity()
  27730. }
  27731. var T = 1 / b;
  27732. return i[0] = C * T,
  27733. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  27734. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  27735. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27736. i[4] = I * T,
  27737. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  27738. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  27739. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27740. i[8] = E * T,
  27741. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27742. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27743. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27744. i[12] = _ * T,
  27745. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27746. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27747. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27748. this
  27749. },
  27750. makeRotationFromQuaternion: function(e) {
  27751. var t = this.elements
  27752. , i = e.x
  27753. , n = e.y
  27754. , r = e.z
  27755. , o = e.w
  27756. , a = i + i
  27757. , s = n + n
  27758. , l = r + r
  27759. , c = i * a
  27760. , h = i * s
  27761. , u = i * l
  27762. , d = n * s
  27763. , p = n * l
  27764. , f = r * l
  27765. , g = o * a
  27766. , m = o * s
  27767. , v = o * l;
  27768. return t[0] = 1 - (d + f),
  27769. t[4] = h - v,
  27770. t[8] = u + m,
  27771. t[1] = h + v,
  27772. t[5] = 1 - (c + f),
  27773. t[9] = p - g,
  27774. t[2] = u - m,
  27775. t[6] = p + g,
  27776. t[10] = 1 - (c + d),
  27777. t[3] = 0,
  27778. t[7] = 0,
  27779. t[11] = 0,
  27780. t[12] = 0,
  27781. t[13] = 0,
  27782. t[14] = 0,
  27783. t[15] = 1,
  27784. this
  27785. }
  27786. },
  27787. o.Quaternion = function(e, t, i, n) {
  27788. this._x = e || 0,
  27789. this._y = t || 0,
  27790. this._z = i || 0,
  27791. this._w = void 0 !== n ? n : 1
  27792. }
  27793. ,
  27794. o.Quaternion.prototype = {
  27795. get x() {
  27796. return this._x
  27797. },
  27798. set x(e) {
  27799. this._x = e
  27800. },
  27801. get y() {
  27802. return this._y
  27803. },
  27804. set y(e) {
  27805. this._y = e
  27806. },
  27807. get z() {
  27808. return this._z
  27809. },
  27810. set z(e) {
  27811. this._z = e
  27812. },
  27813. get w() {
  27814. return this._w
  27815. },
  27816. set w(e) {
  27817. this._w = e
  27818. },
  27819. copy: function(e) {
  27820. this._x = e.x,
  27821. this._y = e.y,
  27822. this._z = e.z,
  27823. this._w = e.w
  27824. },
  27825. inverse: function() {
  27826. return this.conjugate().normalize()
  27827. },
  27828. conjugate: function() {
  27829. return this._x *= -1,
  27830. this._y *= -1,
  27831. this._z *= -1,
  27832. this
  27833. },
  27834. length: function() {
  27835. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27836. },
  27837. normalize: function() {
  27838. var e = this.length();
  27839. return 0 === e ? (this._x = 0,
  27840. this._y = 0,
  27841. this._z = 0,
  27842. this._w = 1) : (e = 1 / e,
  27843. this._x = this._x * e,
  27844. this._y = this._y * e,
  27845. this._z = this._z * e,
  27846. this._w = this._w * e),
  27847. this
  27848. },
  27849. setFromAxisAngle: function(e, t) {
  27850. var i = t / 2
  27851. , n = Math.sin(i);
  27852. return this._x = e.x * n,
  27853. this._y = e.y * n,
  27854. this._z = e.z * n,
  27855. this._w = Math.cos(i),
  27856. this
  27857. },
  27858. setFromUnitVectors: function(e, t) {
  27859. return void 0 === n && (n = new o.Vector3),
  27860. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27861. Math.abs(e.x) > Math.abs(e.z) ? o.setVector(n, -e.y, e.x, 0) : o.setVector(n, 0, -e.z, e.y)) : o.cross(e, t, n),
  27862. this._x = n.x,
  27863. this._y = n.y,
  27864. this._z = n.z,
  27865. this._w = r,
  27866. this.normalize()
  27867. },
  27868. multiply: function(e) {
  27869. return this.multiplyQuaternions(this, e)
  27870. },
  27871. premultiply: function(e) {
  27872. return this.multiplyQuaternions(e, this)
  27873. },
  27874. multiplyQuaternions: function(e, t) {
  27875. var i = e._x
  27876. , n = e._y
  27877. , r = e._z
  27878. , o = e._w
  27879. , a = t._x
  27880. , s = t._y
  27881. , l = t._z
  27882. , c = t._w;
  27883. return this._x = i * c + o * a + n * l - r * s,
  27884. this._y = n * c + o * s + r * a - i * l,
  27885. this._z = r * c + o * l + i * s - n * a,
  27886. this._w = o * c - i * a - n * s - r * l,
  27887. this
  27888. }
  27889. },
  27890. o.convertWorkshopVector = function(e) {
  27891. return new o.Vector3(-e.x,e.y,e.z)
  27892. }
  27893. ,
  27894. o.convertWorkshopQuaternion = function(e) {
  27895. return new o.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new o.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  27896. }
  27897. ,
  27898. o.convertWorkshopOrthoZoom = function(e) {
  27899. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27900. }
  27901. ,
  27902. o.convertWorkshopPanoramaQuaternion = function(e) {
  27903. return new o.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), 270 * o.RADIANS_PER_DEGREE))
  27904. }
  27905. ,
  27906. o.normalize = function(e) {
  27907. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27908. , i = Math.sqrt(t);
  27909. e.x /= i,
  27910. e.y /= i,
  27911. e.z /= i
  27912. }
  27913. ,
  27914. o.dot = function(e, t) {
  27915. return e.x * t.x + e.y * t.y + e.z * t.z
  27916. }
  27917. ,
  27918. o.cross = function(e, t, i) {
  27919. var n = e.x
  27920. , r = e.y
  27921. , o = e.z;
  27922. i.x = r * t.z - o * t.y,
  27923. i.y = o * t.x - n * t.z,
  27924. i.z = n * t.y - r * t.x
  27925. }
  27926. ,
  27927. o.setVector = function(e, t, i, n) {
  27928. e.x = t,
  27929. e.y = i,
  27930. e.z = n
  27931. }
  27932. ,
  27933. o.copyVector = function(e, t) {
  27934. t.x = e.x,
  27935. t.y = e.y,
  27936. t.z = e.z
  27937. }
  27938. ,
  27939. o.addVector = function(e, t) {
  27940. e.x += t.x,
  27941. e.y += t.y,
  27942. e.z += t.z
  27943. }
  27944. ,
  27945. o.subVector = function(e, t) {
  27946. e.x -= t.x,
  27947. e.y -= t.y,
  27948. e.z -= t.z
  27949. }
  27950. ,
  27951. o.applyQuaternionToVector = function(e, t) {
  27952. var i = t.x
  27953. , n = t.y
  27954. , r = t.z
  27955. , o = e.x
  27956. , a = e.y
  27957. , s = e.z
  27958. , l = e.w
  27959. , c = l * i + a * r - s * n
  27960. , h = l * n + s * i - o * r
  27961. , u = l * r + o * n - a * i
  27962. , d = -o * i - a * n - s * r;
  27963. t.x = c * l + d * -o + h * -s - u * -a,
  27964. t.y = h * l + d * -a + u * -o - c * -s,
  27965. t.z = u * l + d * -s + c * -a - h * -o
  27966. }
  27967. ,
  27968. o.angleBetweenVectors = function(e, t) {
  27969. return Math.acos(o.dot(e, t))
  27970. }
  27971. ,
  27972. t.exports = o
  27973. }
  27974. , {
  27975. "../constants": 8
  27976. }],
  27977. 177: [function(c, h, e) {
  27978. (function(e) {
  27979. "use strict";
  27980. function t(e) {
  27981. this.cache = null,
  27982. this.expires = 0
  27983. }
  27984. function i() {
  27985. this.baseUrl = null,
  27986. this.cache = null,
  27987. this.expires = 0
  27988. }
  27989. function n() {
  27990. this.baseUrl = null,
  27991. this.expires = 0
  27992. }
  27993. function r(e) {
  27994. this.initialLoadingPromise = null,
  27995. this.endpoint = e + "?type=3",
  27996. this.urlContainer = null,
  27997. this.authorizationHeader = s.getAuthorizationHeader(),
  27998. this.containerClasses = [n, i, t]
  27999. }
  28000. c("./ajax");
  28001. var o = c("./logger")
  28002. , a = c("../constants")
  28003. , s = c("./showcase")
  28004. , l = (c("../ab"),
  28005. new o(e));
  28006. t.prototype = {
  28007. version: 1,
  28008. validate: function(e) {
  28009. return "catalog.json"in e && 0 < Object.keys(e).length
  28010. },
  28011. update: function(e) {
  28012. return this.cache = e,
  28013. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  28014. $.when()
  28015. },
  28016. get: function(e) {
  28017. return this.cache[e]
  28018. }
  28019. },
  28020. i.prototype = {
  28021. version: 2,
  28022. validate: function(e) {
  28023. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  28024. },
  28025. update: function(e) {
  28026. return this.baseUrl = e["base.url"],
  28027. this.cache = e,
  28028. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  28029. $.when()
  28030. },
  28031. get: function(e) {
  28032. var t = this.cache[e];
  28033. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  28034. }
  28035. },
  28036. n.prototype = {
  28037. version: 3,
  28038. validate: function(e) {
  28039. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  28040. },
  28041. update: function(e) {
  28042. return this.baseUrl = e.templates[0],
  28043. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  28044. $.when()
  28045. },
  28046. get: function(e) {
  28047. return this.baseUrl.replace("{{filename}}", e)
  28048. }
  28049. },
  28050. r.prototype = {
  28051. init: function() {
  28052. return this.initialLoadingPromise || (setInterval(function() {
  28053. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  28054. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  28055. this.refresh().done(function() {
  28056. l.debug("Refreshed")
  28057. }).fail(function() {
  28058. l.error("Failed url refresh, urls might go stale soon")
  28059. }))
  28060. }
  28061. .bind(this), a.signedUrlCheckInterval),
  28062. this.initialLoadingPromise = this.refresh()),
  28063. this.initialLoadingPromise
  28064. },
  28065. refresh: function(e) {
  28066. return {},
  28067. $.Deferred().resolve()
  28068. },
  28069. get: function(e) {
  28070. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  28071. }
  28072. },
  28073. h.exports = r
  28074. }
  28075. ).call(this, "/js/util/ModelUrls.js")
  28076. }
  28077. , {
  28078. "../ab": 3,
  28079. "../constants": 8,
  28080. "./ajax": 181,
  28081. "./logger": 189,
  28082. "./showcase": 193
  28083. }],
  28084. 178: [function(l, c, e) {
  28085. (function(e) {
  28086. "use strict";
  28087. function t() {
  28088. i.call(this),
  28089. this.neighbourMap = {},
  28090. this.map = null
  28091. }
  28092. var f, g, m, v, y, A, C, I, E, _, b, w = l("three"), n = l("./common"), a = l("../settings"), r = l("../objects/Panorama"), o = (a = l("../settings"),
  28093. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  28094. n.inherit(t, i),
  28095. t.prototype.getIndex = function(e) {
  28096. return e.id
  28097. }
  28098. ,
  28099. t.prototype.find = function(e, t) {
  28100. var i = n.filterAll(this.list, e);
  28101. return 0 === i.length ? null : (t && t.forEach(function(e) {
  28102. i = n.stableSort(i, e)
  28103. }),
  28104. i[0])
  28105. }
  28106. ,
  28107. t.prototype.sortByScore = function(e, t) {
  28108. var i = n.filterAll(this.list, e);
  28109. return 0 === i.length ? null : i = i.map(function(i) {
  28110. return {
  28111. pano: i,
  28112. score: t.reduce(function(e, t) {
  28113. return e + t(i)
  28114. }, 0)
  28115. }
  28116. }).sort(function(e, t) {
  28117. return t.score - e.score
  28118. })
  28119. }
  28120. ,
  28121. t.prototype.lowestByScore = function(e, t, i) {
  28122. return this.findRankedByScore(0, e, t, i)
  28123. }
  28124. ,
  28125. t.prototype.findRankedByScore = function(e, t, i, n) {
  28126. n && (n.candidates = null,
  28127. n.pano = null),
  28128. e = e || 0;
  28129. var r = this.sortByScore(t, i);
  28130. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  28131. n.pano = r[e].pano),
  28132. r[e].pano)
  28133. }
  28134. ,
  28135. t.prototype.showPanoScores = function(e) {
  28136. this.list.forEach(function(e) {
  28137. e.removeTextSprite()
  28138. });
  28139. var t = 6344768;
  28140. e.forEach(function(e) {
  28141. e.pano.addTextSprite(e.score.toFixed(2), t),
  28142. t = 16428055
  28143. })
  28144. }
  28145. ,
  28146. t.prototype.isNeighbour = function(e, t) {
  28147. return this.neighbourMap[e.id][t.id]
  28148. }
  28149. ,
  28150. t.prototype.getNeighbours = function(e) {
  28151. return this.neighbourMap[e.id]
  28152. }
  28153. ,
  28154. t.prototype.setNeighbour = function(e, t, i) {
  28155. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  28156. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  28157. this.neighbourMap[e.id][e.id] = !0,
  28158. this.neighbourMap[t.id][t.id] = !0,
  28159. this.neighbourMap[e.id][t.id] = i,
  28160. this.neighbourMap[t.id][e.id] = i,
  28161. this.neighbourMap[e.id]
  28162. }
  28163. ,
  28164. t.prototype.findClosest = function(e, t) {
  28165. var i = [r.filters.isPanoAligned()];
  28166. return t && i.push(r.filters.inDirection(e, t, .75)),
  28167. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  28168. }
  28169. ,
  28170. t.prototype.dualNeighbors = function(e, t) {
  28171. var i, n = [];
  28172. for (i in this.neighbourMap[e.id])
  28173. this.neighbourMap[t.id][i] && n.push(i);
  28174. return n
  28175. }
  28176. ,
  28177. t.prototype.populate_path_graph = function() {
  28178. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  28179. for (e = 0; e < this.list.length; e += 1) {
  28180. for (t in s = !(a = {}),
  28181. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  28182. if (i[t]) {
  28183. o = this.index[t],
  28184. u.copy(r.floorPosition),
  28185. u.sub(o.floorPosition);
  28186. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  28187. , p = (Math.abs(u.y),
  28188. Math.max(d, .01),
  28189. Math.max(0, Math.abs(u.y) - .2));
  28190. n = 0 < p ? (1,
  28191. p = Math.pow(4 * p, 2),
  28192. d = Math.pow(d, 2),
  28193. Math.sqrt(p * p + d * d)) : (1,
  28194. u.length()),
  28195. a[o.id] = n,
  28196. s = !0
  28197. }
  28198. s ? c[r.id] = a : h += 1
  28199. }
  28200. this.map = c,
  28201. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  28202. }
  28203. ,
  28204. t.prototype.aStarSearch = function(e, t) {
  28205. var i = Date.now()
  28206. , n = new o({
  28207. start: e,
  28208. isEnd: function(e) {
  28209. return e === t
  28210. },
  28211. neighbor: function(e) {
  28212. var t = e.neighbourPanos || e.findNeighourPanos()
  28213. , i = [];
  28214. for (var n in t)
  28215. t[n] && i.push(this.index[n]); //add: t[n] &&
  28216. return i
  28217. }
  28218. .bind(this),
  28219. distance: function(e, t) {
  28220. return this.map[e.id][t.id]
  28221. }
  28222. .bind(this),
  28223. heuristic: function(e, t) {
  28224. return 1
  28225. }
  28226. .bind(this),
  28227. hash: function(e) {
  28228. return e.id
  28229. },
  28230. timeout: 5e3
  28231. });
  28232. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  28233. "success" !== n.status)
  28234. return T.debug("Did not find A* path from " + e + " to " + t),
  28235. null;
  28236. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  28237. var r = [];
  28238. return n.path.forEach(function(e) {
  28239. r.push(e.id)
  28240. }),
  28241. r
  28242. }
  28243. ,
  28244. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  28245. g = new w.Vector3,
  28246. m = new w.Vector3,
  28247. v = new w.Vector3,
  28248. y = new w.Vector3,
  28249. A = new w.Vector3,
  28250. C = new w.Vector3,
  28251. I = new w.Vector3,
  28252. E = [],
  28253. _ = new w.Vector3,
  28254. b = new w.Vector3,
  28255. function(e, t) {
  28256. if (e)
  28257. for (var i = function(e, t, i) {
  28258. return y.copy(t).sub(e),
  28259. y.dot(i)
  28260. }, n = function(e, t) {
  28261. return i(_, e.position, m) - i(_, t.position, m)
  28262. }, r = 0; r < e.length - 1; ) {
  28263. var o = e[r]
  28264. , a = e[r + 1]
  28265. , s = this.index[o]
  28266. , l = this.index[a];
  28267. _.copy(s.position),
  28268. b.copy(l.position),
  28269. E.length = 0,
  28270. f.copy(b).sub(_),
  28271. m.copy(f).normalize();
  28272. for (var c = 0; c < this.list.length; c++) {
  28273. var h = this.list[c];
  28274. y.copy(h.position).sub(_);
  28275. var u = y.dot(m);
  28276. 0 < u && (C.copy(m),
  28277. C.multiplyScalar(u),
  28278. A.copy(y),
  28279. A.sub(C),
  28280. A.length() < t && (g.copy(f).negate(),
  28281. v.copy(g).normalize(),
  28282. I.copy(h.position).sub(b),
  28283. 0 < I.dot(v) && E.push(h)))
  28284. }
  28285. if (0 < E.length) {
  28286. E.sort(n);
  28287. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  28288. e[d] = e[d - E.length];
  28289. for (var p = 0; p < E.length; p++)
  28290. e[p + r + 1] = E[p].id
  28291. }
  28292. r += E.length + 1
  28293. }
  28294. }
  28295. ),
  28296. t.prototype.fadeMarkerOpacity = function(e, t) {
  28297. var i = void 0 === e ? a.panorama.markerOpacity : e
  28298. , n = this.list.findIndex(function(e) {
  28299. return e.marker
  28300. });
  28301. if (!(n < 0)) {
  28302. var r = this.list[n].marker.material.opacity;
  28303. if (r !== e) {
  28304. var o = i - r;
  28305. s.trigger({
  28306. func: function(e, t) {
  28307. var i = r + e * o;
  28308. this.forEach(function(e) {
  28309. e.marker && (e.marker.material.opacity = i)
  28310. })
  28311. }
  28312. .bind(this),
  28313. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  28314. name: "_fpm"
  28315. })
  28316. }
  28317. }
  28318. }
  28319. ,
  28320. c.exports = t
  28321. }
  28322. ).call(this, "/js/util/PanoramaCollection.js")
  28323. }
  28324. , {
  28325. "../objects/Panorama": 148,
  28326. "../settings": 166,
  28327. "./IndexedCollection": 175,
  28328. "./aStar": 180,
  28329. "./common": 185,
  28330. "./logger": 189,
  28331. "./transitions": 195,
  28332. three: 217
  28333. }],
  28334. 179: [function(e, t, i) {
  28335. "use strict";
  28336. function n() {
  28337. this.actionSequence = [],
  28338. this.actionSequenceInProgress = !1
  28339. }
  28340. function r(e, t, i, n) {
  28341. c.trackAlways("zoom_" + e, {
  28342. from: t,
  28343. to: i,
  28344. pano: n
  28345. })
  28346. }
  28347. var o, a, s, l, c = e("../analytics");
  28348. n.prototype.reset = function(e) {
  28349. this.actionSequenceInProgress = !1,
  28350. this.actionSequence.length = 0
  28351. }
  28352. ,
  28353. n.prototype.addZoomAction = (a = o = null,
  28354. s = !1,
  28355. l = function() {
  28356. if (o = null,
  28357. 0 < this.actionSequence.length) {
  28358. var e = this.actionSequence[0].start
  28359. , t = this.actionSequence[this.actionSequence.length - 1].end;
  28360. 1 === e ? function(e, t) {
  28361. r("initial", 1, e, t)
  28362. }(t, a) : function(e, t, i) {
  28363. r("followup", e, t, i)
  28364. }(e, t, a)
  28365. }
  28366. this.reset()
  28367. }
  28368. ,
  28369. function(e, t, i) {
  28370. if (e !== t) {
  28371. s || (l = l.bind(this),
  28372. s = !0),
  28373. o && (window.clearTimeout(o),
  28374. o = null),
  28375. i === a && this.actionSequenceInProgress || (this.reset(),
  28376. a = i),
  28377. this.actionSequenceInProgress = !0;
  28378. var n = {
  28379. start: e,
  28380. end: t
  28381. };
  28382. this.actionSequence.push(n),
  28383. o = window.setTimeout(l, 150)
  28384. }
  28385. }
  28386. ),
  28387. t.exports = n
  28388. }
  28389. , {
  28390. "../analytics": 4
  28391. }],
  28392. 180: [function(e, t, i) {
  28393. "use strict";
  28394. function g(e) {
  28395. if (void 0 === e.parent)
  28396. return [e.data];
  28397. var t = g(e.parent);
  28398. return t.push(e.data),
  28399. t
  28400. }
  28401. function m(e) {
  28402. return e.toString()
  28403. }
  28404. function v(e, t) {
  28405. return e.f - t.f
  28406. }
  28407. var y = e("Set")
  28408. , A = e("heap")
  28409. , C = e("dict");
  28410. t.exports = function(e) {
  28411. void 0 === e.timeout && (e.timeout = 1 / 0);
  28412. var t = e.hash || m
  28413. , i = {
  28414. data: e.start,
  28415. g: 0,
  28416. h: e.heuristic(e.start)
  28417. }
  28418. , n = i;
  28419. i.f = i.h;
  28420. var r = new y
  28421. , o = new A(v)
  28422. , a = C();
  28423. o.push(i),
  28424. a.set(t(i.data), i);
  28425. for (var s = new Date; o.size(); ) {
  28426. if (new Date - s > e.timeout)
  28427. return {
  28428. status: "timeout",
  28429. cost: n.g,
  28430. path: g(n)
  28431. };
  28432. var l = o.pop();
  28433. if (a.delete(t(l.data)),
  28434. e.isEnd(l.data))
  28435. return {
  28436. status: "success",
  28437. cost: l.g,
  28438. path: g(l)
  28439. };
  28440. r.add(t(l.data));
  28441. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  28442. var u = c[h];
  28443. if (!r.contains(t(u))) {
  28444. var d = l.g + e.distance(l.data, u)
  28445. , p = a.get(t(u))
  28446. , f = !1;
  28447. if (void 0 === p)
  28448. p = {
  28449. data: u
  28450. },
  28451. a.set(t(u), p);
  28452. else {
  28453. if (p.g < d)
  28454. continue;
  28455. f = !0
  28456. }
  28457. p.parent = l,
  28458. p.g = d,
  28459. p.h = e.heuristic(u),
  28460. p.f = d + p.h,
  28461. p.h < n.h && (n = p),
  28462. f ? o.heapify() : o.push(p)
  28463. }
  28464. }
  28465. }
  28466. return {
  28467. status: "noPath",
  28468. cost: n.g,
  28469. path: g(n)
  28470. }
  28471. }
  28472. }
  28473. , {
  28474. Set: 196,
  28475. dict: 210,
  28476. heap: 211
  28477. }],
  28478. 181: [function(i, n, e) {
  28479. (function(e) {
  28480. "use strict";
  28481. function s(e, t, i) {
  28482. function n() {
  28483. l.warn("Retrying ", t),
  28484. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  28485. }
  28486. var r = function(e, t, i) {
  28487. var n = new XMLHttpRequest;
  28488. if (i && "withCredentials"in n)
  28489. n.open(e, t, i);
  28490. else if ("undefined" != typeof XDomainRequest)
  28491. (n = new XDomainRequest).open(e, t);
  28492. else {
  28493. if (i)
  28494. throw "Browser does not support CORS!";
  28495. n.open(e, t)
  28496. }
  28497. return n
  28498. }(e, t, !1);
  28499. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  28500. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  28501. i.responseType)
  28502. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  28503. r.responseType = i.responseType;
  28504. else {
  28505. if ("image/jpeg" !== i.responseType)
  28506. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  28507. r.responseType = "arraybuffer"
  28508. }
  28509. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  28510. i.auth && r.setRequestHeader("Authorization", i.auth),
  28511. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  28512. r.setRequestHeader("Content-Type", "application/json")),
  28513. "object" == typeof i.headers)
  28514. for (var o in i.headers)
  28515. r.setRequestHeader(o, i.headers[o]);
  28516. var a = $.Deferred();
  28517. return r.onreadystatechange = function(e) {
  28518. if (4 === this.readyState)
  28519. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  28520. i.retries++,
  28521. setTimeout(n, 1e3);
  28522. else if (200 === this.status) {
  28523. var t = function(e, t) {
  28524. var i = e.response;
  28525. if ("json" === t && "object" != typeof i)
  28526. try {
  28527. i = JSON.parse(e.responseText)
  28528. } catch (e) {
  28529. return void a.reject({
  28530. error: "Failed parsing JSON"
  28531. })
  28532. }
  28533. else if ("image/jpeg" === t) {
  28534. var n = new Uint8Array(e.response)
  28535. , r = new Blob([n],{
  28536. type: "image/jpeg"
  28537. })
  28538. , o = URL.createObjectURL(r);
  28539. (i = new Image).src = o,
  28540. i.crossOrigin = "Anonymous",
  28541. i.onload = function() {
  28542. URL.revokeObjectURL(o)
  28543. }
  28544. }
  28545. return i
  28546. }(this, i.responseType);
  28547. a.resolve(t)
  28548. } else
  28549. a.reject(this)
  28550. }
  28551. ,
  28552. r.onprogress = function(e) {
  28553. a.notify(e)
  28554. }
  28555. ,
  28556. r.send(i.data),
  28557. a.promise()
  28558. }
  28559. function o(e, t) {
  28560. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  28561. return t.headers && function(t) {
  28562. return Object.keys(t).sort().map(function(e) {
  28563. return {
  28564. key: e,
  28565. value: t[e]
  28566. }
  28567. })
  28568. }(t.headers).forEach(function(e) {
  28569. i += "__" + e.key + ":" + e.value
  28570. }),
  28571. i
  28572. }
  28573. var t = i("./logger")
  28574. , a = i("../ab")
  28575. , l = new t(e);
  28576. window.URL = window.URL || window.webkitURL,
  28577. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28578. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {},
  28579. n.exports = {
  28580. get: function(e, t) {
  28581. var i, n = void 0 === (t = t || {}).cache || t.cache;
  28582. if (n) {
  28583. var r = function(e, t) {
  28584. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  28585. }(e, t);
  28586. if (r)
  28587. return r
  28588. }
  28589. return i = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : s("GET", e, t),
  28590. n && function(e, t, i) {
  28591. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28592. }(e, t, i),
  28593. i
  28594. },
  28595. post: function(e, t) {
  28596. return s("POST", e, t)
  28597. },
  28598. patch: function(e, t) {
  28599. return s("PATCH", e, t)
  28600. },
  28601. getImage: function(e, t) {
  28602. function i() {
  28603. l.warn("Retrying ", e),
  28604. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28605. }
  28606. var n = $.Deferred()
  28607. , r = new Image
  28608. , o = this;
  28609. return e = a.changeIfImageOptimzing(e),
  28610. null != t || (t = 3),
  28611. r.onerror = function() {
  28612. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28613. }
  28614. ,
  28615. r.onload = function() {
  28616. n.resolve(r)
  28617. }
  28618. ,
  28619. r.crossOrigin = "anonymous",
  28620. r.src = e,
  28621. n
  28622. }
  28623. }
  28624. }
  28625. ).call(this, "/js/util/ajax.js")
  28626. }
  28627. , {
  28628. "../ab": 3,
  28629. "./logger": 189
  28630. }],
  28631. 182: [function(e, t, i) {
  28632. "use strict";
  28633. function n(e, t) {
  28634. var i = window.navigator.userAgent.match(e);
  28635. return i = i ? i[1].split(t) : [],
  28636. {
  28637. major: parseInt(i[0]) || 0,
  28638. minor: parseInt(i[1]) || 0,
  28639. patch: parseInt(i[2]) || 0
  28640. }
  28641. }
  28642. var r = e("../exception/DeviceMismatchException");
  28643. t.exports = {
  28644. isFullscreen: function() {
  28645. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  28646. },
  28647. supportsFullscreen: function() {
  28648. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28649. },
  28650. isPointerLocked: function() {
  28651. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28652. },
  28653. requestFullscreen: function(e, t) {
  28654. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28655. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28656. },
  28657. requestPointerLock: function() {
  28658. var e;
  28659. if (document.fullscreenElement)
  28660. e = document.fullscreenElement();
  28661. else if (document.mozFullscreenElement)
  28662. e = document.mozFullscreenElement();
  28663. else if (document.mozFullScreenElement)
  28664. e = document.mozFullScreenElement();
  28665. else {
  28666. if (!document.webkitFullscreenElement)
  28667. return;
  28668. e = document.webkitFullscreenElement()
  28669. }
  28670. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28671. e.requestPointerLock(),
  28672. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28673. },
  28674. exitPointerLock: function() {
  28675. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28676. document.exitPointerLock()
  28677. },
  28678. exitFullscreen: function() {
  28679. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28680. },
  28681. details: function() {
  28682. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28683. return e ? {
  28684. name: e[1],
  28685. version: parseInt(e[2]),
  28686. platform: navigator.platform
  28687. } : {}
  28688. },
  28689. is: function(e) {
  28690. return this.details() && this.details().name === e
  28691. },
  28692. inIframe: function() {
  28693. return window.parent !== window
  28694. },
  28695. aspectRatio: function() {
  28696. var e = $("#player").width() / $("#player").height();
  28697. return isFinite(e) ? e : 0
  28698. },
  28699. userAgent: function() {
  28700. return window.navigator.userAgent
  28701. },
  28702. isMobile: function() {
  28703. var e = navigator.userAgent || navigator.vendor || window.opera;
  28704. return /(android|bb\d+|meego).+mobile|android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0, 4))
  28705. },
  28706. isLandscape: function() {
  28707. return this.isMobile && 1 < this.aspectRatio()
  28708. },
  28709. isSmallScreen: function() {
  28710. return screen.width / window.devicePixelRatio < 240
  28711. },
  28712. detectIE: function() {
  28713. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28714. },
  28715. detectSafari: function() {
  28716. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  28717. },
  28718. detectFirefox: function() {
  28719. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  28720. },
  28721. detectChrome: function() {
  28722. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  28723. },
  28724. detectOpera: function() {
  28725. return -1 !== window.navigator.userAgent.indexOf("OPR")
  28726. },
  28727. detectIOS: function() {
  28728. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28729. },
  28730. detectIPad: function() {
  28731. var e = window.navigator.userAgent;
  28732. return /iPad/.test(e)
  28733. },
  28734. detectIPod: function() {
  28735. var e = window.navigator.userAgent;
  28736. return /iPod/.test(e)
  28737. },
  28738. detectIPhone: function() {
  28739. var e = window.navigator.userAgent;
  28740. return /iPhone/.test(e)
  28741. },
  28742. detectAndroid: function() {
  28743. return -1 !== window.navigator.userAgent.indexOf("Android")
  28744. },
  28745. detectAndroidMobile: function() {
  28746. var e = window.navigator.userAgent;
  28747. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28748. },
  28749. detectSamsungNative: function() {
  28750. var e = window.navigator.userAgent;
  28751. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28752. },
  28753. detectSamsungS6: function() {
  28754. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28755. },
  28756. detectHUAWEI5X: function() {
  28757. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28758. },
  28759. detectWebVR: function() {
  28760. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28761. },
  28762. getVRDisplay: function() {
  28763. var t = $.Deferred();
  28764. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28765. 1 <= e.length && t.resolve(e[0]),
  28766. t.reject(null)
  28767. }),
  28768. t) : t.reject(null)
  28769. },
  28770. iosVersion: function() {
  28771. if (!this.detectIOS())
  28772. throw new r("Did not detect an iDevice");
  28773. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28774. },
  28775. androidVersion: function() {
  28776. if (!this.detectAndroid())
  28777. throw new r("Did not detect an Android based device");
  28778. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28779. },
  28780. valueFromCookie: function(e, t) {
  28781. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28782. if (!i)
  28783. return t;
  28784. var n = i[1];
  28785. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28786. },
  28787. valueFromHash: function(e, t) {
  28788. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  28789. if (!i)
  28790. return t;
  28791. var n = i[1];
  28792. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  28793. }
  28794. }
  28795. }
  28796. , {
  28797. "../exception/DeviceMismatchException": 56
  28798. }],
  28799. 183: [function(i, n, e) {
  28800. (function(e) {
  28801. "use strict";
  28802. var o = i("../controls/serializer")
  28803. , a = i("../util/math")
  28804. , s = i("./browser")
  28805. , l = i("../enum/Viewmode")
  28806. , t = i("../util/logger")
  28807. , c = i("three")
  28808. , h = new t(e);
  28809. n.exports = {
  28810. getStartCameraOptions: function(e, t) {
  28811. var i = function(e) {
  28812. var t = s.valueFromHash("start", "")
  28813. , i = {};
  28814. if ("" !== t) {
  28815. h.debug("Start override found in parameters, trying to parse..."),
  28816. i = function(e) {
  28817. return o.deserialize(e)
  28818. }(t) || {};
  28819. var n = s.valueFromHash("tag", null);
  28820. n && (i.tag = n),
  28821. i.panoId && (i.pano = e.get(i.panoId))
  28822. }
  28823. return i
  28824. }(t);
  28825. if (0 < Object.keys(i).length)
  28826. return i;
  28827. if (e.heroImage)
  28828. i = function(e, t) {
  28829. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28830. return {};
  28831. var i = {}
  28832. , n = e.heroImage.metadata;
  28833. h.debug("Using start position from thumbnail image"),
  28834. i.position = n.camera_position,
  28835. i.quaternion = n.camera_quaternion;
  28836. try {
  28837. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28838. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28839. } catch (e) {
  28840. h.debug(e.message)
  28841. }
  28842. return i
  28843. }(e, t);
  28844. else if (window.MP_PREFETCHED_MODELDATA.camera_start) {
  28845. var n = window.MP_PREFETCHED_MODELDATA.camera_start;
  28846. try {
  28847. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28848. i.position = (new c.Vector3).fromArray(n.camera.position),
  28849. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28850. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28851. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28852. h.debug("Using camera_start"),
  28853. h.debug("Modeldata pano: ", i.pano.quaternion),
  28854. h.debug("Camera start pano: ", n.pano.quaternion)),
  28855. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28856. } catch (e) {
  28857. h.warn(e.message)
  28858. if(i.mode == "panorama" && !i.pano){
  28859. i.pano = t.list[0]
  28860. }
  28861. }
  28862. }
  28863. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28864. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28865. i.pano = t.findClosest(i.position) ,
  28866. i.quaternion = i.pano.quaternion),
  28867. 0 === Object.keys(i).length) {
  28868. var r = t.list[0];
  28869. r && (i.mode = l.PANORAMA,
  28870. i.pano = r,
  28871. i.position = r.position,
  28872. i.quaternion = r.quaternion,
  28873. h.info("Starting at 1st pano " + r.id))
  28874. }
  28875. return i.mode = i.mode || l.DOLLHOUSE,
  28876. i
  28877. }
  28878. }
  28879. }
  28880. ).call(this, "/js/util/camera.js")
  28881. }
  28882. , {
  28883. "../controls/serializer": 14,
  28884. "../enum/Viewmode": 51,
  28885. "../util/logger": 189,
  28886. "../util/math": 190,
  28887. "./browser": 182,
  28888. three: 217
  28889. }],
  28890. 184: [function(e, t, i) {
  28891. "use strict";
  28892. function r(e, t, i) {
  28893. var n = t
  28894. , r = i;
  28895. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28896. }
  28897. function o(e, t, i) {
  28898. var n = t
  28899. , r = i;
  28900. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28901. }
  28902. var a = e("./MathLight");
  28903. t.exports = {
  28904. clampVFOV: function(e, t, i, n) {
  28905. return t < r(e, i, n) ? o(t, i, n) : e
  28906. },
  28907. getHFOVForCamera: function(e, t, i) {
  28908. return r(e.fov, t, i)
  28909. },
  28910. getHFOVFromVFOV: r,
  28911. getVFOVFromHFOV: o
  28912. }
  28913. window.MathLight = t.exports
  28914. }
  28915. , {
  28916. "./MathLight": 176
  28917. }],
  28918. 185: [function(e, t, i) {
  28919. "use strict";
  28920. var a = e("three");
  28921. t.exports = {
  28922. delayOneFrame: function(e) {
  28923. window.setTimeout(e, 1)
  28924. },
  28925. normalizeUrl: function(e) {
  28926. return e.replace("https://", "http://")
  28927. },
  28928. domainFromUrl: function(e) {
  28929. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28930. return t ? t[3] : e
  28931. },
  28932. average: function(e, t) {
  28933. if (0 === e.length)
  28934. return null;
  28935. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28936. i += t ? e[r][t] : e[r],
  28937. n++
  28938. }
  28939. return i / n
  28940. },
  28941. countUnique: function(e) {
  28942. for (var t = {}, i = 0; i < e.length; i++)
  28943. t[e[i]] = 1 + (t[e[i]] || 0);
  28944. return Object.keys(t).length
  28945. },
  28946. averageVectors: function(e, t) {
  28947. var i = new a.Vector3;
  28948. if (0 === e.length)
  28949. return i;
  28950. for (var n = 0, r = 0; r < e.length; r++) {
  28951. var o = t ? e[r][t] : e[r];
  28952. i.add(o),
  28953. n++
  28954. }
  28955. return i.divideScalar(n)
  28956. },
  28957. equalLists: function(e, t) {
  28958. if (e.length !== t.length)
  28959. return !1;
  28960. for (var i = 0; i < e.length; i++)
  28961. if (e[i] !== t[i])
  28962. return !1;
  28963. return !0
  28964. },
  28965. lowerMedian: function(e, t) {
  28966. return 0 === e.length ? null : (t = t || 2,
  28967. e.sort(function(e, t) {
  28968. return e - t
  28969. }),
  28970. e[Math.floor(e.length / t)])
  28971. },
  28972. stableSort: function(e, n) {
  28973. return e.map(function(e, t) {
  28974. return {
  28975. value: e,
  28976. index: t
  28977. }
  28978. }).sort(function(e, t) {
  28979. var i = n(e.value, t.value);
  28980. return 0 !== i ? i : e.index - t.index
  28981. }).map(function(e) {
  28982. return e.value
  28983. })
  28984. },
  28985. filterAll: function(e, i) {
  28986. return e.filter(function(t) {
  28987. return i.every(function(e) {
  28988. return e(t)
  28989. })
  28990. })
  28991. },
  28992. formatDate: function(e) {
  28993. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28994. },
  28995. formatDatetime: function(e) {
  28996. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28997. },
  28998. randomString: function(e) {
  28999. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  29000. t += i.charAt(Math.floor(Math.random() * i.length));
  29001. return t
  29002. },
  29003. uint8ToBase64: function(e, t) {
  29004. t && "number" == typeof t || (t = 8192);
  29005. for (var i = [], n = 0; n < e.length; n += t)
  29006. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  29007. return btoa(i.join(""))
  29008. },
  29009. uuid4: function e(t) {
  29010. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  29011. },
  29012. nth: function(e) {
  29013. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  29014. },
  29015. extendObject: function(t, i) {
  29016. return Object.keys(i).forEach(function(e) {
  29017. t[e] = i[e]
  29018. }),
  29019. t
  29020. },
  29021. deepExtend: function e(t) {
  29022. t = t || {};
  29023. for (var i = 1; i < arguments.length; i++) {
  29024. var n = arguments[i];
  29025. if (n)
  29026. for (var r in n)
  29027. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  29028. }
  29029. return t
  29030. },
  29031. inherit: function(e, t) {
  29032. e.prototype = Object.create(t.prototype),
  29033. e.prototype.constructor = e
  29034. },
  29035. extend: function(e, t) {
  29036. for (var i in t.prototype)
  29037. e.prototype[i] = t.prototype[i]
  29038. },
  29039. getVisiblePano : function(positions = [], options={}){//add
  29040. var visiblePanos = [];
  29041. var panos = options.panos || player.model.panos.list;
  29042. options.posAtPanos = options.posAtPanos || {}//在不同漫游点的positions
  29043. panos.forEach((pano)=>{
  29044. if(!pano.isAligned())return;
  29045. var A = pano.position.clone();
  29046. var posB = options.posAtPanos[pano.id] || positions;
  29047. var posLength = posB.length
  29048. for(let i=0;i<posLength;i++){
  29049. var B = posB[i];
  29050. var ray = new THREE.Raycaster(A.clone(), B.clone().sub(A).normalize(), 0, A.distanceTo(B) - (options.tolerance||0) )
  29051. var o = ray.intersectObjects(options.model || player.model.colliders, true);
  29052. if (!o || !o.length){ //只要有一点可见,就算整体可见
  29053. visiblePanos.push(pano );
  29054. break;
  29055. }
  29056. }
  29057. })
  29058. return visiblePanos
  29059. }
  29060. ,
  29061. sortByScore : function(list, request, rank) {
  29062. var i = this.filterAll(list, request);
  29063. return 0 === i.length ? null : i = i.map(function(e) {
  29064. return {
  29065. item: e,
  29066. score: rank.reduce(function(t, i) {
  29067. return t + i(e);
  29068. }, 0)
  29069. };
  29070. }).sort(function(e, t) {
  29071. return t.score - e.score;
  29072. });
  29073. }
  29074. },
  29075. Math.sign = function(e) {
  29076. return e < 0 ? -1 : 1
  29077. }
  29078. window.common = t.exports
  29079. }
  29080. , {
  29081. three: 217
  29082. }],
  29083. 186: [function(e, t, i) {
  29084. "use strict";
  29085. var r = {
  29086. linearTween: function(e, t, i, n) {
  29087. return i * e / n + t
  29088. },
  29089. easeInQuad: function(e, t, i, n) {
  29090. return i * (e /= n) * e + t
  29091. },
  29092. easeOutQuad: function(e, t, i, n) {
  29093. return -i * (e /= n) * (e - 2) + t
  29094. },
  29095. easeInOutQuad: function(e, t, i, n) {
  29096. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  29097. },
  29098. easeInCubic: function(e, t, i, n) {
  29099. return i * (e /= n) * e * e + t
  29100. },
  29101. easeOutCubic: function(e, t, i, n) {
  29102. return e /= n,
  29103. i * (--e * e * e + 1) + t
  29104. },
  29105. easeInOutCubic: function(e, t, i, n) {
  29106. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  29107. },
  29108. easeInQuart: function(e, t, i, n) {
  29109. return i * (e /= n) * e * e * e + t
  29110. },
  29111. easeOutQuart: function(e, t, i, n) {
  29112. return e /= n,
  29113. -i * (--e * e * e * e - 1) + t
  29114. },
  29115. easeInOutQuart: function(e, t, i, n) {
  29116. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  29117. },
  29118. easeInQuint: function(e, t, i, n) {
  29119. return i * (e /= n) * e * e * e * e + t
  29120. },
  29121. easeOutQuint: function(e, t, i, n) {
  29122. return e /= n,
  29123. i * (--e * e * e * e * e + 1) + t
  29124. },
  29125. easeInOutQuint: function(e, t, i, n) {
  29126. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  29127. },
  29128. easeInSine: function(e, t, i, n) {
  29129. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  29130. },
  29131. easeOutSine: function(e, t, i, n) {
  29132. return i * Math.sin(e / n * (Math.PI / 2)) + t
  29133. },
  29134. easeInOutSine: function(e, t, i, n) {
  29135. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  29136. },
  29137. easeInExpo: function(e, t, i, n) {
  29138. return i * Math.pow(2, 10 * (e / n - 1)) + t
  29139. },
  29140. easeOutExpo: function(e, t, i, n) {
  29141. return i * (1 - Math.pow(2, -10 * e / n)) + t
  29142. },
  29143. easeInOutExpo: function(e, t, i, n) {
  29144. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  29145. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  29146. },
  29147. easeInCirc: function(e, t, i, n) {
  29148. return e /= n,
  29149. -i * (Math.sqrt(1 - e * e) - 1) + t
  29150. },
  29151. easeOutCirc: function(e, t, i, n) {
  29152. return e /= n,
  29153. e--,
  29154. i * Math.sqrt(1 - e * e) + t
  29155. },
  29156. easeInOutCirc: function(e, t, i, n) {
  29157. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  29158. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  29159. },
  29160. easeInElastic: function(e, t, i, n) {
  29161. var r = 1.70158
  29162. , o = 0
  29163. , a = i;
  29164. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  29165. r = a < Math.abs(i) ? (a = i,
  29166. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29167. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  29168. },
  29169. easeOutElastic: function(e, t, i, n) {
  29170. var r = 1.70158
  29171. , o = 0
  29172. , a = i;
  29173. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  29174. r = a < Math.abs(i) ? (a = i,
  29175. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29176. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  29177. },
  29178. easeInOutElastic: function(e, t, i, n) {
  29179. var r = 1.70158
  29180. , o = 0
  29181. , a = i;
  29182. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  29183. r = a < Math.abs(i) ? (a = i,
  29184. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29185. e < 1 ? a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * -.5 + t : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * .5 + i + t)
  29186. },
  29187. easeInBack: function(e, t, i, n, r) {
  29188. return void 0 === r && (r = 1.70158),
  29189. i * (e /= n) * e * ((r + 1) * e - r) + t
  29190. },
  29191. easeOutBack: function(e, t, i, n, r) {
  29192. return void 0 === r && (r = 1.70158),
  29193. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  29194. },
  29195. easeInOutBack: function(e, t, i, n, r) {
  29196. return void 0 === r && (r = 1.70158),
  29197. (e /= n / 2) < 1 ? i / 2 * (e * e * ((1 + (r *= 1.525)) * e - r)) + t : i / 2 * ((e -= 2) * e * ((1 + (r *= 1.525)) * e + r) + 2) + t
  29198. },
  29199. easeOutBounce: function(e, t, i, n) {
  29200. 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
  29201. },
  29202. easeInBounce: function(e, t, i, n) {
  29203. return i - r.easeOutBounce(n - e, 0, i, n) + t
  29204. },
  29205. easeInOutBounce: function(e, t, i, n) {
  29206. return e < n / 2 ? .5 * r.easeInBounce(2 * e, 0, i, n) + t : .5 * r.easeOutBounce(x, 2 * e - n, 0, i, n) + .5 * i + t
  29207. }
  29208. };
  29209. window.easing = t.exports = r
  29210. }
  29211. , {}],
  29212. 187: [function(e, t, i) {
  29213. "use strict";
  29214. function n() {
  29215. this.events = [],
  29216. this.valid = !1
  29217. }
  29218. var r = e("../enum/Joystick");
  29219. n.prototype.push = function(e, t) {
  29220. this.events.push({
  29221. direction: e,
  29222. pano: t
  29223. }),
  29224. this.valid = !0
  29225. }
  29226. ,
  29227. n.prototype.pop = function(e) {
  29228. var t = this.events.pop();
  29229. return this.events.length < 1 && (this.valid = !1),
  29230. t
  29231. }
  29232. ,
  29233. n.prototype.peek = function() {
  29234. return this.events.length ? this.events[this.events.length - 1] : {
  29235. direction: null,
  29236. pano: null
  29237. }
  29238. }
  29239. ,
  29240. n.prototype.invalidate = function() {
  29241. this.events = [],
  29242. this.valid = !1
  29243. }
  29244. ,
  29245. n.prototype.reversePano = function(e) {
  29246. if (!this.valid)
  29247. return null;
  29248. var t = this.peek();
  29249. return r.opposite(e) === t.direction ? (this.pop(),
  29250. t.pano) : null
  29251. }
  29252. ,
  29253. t.exports = n
  29254. }
  29255. , {
  29256. "../enum/Joystick": 29
  29257. }],
  29258. 188: [function(e, t, i) {
  29259. "use strict";
  29260. t.exports = {
  29261. vector: function(t, i) {
  29262. var n = t.clone();
  29263. return i = i.clone(),
  29264. function(e) {
  29265. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  29266. }
  29267. },
  29268. quaternion: function(t, i) {
  29269. var n = t.clone();
  29270. return function(e) {
  29271. t.copy(n).slerp(i, e)
  29272. }
  29273. },
  29274. property: function(t, i, n, r) {
  29275. var o = t[i];
  29276. return function(e) {
  29277. t[i] = o * (1 - e) + n * e,
  29278. r && r(t[i])
  29279. }
  29280. },
  29281. uniform: function(t, i, n) {
  29282. var r = t.material.uniforms[i].value;
  29283. return function(e) {
  29284. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  29285. }
  29286. },
  29287. matrix4: function(o, a) {
  29288. var s = o.clone();
  29289. return function(e) {
  29290. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  29291. t[r] = i[r] * (1 - e) + n[r] * e
  29292. }
  29293. },
  29294. allUniforms: function(e, t, i) {
  29295. var n = e.map(function(e) {
  29296. return this.uniform(e, t, i)
  29297. }
  29298. .bind(this));
  29299. return function(t) {
  29300. n.forEach(function(e) {
  29301. e(t)
  29302. })
  29303. }
  29304. }
  29305. }
  29306. }
  29307. , {}],
  29308. 189: [function(e, t, i) {
  29309. "use strict";
  29310. function h(n) {
  29311. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  29312. if (h.consoleEnabled) {
  29313. var l = function(e) {
  29314. $("#debug-console").append("<p>" + e + "</p>"),
  29315. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  29316. };
  29317. e = function(e) {
  29318. l(Array.prototype.slice.call(arguments).join(" "))
  29319. }
  29320. ,
  29321. t = function(e) {
  29322. l(Array.prototype.slice.call(arguments).join(" "))
  29323. }
  29324. ,
  29325. i = function(e) {
  29326. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  29327. }
  29328. ,
  29329. r = function(e) {
  29330. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  29331. }
  29332. } else
  29333. console.log ? (e = console.log,
  29334. t = console.info ? console.info : console.log,
  29335. i = console.warn ? console.warn : console.log,
  29336. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  29337. ;
  29338. function c(e) {
  29339. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  29340. }
  29341. return {
  29342. debug: function() {
  29343. h.level >= h.levels.debug && e.apply(console, c(arguments))
  29344. },
  29345. info: function() {
  29346. h.level >= h.levels.info && t.apply(console, c(arguments))
  29347. },
  29348. warn: function() {
  29349. (function(e, t) {
  29350. if (u) {
  29351. var i = Array.prototype.slice.call(e).join(" ");
  29352. u.captureMessage(i, {
  29353. level: t,
  29354. path: n,
  29355. timestamp: h.timestamp()
  29356. })
  29357. }
  29358. }
  29359. )(arguments, "warn"),
  29360. h.level >= h.levels.warn && i.apply(console, c(arguments))
  29361. },
  29362. error: function() {
  29363. (function(e, t) {
  29364. if (u) {
  29365. var i = Array.prototype.slice.call(e).join(" ");
  29366. u.captureException(new Error(i), {
  29367. level: t,
  29368. path: n,
  29369. timestamp: h.timestamp()
  29370. })
  29371. }
  29372. }
  29373. )(arguments, "error"),
  29374. h.level >= h.levels.error && r.apply(console, c(arguments))
  29375. },
  29376. v3str: function(e, t) {
  29377. var i = void 0 === t ? 2 : t;
  29378. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  29379. },
  29380. eulstr: function(e, t) {
  29381. var i = void 0 === t ? 2 : t;
  29382. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  29383. },
  29384. time: function(e) {
  29385. h.level >= h.levels.debug && (s[e] = Date.now())
  29386. },
  29387. timeEnd: function(e) {
  29388. if (h.level >= h.levels.debug) {
  29389. var t = s[e];
  29390. if (!t)
  29391. return;
  29392. var i = (Date.now() - t) / 1e3;
  29393. this.debug(e, i + "s")
  29394. }
  29395. }
  29396. }
  29397. }
  29398. var u = window.Raven;
  29399. h.timestamp = function() {
  29400. return (Date.now() - window.navigationStart) / 1e3 + "s"
  29401. }
  29402. ,
  29403. h.level = (h.levels = {
  29404. debug: 3,
  29405. info: 2,
  29406. warn: 1,
  29407. error: 0
  29408. }).info,
  29409. t.exports = h
  29410. }
  29411. , {}],
  29412. 190: [function(e, t, i) {
  29413. "use strict";
  29414. var o = e("three")
  29415. , r = e("../enum/GLCubeFaces");
  29416. e("../constants");
  29417. t.exports = {
  29418. convertVisionVector: function(e) {
  29419. return new o.Vector3(e.x,e.z,-e.y)
  29420. },
  29421. convertVisionQuaternion: function(e) {
  29422. return new o.Quaternion(e.x,e.z,-e.y,e.w).multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), o.Math.degToRad(90)))
  29423. },
  29424. convertWorkshopVector: function(e) {
  29425. return new o.Vector3(-e.x,e.y,e.z)
  29426. },
  29427. convertWorkshopQuaternion: function(e) {
  29428. return new o.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new o.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  29429. },
  29430. convertWorkshopPanoramaQuaternion: function(e) {
  29431. return new o.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), o.Math.degToRad(270)))
  29432. },
  29433. convertWorkshopOrthoZoom: function(e) {
  29434. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  29435. },
  29436. toPrecision: function(e, t) {
  29437. function i(e, t) {
  29438. var i = Math.pow(10, t);
  29439. return Math.round(e * i) / i
  29440. }
  29441. if (e instanceof Array) {
  29442. for (var n = 0; n < e.length; n++)
  29443. e[n] = i(e[n], t);
  29444. return e
  29445. }
  29446. return i(e, t)
  29447. },
  29448. isEmptyQuaternion: function(e) {
  29449. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  29450. },
  29451. projectPositionToCanvas: function(e, t, i) {
  29452. (i = i || new o.Vector3).copy(e);
  29453. var n = .5 * $("#player").width()
  29454. , r = .5 * $("#player").height();
  29455. return i.project(t),
  29456. i.x = i.x * n + n,
  29457. i.y = -i.y * r + r,
  29458. i
  29459. },
  29460. convertScreenPositionToNDC: function(e, t, i) {
  29461. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  29462. i.y = -t / $("#player").height() * 2 + 1,
  29463. i
  29464. },
  29465. constrainedTurn: function(e) {
  29466. var t = e % (2 * Math.PI);
  29467. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  29468. },
  29469. getFOVDotThreshold: function(e) {
  29470. return Math.cos(o.Math.degToRad(e / 2))
  29471. },
  29472. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  29473. switch (e) {
  29474. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29475. i.set(1, t.y, t.x);
  29476. break;
  29477. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29478. i.set(-1, t.y, -t.x);
  29479. break;
  29480. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29481. i.set(-t.x, 1, -t.y);
  29482. break;
  29483. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29484. i.set(-t.x, -1, t.y);
  29485. break;
  29486. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29487. i.set(-t.x, t.y, 1);
  29488. break;
  29489. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29490. i.set(t.x, t.y, -1)
  29491. }
  29492. n && i.normalize()
  29493. },
  29494. //add:
  29495. getPos2d : function(point, camera, dom){
  29496. var camera = camera ;
  29497. var dom = dom;
  29498. 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);
  29499. var x,y;
  29500. x = (pos.x + 1) / 2 * dom.clientWidth;
  29501. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  29502. var inSight = x <= dom.clientWidth && x >= 0
  29503. && y <= dom.clientHeight && y >= 0
  29504. return {
  29505. pos: new THREE.Vector2(x,y),
  29506. vector: pos,
  29507. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  29508. inSight : inSight //在屏幕范围内可见
  29509. };
  29510. },
  29511. }
  29512. window.math = t.exports
  29513. }
  29514. , {
  29515. "../constants": 8,
  29516. "../enum/GLCubeFaces": 25,
  29517. three: 217
  29518. }],
  29519. 191: [function(e, t, i) {
  29520. "use strict";
  29521. function o(e) {
  29522. return r[e]
  29523. }
  29524. var n = e("../enum/GLCubeFaces")
  29525. , a = [0, 1, 2, 3, 4, 5]
  29526. , r = {
  29527. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29528. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29529. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29530. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29531. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29532. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29533. };
  29534. t.exports = {
  29535. mapFaceToCubemapFace: o,
  29536. getCubemapUrls: function(i, n, r) {
  29537. return a.map(function(e, t) {
  29538. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  29539. }
  29540. .bind(this))
  29541. }
  29542. }
  29543. }
  29544. , {
  29545. "../enum/GLCubeFaces": 25
  29546. }],
  29547. 192: [function(e, t, i) {
  29548. "use strict";
  29549. t.exports = {
  29550. captureErrors: function(e, t, i) {
  29551. if ("Raven"in window) {
  29552. Raven.config(e, t).install(),
  29553. i && Raven.setTagsContext(i);
  29554. var n = console.warn
  29555. , r = console.error;
  29556. console.warn = function() {
  29557. var e = Array.prototype.slice.call(arguments);
  29558. Raven.captureMessage(e.join(" "), {
  29559. level: "warning"
  29560. }),
  29561. n.apply(console, e)
  29562. }
  29563. ,
  29564. console.error = function() {
  29565. var e = Array.prototype.slice.call(arguments);
  29566. Raven.captureException(new Error(e.join(" ")), {
  29567. level: "error"
  29568. }),
  29569. r.apply(console, e)
  29570. }
  29571. } else
  29572. console.error("Raven not found, not capturing errors.")
  29573. }
  29574. }
  29575. }
  29576. , {}],
  29577. 193: [function(c, h, e) {
  29578. (function(e) {
  29579. "use strict";
  29580. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  29581. getAuthorizationHeader: function() {
  29582. var e = n.valueFromHash("auth");
  29583. if (e)
  29584. return e.replace(",", " ");
  29585. var t = n.valueFromCookie("token");
  29586. return t ? "Token " + t : null
  29587. },
  29588. parseSidUrl: function(e) {
  29589. var t, i;
  29590. if (t = g_Prefix,
  29591. (e = e || "").match(/^https?/)) {
  29592. o.parse(e);
  29593. t = g_Prefix,
  29594. i = e
  29595. } else
  29596. i = (t = g_Prefix) + "data/" + e;
  29597. return {
  29598. urlBase: t,
  29599. urlModel: i,
  29600. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29601. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29602. }
  29603. },
  29604. getModelIDFromQueryString: function() {
  29605. return n.valueFromHash("model") || n.valueFromHash("m")
  29606. },
  29607. /* normalizeModeldata: function(e, i) {
  29608. e = JSON.parse(JSON.stringify(e));
  29609. var n = null;
  29610. if (e.images.forEach(function(t) {
  29611. if (t.metadata) {
  29612. if ("string" == typeof t.metadata)
  29613. try {
  29614. t.metadata = JSON.parse(t.metadata)
  29615. } catch (e) {
  29616. s.warn("Unable to parse image metadata"),
  29617. t.metadata = null
  29618. }
  29619. else
  29620. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29621. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29622. t.metadata.camera_quaternion = (new a.Quaternion).fromArray(t.metadata.camera_quaternion)) : (t.metadata.camera_quaternion && (t.metadata.camera_quaternion = i.convertWorkshopQuaternion(t.metadata.camera_quaternion)),
  29623. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29624. t.metadata.zoom = t.metadata.zoom || 1),
  29625. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29626. }
  29627. }),
  29628. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29629. var t = {};
  29630. t.pano = {
  29631. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29632. position: i.convertWorkshopVector(n.scan_position),
  29633. uuid: n.scan_id
  29634. },
  29635. t.camera = {
  29636. quaternion: n.camera_quaternion,
  29637. position: n.camera_position
  29638. },
  29639. e.startPano = t
  29640. }
  29641. return e
  29642. }, */
  29643. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29644. e = JSON.parse(JSON.stringify(e));
  29645. var i = null;
  29646. var deal = function(n) {
  29647. if(!n.metadata) return;
  29648. if ("string" == typeof n.metadata)
  29649. try {
  29650. n.metadata = JSON.parse(n.metadata)
  29651. } catch (e) {
  29652. s.warn("Unable to parse image metadata"),
  29653. n.metadata = null
  29654. }
  29655. else{
  29656. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29657. }
  29658. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29659. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  29660. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  29661. }else{
  29662. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29663. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29664. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29665. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29666. }
  29667. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29668. }
  29669. //改
  29670. e.images.forEach(info=>{
  29671. if(info.locations){
  29672. info.locations.forEach(a=>deal(a))
  29673. }else{
  29674. deal(info)
  29675. }
  29676. })
  29677. //icon初始视角的:
  29678. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29679. var n = {};
  29680. n.pano = {
  29681. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29682. position: t.convertWorkshopVector(i.scan_position),
  29683. uuid: i.scan_id
  29684. },
  29685. n.camera = {
  29686. quaternion: i.camera_quaternion,
  29687. position: i.camera_position
  29688. },
  29689. e.startPano = n
  29690. }
  29691. return e
  29692. },
  29693. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  29694. function(e) {
  29695. if (!e)
  29696. throw new Error("Vision version is required");
  29697. var t = i.exec(e);
  29698. if (null === t)
  29699. throw new Error("String is not a vision version: " + e);
  29700. return parseInt(t[1])
  29701. }
  29702. ),
  29703. modelDataPromisesTiles: function(e) {
  29704. var t = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version;
  29705. if (t)
  29706. try {
  29707. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29708. } catch (e) {
  29709. s.warn("Invalid vision version: " + t)
  29710. }
  29711. return !1
  29712. }
  29713. };
  29714. h.exports = l
  29715. }
  29716. ).call(this, "/js/util/showcase.js")
  29717. }
  29718. , {
  29719. "../constants": 8,
  29720. "./browser": 182,
  29721. "./logger": 189,
  29722. three: 217,
  29723. url: 208
  29724. }],
  29725. 194: [function(e, t, i) {
  29726. "use strict";
  29727. var r = e("../util/ajax")
  29728. , o = e("three")
  29729. , a = e("../settings")
  29730. , s = {};
  29731. t.exports = {
  29732. load: function(e, t, i) {
  29733. var n = s[e];
  29734. return n ? t && setTimeout(function() {
  29735. t(n)
  29736. }, 1) : (n = new o.Texture,
  29737. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  29738. n.magFilter = o.LinearFilter,
  29739. n.generateMipmaps = !1),
  29740. n.sourceFile = e,
  29741. s[e] = n,
  29742. r.getImage(e).then(function(e) {
  29743. n.image = e,
  29744. n.needsUpdate = !0,
  29745. t && t(n)
  29746. }).fail(i)),
  29747. n
  29748. },
  29749. loadBase64: function(e, t) {
  29750. t = t || "png";
  29751. var i = new o.Texture;
  29752. return i.image = document.createElement("img"),
  29753. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29754. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  29755. i.magFilter = o.LinearFilter,
  29756. i.generateMipmaps = !1),
  29757. i.needsUpdate = !0,
  29758. i
  29759. },
  29760. isLoaded: function(e) {
  29761. return !!s[e]
  29762. }
  29763. }
  29764. window.Texture = t.exports
  29765. }
  29766. , {
  29767. "../settings": 166,
  29768. "../util/ajax": 181,
  29769. three: 217
  29770. }],
  29771. 195: [function(e, t, i) {
  29772. "use strict";
  29773. var l = e("./easing");
  29774. window.transitions = t.exports = {
  29775. globalDone: null,
  29776. funcs: [],
  29777. counter: 0,
  29778. uniqueID: 0,
  29779. start: function(e, t, i, n, r, o, a) {
  29780. return n = n || 0,
  29781. this.funcs.push({
  29782. func: e,
  29783. current: -n * Math.abs(t),
  29784. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29785. done: i,
  29786. easing: r || l.linearTween,
  29787. cycling: t < 0,
  29788. running: !0,
  29789. debug: n < 0,
  29790. name: o || "T" + this.counter,
  29791. id: void 0 === a ? this.counter : a,
  29792. paused: !1
  29793. }),
  29794. e(0, 16),
  29795. this.counter += 1,
  29796. e
  29797. },
  29798. trigger: function(e) {
  29799. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29800. , i = e.func || function() {}
  29801. , n = void 0 === e.duration ? 0 : e.duration;
  29802. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29803. var r = e.done || null
  29804. , o = e.easing || l.linearTween
  29805. , a = e.name || "R" + this.counter
  29806. , s = void 0 === e.id ? this.counter : e.id;
  29807. return this.start(i, n, r, t, o, a, s)
  29808. },
  29809. setTimeout: function(e, t, i) {
  29810. var n = void 0 === i ? this.counter : i;
  29811. return this.trigger({
  29812. done: e,
  29813. duration: void 0 === t ? 0 : t,
  29814. name: "O" + this.counter,
  29815. id: n
  29816. })
  29817. },
  29818. pause: function() {
  29819. this.paused = !0
  29820. },
  29821. resume: function() {
  29822. this.paused = !1
  29823. },
  29824. update: function(n) {
  29825. this.funcs.forEach(function(e) {
  29826. if (!(e.paused || (e.current += 1e3 * n,
  29827. e.current < 0)))
  29828. if (e.current >= e.duration && !e.cycling) {
  29829. var t = e.easing(1, 0, 1, 1);
  29830. e.func(t, 1e3 * n),
  29831. e.done && e.done(),
  29832. e.running = !1
  29833. } else {
  29834. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29835. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29836. e.running = !1)
  29837. }
  29838. });
  29839. var e = this.funcs.length;
  29840. this.funcs = this.funcs.filter(function(e) {
  29841. return e.running
  29842. });
  29843. var t = this.funcs.length;
  29844. if (0 < e && 0 === t && this.globalDone) {
  29845. var i = this.globalDone;
  29846. this.globalDone = null,
  29847. i()
  29848. }
  29849. },
  29850. adjustSpeed: function(e, t) {
  29851. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29852. var r = i[n];
  29853. r.duration /= t,
  29854. r.current /= t
  29855. }
  29856. },
  29857. getById: function(t) {
  29858. return this.funcs.filter(function(e) {
  29859. return t === e.id
  29860. })
  29861. },
  29862. get: function(e) {
  29863. for (var t = 0; t < this.funcs.length; t += 1)
  29864. if (this.funcs[t].func === e)
  29865. return this.funcs[t];
  29866. return null
  29867. },
  29868. isRunning: function(e) {
  29869. var t = this.get(e);
  29870. return null !== t && t.running
  29871. },
  29872. countActive: function() {
  29873. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29874. e += this.funcs[t].running;
  29875. return e
  29876. },
  29877. listActive: function() {
  29878. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29879. this.funcs[t].running && e.push(this.funcs[t].name);
  29880. return e
  29881. },
  29882. done: function(e) {
  29883. this.globalDone = e
  29884. },
  29885. cancelById: function(e) {
  29886. var t = void 0 === e ? 0 : e;
  29887. this.funcs = this.funcs.filter(function(e) {
  29888. return e.id !== t
  29889. })
  29890. },
  29891. cancel: function(t) {
  29892. this.funcs = this.funcs.filter(function(e) {
  29893. return e.func !== t
  29894. })
  29895. },
  29896. getUniqueId: function() {
  29897. return this.uniqueID -= 1,
  29898. this.uniqueID
  29899. }
  29900. }
  29901. }
  29902. , {
  29903. "./easing": 186
  29904. }],
  29905. 196: [function(e, t, i) {
  29906. function n(e) {
  29907. if (this.set = {},
  29908. this.infContains = function() {
  29909. return !0
  29910. }
  29911. ,
  29912. "object" == typeof e)
  29913. if (e instanceof Array)
  29914. for (var t = 0; t < e.length; t++)
  29915. this.set[e[t]] = !0;
  29916. else
  29917. this.set = e;
  29918. else if ("function" == typeof e)
  29919. this.infContains = e;
  29920. else if (void 0 !== e)
  29921. throw new Error("set must be either an array or an object.")
  29922. }
  29923. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29924. return !!this.set[e]
  29925. }
  29926. ,
  29927. n.prototype.add = function(e) {
  29928. if (1 == arguments.length)
  29929. this.set[e] = !0;
  29930. else
  29931. for (var t = 0; t < arguments.length; t++)
  29932. this.set[arguments[t]] = !0
  29933. }
  29934. ,
  29935. n.prototype.addAll = function(e) {
  29936. if ("object" != typeof e && !(e instanceof Array))
  29937. throw new Error("arr must be an array.");
  29938. for (var t = 0; t < e.length; t++)
  29939. this.add(e[t])
  29940. }
  29941. ,
  29942. n.prototype.delete = n.prototype.remove = function(e) {
  29943. if (1 == arguments.length)
  29944. delete this.set[e];
  29945. else
  29946. for (var t = 0; t < arguments.length; t++)
  29947. delete this.set[arguments[t]]
  29948. }
  29949. ,
  29950. n.prototype.clear = function() {
  29951. this.set = {}
  29952. }
  29953. ,
  29954. n.prototype.size = function() {
  29955. return Object.keys(this.set).length
  29956. }
  29957. ,
  29958. n.prototype.toString = function() {
  29959. return "{" + Object.keys(this.set).toString() + "}"
  29960. }
  29961. ,
  29962. n.prototype["*values"] = n.prototype.toArray = function() {
  29963. return void 0 === this.set ? [] : Object.keys(this.set)
  29964. }
  29965. }
  29966. , {}],
  29967. 197: [function(e, t, i) {}
  29968. , {}],
  29969. 198: [function(N, e, F) {
  29970. (function(e) {
  29971. "use strict";
  29972. function i() {
  29973. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29974. }
  29975. function o(e, t) {
  29976. if (i() < t)
  29977. throw new RangeError("Invalid typed array length");
  29978. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  29979. e.length = t),
  29980. e
  29981. }
  29982. function u(e, t, i) {
  29983. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  29984. return new u(e,t,i);
  29985. if ("number" != typeof e)
  29986. return n(this, e, t, i);
  29987. if ("string" == typeof t)
  29988. throw new Error("If encoding is specified then the first argument must be a string");
  29989. return a(this, e)
  29990. }
  29991. function n(e, t, i, n) {
  29992. if ("number" == typeof t)
  29993. throw new TypeError('"value" argument must not be a number');
  29994. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  29995. if (t.byteLength,
  29996. i < 0 || t.byteLength < i)
  29997. throw new RangeError("'offset' is out of bounds");
  29998. if (t.byteLength < i + (n || 0))
  29999. throw new RangeError("'length' is out of bounds");
  30000. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  30001. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  30002. e
  30003. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  30004. if ("string" == typeof i && "" !== i || (i = "utf8"),
  30005. !u.isEncoding(i))
  30006. throw new TypeError('"encoding" must be a valid string encoding');
  30007. var n = 0 | c(t, i)
  30008. , r = (e = o(e, n)).write(t, i);
  30009. return r !== n && (e = e.slice(0, r)),
  30010. e
  30011. }(e, t, i) : function(e, t) {
  30012. if (u.isBuffer(t)) {
  30013. var i = 0 | l(t.length);
  30014. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  30015. e
  30016. }
  30017. if (t) {
  30018. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  30019. return "number" != typeof t.length || function(e) {
  30020. return e != e
  30021. }(t.length) ? o(e, 0) : s(e, t);
  30022. if ("Buffer" === t.type && L(t.data))
  30023. return s(e, t.data)
  30024. }
  30025. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  30026. }(e, t)
  30027. }
  30028. function r(e) {
  30029. if ("number" != typeof e)
  30030. throw new TypeError('"size" argument must be a number');
  30031. if (e < 0)
  30032. throw new RangeError('"size" argument must not be negative')
  30033. }
  30034. function a(e, t) {
  30035. if (r(t),
  30036. e = o(e, t < 0 ? 0 : 0 | l(t)),
  30037. !u.TYPED_ARRAY_SUPPORT)
  30038. for (var i = 0; i < t; ++i)
  30039. e[i] = 0;
  30040. return e
  30041. }
  30042. function s(e, t) {
  30043. var i = t.length < 0 ? 0 : 0 | l(t.length);
  30044. e = o(e, i);
  30045. for (var n = 0; n < i; n += 1)
  30046. e[n] = 255 & t[n];
  30047. return e
  30048. }
  30049. function l(e) {
  30050. if (e >= i())
  30051. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  30052. return 0 | e
  30053. }
  30054. function c(e, t) {
  30055. if (u.isBuffer(e))
  30056. return e.length;
  30057. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  30058. return e.byteLength;
  30059. "string" != typeof e && (e = "" + e);
  30060. var i = e.length;
  30061. if (0 === i)
  30062. return 0;
  30063. for (var n = !1; ; )
  30064. switch (t) {
  30065. case "ascii":
  30066. case "latin1":
  30067. case "binary":
  30068. return i;
  30069. case "utf8":
  30070. case "utf-8":
  30071. case void 0:
  30072. return S(e).length;
  30073. case "ucs2":
  30074. case "ucs-2":
  30075. case "utf16le":
  30076. case "utf-16le":
  30077. return 2 * i;
  30078. case "hex":
  30079. return i >>> 1;
  30080. case "base64":
  30081. return M(e).length;
  30082. default:
  30083. if (n)
  30084. return S(e).length;
  30085. t = ("" + t).toLowerCase(),
  30086. n = !0
  30087. }
  30088. }
  30089. function h(e, t, i) {
  30090. var n = e[t];
  30091. e[t] = e[i],
  30092. e[i] = n
  30093. }
  30094. function d(e, t, i, n, r) {
  30095. if (0 === e.length)
  30096. return -1;
  30097. if ("string" == typeof i ? (n = i,
  30098. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  30099. i = +i,
  30100. isNaN(i) && (i = r ? 0 : e.length - 1),
  30101. i < 0 && (i = e.length + i),
  30102. i >= e.length) {
  30103. if (r)
  30104. return -1;
  30105. i = e.length - 1
  30106. } else if (i < 0) {
  30107. if (!r)
  30108. return -1;
  30109. i = 0
  30110. }
  30111. if ("string" == typeof t && (t = u.from(t, n)),
  30112. u.isBuffer(t))
  30113. return 0 === t.length ? -1 : p(e, t, i, n, r);
  30114. if ("number" == typeof t)
  30115. return t &= 255,
  30116. u.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(e, t, i) : Uint8Array.prototype.lastIndexOf.call(e, t, i) : p(e, [t], i, n, r);
  30117. throw new TypeError("val must be string, number or Buffer")
  30118. }
  30119. function p(e, t, i, n, r) {
  30120. function o(e, t) {
  30121. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  30122. }
  30123. var a, s = 1, l = e.length, c = t.length;
  30124. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  30125. if (e.length < 2 || t.length < 2)
  30126. return -1;
  30127. l /= s = 2,
  30128. c /= 2,
  30129. i /= 2
  30130. }
  30131. if (r) {
  30132. var h = -1;
  30133. for (a = i; a < l; a++)
  30134. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  30135. if (-1 === h && (h = a),
  30136. a - h + 1 === c)
  30137. return h * s
  30138. } else
  30139. -1 !== h && (a -= a - h),
  30140. h = -1
  30141. } else
  30142. for (l < i + c && (i = l - c),
  30143. a = i; 0 <= a; a--) {
  30144. for (var u = !0, d = 0; d < c; d++)
  30145. if (o(e, a + d) !== o(t, d)) {
  30146. u = !1;
  30147. break
  30148. }
  30149. if (u)
  30150. return a
  30151. }
  30152. return -1
  30153. }
  30154. function g(e, t, i, n) {
  30155. i = Number(i) || 0;
  30156. var r = e.length - i;
  30157. n ? r < (n = Number(n)) && (n = r) : n = r;
  30158. var o = t.length;
  30159. if (o % 2 != 0)
  30160. throw new TypeError("Invalid hex string");
  30161. o / 2 < n && (n = o / 2);
  30162. for (var a = 0; a < n; ++a) {
  30163. var s = parseInt(t.substr(2 * a, 2), 16);
  30164. if (isNaN(s))
  30165. return a;
  30166. e[i + a] = s
  30167. }
  30168. return a
  30169. }
  30170. function m(e, t, i, n) {
  30171. return R(function(e) {
  30172. for (var t = [], i = 0; i < e.length; ++i)
  30173. t.push(255 & e.charCodeAt(i));
  30174. return t
  30175. }(t), e, i, n)
  30176. }
  30177. function f(e, t, i) {
  30178. i = Math.min(e.length, i);
  30179. for (var n = [], r = t; r < i; ) {
  30180. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  30181. if (r + u <= i)
  30182. switch (u) {
  30183. case 1:
  30184. c < 128 && (h = c);
  30185. break;
  30186. case 2:
  30187. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  30188. break;
  30189. case 3:
  30190. o = e[r + 1],
  30191. a = e[r + 2],
  30192. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  30193. break;
  30194. case 4:
  30195. o = e[r + 1],
  30196. a = e[r + 2],
  30197. s = e[r + 3],
  30198. 128 == (192 & o) && 128 == (192 & a) && 128 == (192 & s) && (65535 < (l = (15 & c) << 18 | (63 & o) << 12 | (63 & a) << 6 | 63 & s) && l < 1114112 && (h = l))
  30199. }
  30200. null === h ? (h = 65533,
  30201. u = 1) : 65535 < h && (h -= 65536,
  30202. n.push(h >>> 10 & 1023 | 55296),
  30203. h = 56320 | 1023 & h),
  30204. n.push(h),
  30205. r += u
  30206. }
  30207. return function(e) {
  30208. var t = e.length;
  30209. if (t <= D)
  30210. return String.fromCharCode.apply(String, e);
  30211. for (var i = "", n = 0; n < t; )
  30212. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  30213. return i
  30214. }(n)
  30215. }
  30216. function v(e, t, i) {
  30217. var n = "";
  30218. i = Math.min(e.length, i);
  30219. for (var r = t; r < i; ++r)
  30220. n += String.fromCharCode(127 & e[r]);
  30221. return n
  30222. }
  30223. function y(e, t, i) {
  30224. var n = "";
  30225. i = Math.min(e.length, i);
  30226. for (var r = t; r < i; ++r)
  30227. n += String.fromCharCode(e[r]);
  30228. return n
  30229. }
  30230. function A(e, t, i) {
  30231. var n, r = e.length;
  30232. (!t || t < 0) && (t = 0),
  30233. (!i || i < 0 || r < i) && (i = r);
  30234. for (var o = "", a = t; a < i; ++a)
  30235. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  30236. return o
  30237. }
  30238. function C(e, t, i) {
  30239. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  30240. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  30241. return r
  30242. }
  30243. function I(e, t, i) {
  30244. if (e % 1 != 0 || e < 0)
  30245. throw new RangeError("offset is not uint");
  30246. if (i < e + t)
  30247. throw new RangeError("Trying to access beyond buffer length")
  30248. }
  30249. function E(e, t, i, n, r, o) {
  30250. if (!u.isBuffer(e))
  30251. throw new TypeError('"buffer" argument must be a Buffer instance');
  30252. if (r < t || t < o)
  30253. throw new RangeError('"value" argument is out of bounds');
  30254. if (i + n > e.length)
  30255. throw new RangeError("Index out of range")
  30256. }
  30257. function _(e, t, i, n) {
  30258. t < 0 && (t = 65535 + t + 1);
  30259. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  30260. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  30261. }
  30262. function b(e, t, i, n) {
  30263. t < 0 && (t = 4294967295 + t + 1);
  30264. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  30265. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  30266. }
  30267. function w(e, t, i, n) {
  30268. if (i + n > e.length)
  30269. throw new RangeError("Index out of range");
  30270. if (i < 0)
  30271. throw new RangeError("Index out of range")
  30272. }
  30273. function T(e, t, i, n, r) {
  30274. return r || w(e, 0, i, 4),
  30275. O.write(e, t, i, n, 23, 4),
  30276. i + 4
  30277. }
  30278. function x(e, t, i, n, r) {
  30279. return r || w(e, 0, i, 8),
  30280. O.write(e, t, i, n, 52, 8),
  30281. i + 8
  30282. }
  30283. function S(e, t) {
  30284. t = t || 1 / 0;
  30285. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  30286. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  30287. if (!r) {
  30288. if (56319 < i) {
  30289. -1 < (t -= 3) && o.push(239, 191, 189);
  30290. continue
  30291. }
  30292. if (a + 1 === n) {
  30293. -1 < (t -= 3) && o.push(239, 191, 189);
  30294. continue
  30295. }
  30296. r = i;
  30297. continue
  30298. }
  30299. if (i < 56320) {
  30300. -1 < (t -= 3) && o.push(239, 191, 189),
  30301. r = i;
  30302. continue
  30303. }
  30304. i = 65536 + (r - 55296 << 10 | i - 56320)
  30305. } else
  30306. r && -1 < (t -= 3) && o.push(239, 191, 189);
  30307. if (r = null,
  30308. i < 128) {
  30309. if ((t -= 1) < 0)
  30310. break;
  30311. o.push(i)
  30312. } else if (i < 2048) {
  30313. if ((t -= 2) < 0)
  30314. break;
  30315. o.push(i >> 6 | 192, 63 & i | 128)
  30316. } else if (i < 65536) {
  30317. if ((t -= 3) < 0)
  30318. break;
  30319. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  30320. } else {
  30321. if (!(i < 1114112))
  30322. throw new Error("Invalid code point");
  30323. if ((t -= 4) < 0)
  30324. break;
  30325. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  30326. }
  30327. }
  30328. return o
  30329. }
  30330. function M(e) {
  30331. return P.toByteArray(function(e) {
  30332. if ((e = function(e) {
  30333. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  30334. }(e).replace(t, "")).length < 2)
  30335. return "";
  30336. for (; e.length % 4 != 0; )
  30337. e += "=";
  30338. return e
  30339. }(e))
  30340. }
  30341. function R(e, t, i, n) {
  30342. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  30343. t[r + i] = e[r];
  30344. return r
  30345. }
  30346. var P = N("base64-js")
  30347. , O = N("ieee754")
  30348. , L = N("isarray");
  30349. F.Buffer = u,
  30350. F.SlowBuffer = function(e) {
  30351. return +e != e && (e = 0),
  30352. u.alloc(+e)
  30353. }
  30354. ,
  30355. F.INSPECT_MAX_BYTES = 50,
  30356. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  30357. try {
  30358. var e = new Uint8Array(1);
  30359. return e.__proto__ = {
  30360. __proto__: Uint8Array.prototype,
  30361. foo: function() {
  30362. return 42
  30363. }
  30364. },
  30365. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  30366. } catch (e) {
  30367. return !1
  30368. }
  30369. }(),
  30370. F.kMaxLength = i(),
  30371. u.poolSize = 8192,
  30372. u._augment = function(e) {
  30373. return e.__proto__ = u.prototype,
  30374. e
  30375. }
  30376. ,
  30377. u.from = function(e, t, i) {
  30378. return n(null, e, t, i)
  30379. }
  30380. ,
  30381. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  30382. u.__proto__ = Uint8Array,
  30383. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  30384. value: null,
  30385. configurable: !0
  30386. })),
  30387. u.alloc = function(e, t, i) {
  30388. return function(e, t, i, n) {
  30389. return r(t),
  30390. 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)
  30391. }(null, e, t, i)
  30392. }
  30393. ,
  30394. u.allocUnsafe = function(e) {
  30395. return a(null, e)
  30396. }
  30397. ,
  30398. u.allocUnsafeSlow = function(e) {
  30399. return a(null, e)
  30400. }
  30401. ,
  30402. u.isBuffer = function(e) {
  30403. return !(null == e || !e._isBuffer)
  30404. }
  30405. ,
  30406. u.compare = function(e, t) {
  30407. if (!u.isBuffer(e) || !u.isBuffer(t))
  30408. throw new TypeError("Arguments must be Buffers");
  30409. if (e === t)
  30410. return 0;
  30411. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  30412. if (e[r] !== t[r]) {
  30413. i = e[r],
  30414. n = t[r];
  30415. break
  30416. }
  30417. return i < n ? -1 : n < i ? 1 : 0
  30418. }
  30419. ,
  30420. u.isEncoding = function(e) {
  30421. switch (String(e).toLowerCase()) {
  30422. case "hex":
  30423. case "utf8":
  30424. case "utf-8":
  30425. case "ascii":
  30426. case "latin1":
  30427. case "binary":
  30428. case "base64":
  30429. case "ucs2":
  30430. case "ucs-2":
  30431. case "utf16le":
  30432. case "utf-16le":
  30433. return !0;
  30434. default:
  30435. return !1
  30436. }
  30437. }
  30438. ,
  30439. u.concat = function(e, t) {
  30440. if (!L(e))
  30441. throw new TypeError('"list" argument must be an Array of Buffers');
  30442. if (0 === e.length)
  30443. return u.alloc(0);
  30444. var i;
  30445. if (void 0 === t)
  30446. for (i = t = 0; i < e.length; ++i)
  30447. t += e[i].length;
  30448. var n = u.allocUnsafe(t)
  30449. , r = 0;
  30450. for (i = 0; i < e.length; ++i) {
  30451. var o = e[i];
  30452. if (!u.isBuffer(o))
  30453. throw new TypeError('"list" argument must be an Array of Buffers');
  30454. o.copy(n, r),
  30455. r += o.length
  30456. }
  30457. return n
  30458. }
  30459. ,
  30460. u.byteLength = c,
  30461. u.prototype._isBuffer = !0,
  30462. u.prototype.swap16 = function() {
  30463. var e = this.length;
  30464. if (e % 2 != 0)
  30465. throw new RangeError("Buffer size must be a multiple of 16-bits");
  30466. for (var t = 0; t < e; t += 2)
  30467. h(this, t, t + 1);
  30468. return this
  30469. }
  30470. ,
  30471. u.prototype.swap32 = function() {
  30472. var e = this.length;
  30473. if (e % 4 != 0)
  30474. throw new RangeError("Buffer size must be a multiple of 32-bits");
  30475. for (var t = 0; t < e; t += 4)
  30476. h(this, t, t + 3),
  30477. h(this, t + 1, t + 2);
  30478. return this
  30479. }
  30480. ,
  30481. u.prototype.swap64 = function() {
  30482. var e = this.length;
  30483. if (e % 8 != 0)
  30484. throw new RangeError("Buffer size must be a multiple of 64-bits");
  30485. for (var t = 0; t < e; t += 8)
  30486. h(this, t, t + 7),
  30487. h(this, t + 1, t + 6),
  30488. h(this, t + 2, t + 5),
  30489. h(this, t + 3, t + 4);
  30490. return this
  30491. }
  30492. ,
  30493. u.prototype.toString = function() {
  30494. var e = 0 | this.length;
  30495. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  30496. var n, r, o, a = !1;
  30497. if ((void 0 === t || t < 0) && (t = 0),
  30498. t > this.length)
  30499. return "";
  30500. if ((void 0 === i || i > this.length) && (i = this.length),
  30501. i <= 0)
  30502. return "";
  30503. if ((i >>>= 0) <= (t >>>= 0))
  30504. return "";
  30505. for (e = e || "utf8"; ; )
  30506. switch (e) {
  30507. case "hex":
  30508. return A(this, t, i);
  30509. case "utf8":
  30510. case "utf-8":
  30511. return f(this, t, i);
  30512. case "ascii":
  30513. return v(this, t, i);
  30514. case "latin1":
  30515. case "binary":
  30516. return y(this, t, i);
  30517. case "base64":
  30518. return n = this,
  30519. o = i,
  30520. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  30521. case "ucs2":
  30522. case "ucs-2":
  30523. case "utf16le":
  30524. case "utf-16le":
  30525. return C(this, t, i);
  30526. default:
  30527. if (a)
  30528. throw new TypeError("Unknown encoding: " + e);
  30529. e = (e + "").toLowerCase(),
  30530. a = !0
  30531. }
  30532. }
  30533. .apply(this, arguments)
  30534. }
  30535. ,
  30536. u.prototype.equals = function(e) {
  30537. if (!u.isBuffer(e))
  30538. throw new TypeError("Argument must be a Buffer");
  30539. return this === e || 0 === u.compare(this, e)
  30540. }
  30541. ,
  30542. u.prototype.inspect = function() {
  30543. var e = ""
  30544. , t = F.INSPECT_MAX_BYTES;
  30545. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  30546. this.length > t && (e += " ... ")),
  30547. "<Buffer " + e + ">"
  30548. }
  30549. ,
  30550. u.prototype.compare = function(e, t, i, n, r) {
  30551. if (!u.isBuffer(e))
  30552. throw new TypeError("Argument must be a Buffer");
  30553. if (void 0 === t && (t = 0),
  30554. void 0 === i && (i = e ? e.length : 0),
  30555. void 0 === n && (n = 0),
  30556. void 0 === r && (r = this.length),
  30557. t < 0 || i > e.length || n < 0 || r > this.length)
  30558. throw new RangeError("out of range index");
  30559. if (r <= n && i <= t)
  30560. return 0;
  30561. if (r <= n)
  30562. return -1;
  30563. if (i <= t)
  30564. return 1;
  30565. if (this === e)
  30566. return 0;
  30567. for (var o = (r >>>= 0) - (n >>>= 0), a = (i >>>= 0) - (t >>>= 0), s = Math.min(o, a), l = this.slice(n, r), c = e.slice(t, i), h = 0; h < s; ++h)
  30568. if (l[h] !== c[h]) {
  30569. o = l[h],
  30570. a = c[h];
  30571. break
  30572. }
  30573. return o < a ? -1 : a < o ? 1 : 0
  30574. }
  30575. ,
  30576. u.prototype.includes = function(e, t, i) {
  30577. return -1 !== this.indexOf(e, t, i)
  30578. }
  30579. ,
  30580. u.prototype.indexOf = function(e, t, i) {
  30581. return d(this, e, t, i, !0)
  30582. }
  30583. ,
  30584. u.prototype.lastIndexOf = function(e, t, i) {
  30585. return d(this, e, t, i, !1)
  30586. }
  30587. ,
  30588. u.prototype.write = function(e, t, i, n) {
  30589. if (void 0 === t)
  30590. n = "utf8",
  30591. i = this.length,
  30592. t = 0;
  30593. else if (void 0 === i && "string" == typeof t)
  30594. n = t,
  30595. i = this.length,
  30596. t = 0;
  30597. else {
  30598. if (!isFinite(t))
  30599. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30600. t |= 0,
  30601. isFinite(i) ? (i |= 0,
  30602. void 0 === n && (n = "utf8")) : (n = i,
  30603. i = void 0)
  30604. }
  30605. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  30606. if ((void 0 === i || p < i) && (i = p),
  30607. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  30608. throw new RangeError("Attempt to write outside buffer bounds");
  30609. n = n || "utf8";
  30610. for (var f = !1; ; )
  30611. switch (n) {
  30612. case "hex":
  30613. return g(this, e, t, i);
  30614. case "utf8":
  30615. case "utf-8":
  30616. return u = t,
  30617. d = i,
  30618. R(S(e, (h = this).length - u), h, u, d);
  30619. case "ascii":
  30620. return m(this, e, t, i);
  30621. case "latin1":
  30622. case "binary":
  30623. return m(this, e, t, i);
  30624. case "base64":
  30625. return s = this,
  30626. l = t,
  30627. c = i,
  30628. R(M(e), s, l, c);
  30629. case "ucs2":
  30630. case "ucs-2":
  30631. case "utf16le":
  30632. case "utf-16le":
  30633. return o = t,
  30634. a = i,
  30635. R(function(e, t) {
  30636. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30637. i = e.charCodeAt(a),
  30638. n = i >> 8,
  30639. r = i % 256,
  30640. o.push(r),
  30641. o.push(n);
  30642. return o
  30643. }(e, (r = this).length - o), r, o, a);
  30644. default:
  30645. if (f)
  30646. throw new TypeError("Unknown encoding: " + n);
  30647. n = ("" + n).toLowerCase(),
  30648. f = !0
  30649. }
  30650. }
  30651. ,
  30652. u.prototype.toJSON = function() {
  30653. return {
  30654. type: "Buffer",
  30655. data: Array.prototype.slice.call(this._arr || this, 0)
  30656. }
  30657. }
  30658. ;
  30659. var D = 4096;
  30660. u.prototype.slice = function(e, t) {
  30661. var i, n = this.length;
  30662. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  30663. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  30664. t < e && (t = e),
  30665. u.TYPED_ARRAY_SUPPORT)
  30666. (i = this.subarray(e, t)).__proto__ = u.prototype;
  30667. else {
  30668. var r = t - e;
  30669. i = new u(r,void 0);
  30670. for (var o = 0; o < r; ++o)
  30671. i[o] = this[o + e]
  30672. }
  30673. return i
  30674. }
  30675. ,
  30676. u.prototype.readUIntLE = function(e, t, i) {
  30677. e |= 0,
  30678. t |= 0,
  30679. i || I(e, t, this.length);
  30680. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30681. n += this[e + o] * r;
  30682. return n
  30683. }
  30684. ,
  30685. u.prototype.readUIntBE = function(e, t, i) {
  30686. e |= 0,
  30687. t |= 0,
  30688. i || I(e, t, this.length);
  30689. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  30690. n += this[e + --t] * r;
  30691. return n
  30692. }
  30693. ,
  30694. u.prototype.readUInt8 = function(e, t) {
  30695. return t || I(e, 1, this.length),
  30696. this[e]
  30697. }
  30698. ,
  30699. u.prototype.readUInt16LE = function(e, t) {
  30700. return t || I(e, 2, this.length),
  30701. this[e] | this[e + 1] << 8
  30702. }
  30703. ,
  30704. u.prototype.readUInt16BE = function(e, t) {
  30705. return t || I(e, 2, this.length),
  30706. this[e] << 8 | this[e + 1]
  30707. }
  30708. ,
  30709. u.prototype.readUInt32LE = function(e, t) {
  30710. return t || I(e, 4, this.length),
  30711. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30712. }
  30713. ,
  30714. u.prototype.readUInt32BE = function(e, t) {
  30715. return t || I(e, 4, this.length),
  30716. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30717. }
  30718. ,
  30719. u.prototype.readIntLE = function(e, t, i) {
  30720. e |= 0,
  30721. t |= 0,
  30722. i || I(e, t, this.length);
  30723. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30724. n += this[e + o] * r;
  30725. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  30726. n
  30727. }
  30728. ,
  30729. u.prototype.readIntBE = function(e, t, i) {
  30730. e |= 0,
  30731. t |= 0,
  30732. i || I(e, t, this.length);
  30733. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  30734. o += this[e + --n] * r;
  30735. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  30736. o
  30737. }
  30738. ,
  30739. u.prototype.readInt8 = function(e, t) {
  30740. return t || I(e, 1, this.length),
  30741. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30742. }
  30743. ,
  30744. u.prototype.readInt16LE = function(e, t) {
  30745. t || I(e, 2, this.length);
  30746. var i = this[e] | this[e + 1] << 8;
  30747. return 32768 & i ? 4294901760 | i : i
  30748. }
  30749. ,
  30750. u.prototype.readInt16BE = function(e, t) {
  30751. t || I(e, 2, this.length);
  30752. var i = this[e + 1] | this[e] << 8;
  30753. return 32768 & i ? 4294901760 | i : i
  30754. }
  30755. ,
  30756. u.prototype.readInt32LE = function(e, t) {
  30757. return t || I(e, 4, this.length),
  30758. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30759. }
  30760. ,
  30761. u.prototype.readInt32BE = function(e, t) {
  30762. return t || I(e, 4, this.length),
  30763. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30764. }
  30765. ,
  30766. u.prototype.readFloatLE = function(e, t) {
  30767. return t || I(e, 4, this.length),
  30768. O.read(this, e, !0, 23, 4)
  30769. }
  30770. ,
  30771. u.prototype.readFloatBE = function(e, t) {
  30772. return t || I(e, 4, this.length),
  30773. O.read(this, e, !1, 23, 4)
  30774. }
  30775. ,
  30776. u.prototype.readDoubleLE = function(e, t) {
  30777. return t || I(e, 8, this.length),
  30778. O.read(this, e, !0, 52, 8)
  30779. }
  30780. ,
  30781. u.prototype.readDoubleBE = function(e, t) {
  30782. return t || I(e, 8, this.length),
  30783. O.read(this, e, !1, 52, 8)
  30784. }
  30785. ,
  30786. u.prototype.writeUIntLE = function(e, t, i, n) {
  30787. e = +e,
  30788. t |= 0,
  30789. i |= 0,
  30790. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30791. var r = 1
  30792. , o = 0;
  30793. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30794. this[t + o] = e / r & 255;
  30795. return t + i
  30796. }
  30797. ,
  30798. u.prototype.writeUIntBE = function(e, t, i, n) {
  30799. e = +e,
  30800. t |= 0,
  30801. i |= 0,
  30802. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30803. var r = i - 1
  30804. , o = 1;
  30805. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30806. this[t + r] = e / o & 255;
  30807. return t + i
  30808. }
  30809. ,
  30810. u.prototype.writeUInt8 = function(e, t, i) {
  30811. return e = +e,
  30812. t |= 0,
  30813. i || E(this, e, t, 1, 255, 0),
  30814. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30815. this[t] = 255 & e,
  30816. t + 1
  30817. }
  30818. ,
  30819. u.prototype.writeUInt16LE = function(e, t, i) {
  30820. return e = +e,
  30821. t |= 0,
  30822. i || E(this, e, t, 2, 65535, 0),
  30823. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30824. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30825. t + 2
  30826. }
  30827. ,
  30828. u.prototype.writeUInt16BE = function(e, t, i) {
  30829. return e = +e,
  30830. t |= 0,
  30831. i || E(this, e, t, 2, 65535, 0),
  30832. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30833. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30834. t + 2
  30835. }
  30836. ,
  30837. u.prototype.writeUInt32LE = function(e, t, i) {
  30838. return e = +e,
  30839. t |= 0,
  30840. i || E(this, e, t, 4, 4294967295, 0),
  30841. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30842. this[t + 2] = e >>> 16,
  30843. this[t + 1] = e >>> 8,
  30844. this[t] = 255 & e) : b(this, e, t, !0),
  30845. t + 4
  30846. }
  30847. ,
  30848. u.prototype.writeUInt32BE = function(e, t, i) {
  30849. return e = +e,
  30850. t |= 0,
  30851. i || E(this, e, t, 4, 4294967295, 0),
  30852. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30853. this[t + 1] = e >>> 16,
  30854. this[t + 2] = e >>> 8,
  30855. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30856. t + 4
  30857. }
  30858. ,
  30859. u.prototype.writeIntLE = function(e, t, i, n) {
  30860. if (e = +e,
  30861. t |= 0,
  30862. !n) {
  30863. var r = Math.pow(2, 8 * i - 1);
  30864. E(this, e, t, i, r - 1, -r)
  30865. }
  30866. var o = 0
  30867. , a = 1
  30868. , s = 0;
  30869. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30870. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30871. this[t + o] = (e / a >> 0) - s & 255;
  30872. return t + i
  30873. }
  30874. ,
  30875. u.prototype.writeIntBE = function(e, t, i, n) {
  30876. if (e = +e,
  30877. t |= 0,
  30878. !n) {
  30879. var r = Math.pow(2, 8 * i - 1);
  30880. E(this, e, t, i, r - 1, -r)
  30881. }
  30882. var o = i - 1
  30883. , a = 1
  30884. , s = 0;
  30885. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30886. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30887. this[t + o] = (e / a >> 0) - s & 255;
  30888. return t + i
  30889. }
  30890. ,
  30891. u.prototype.writeInt8 = function(e, t, i) {
  30892. return e = +e,
  30893. t |= 0,
  30894. i || E(this, e, t, 1, 127, -128),
  30895. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30896. e < 0 && (e = 255 + e + 1),
  30897. this[t] = 255 & e,
  30898. t + 1
  30899. }
  30900. ,
  30901. u.prototype.writeInt16LE = function(e, t, i) {
  30902. return e = +e,
  30903. t |= 0,
  30904. i || E(this, e, t, 2, 32767, -32768),
  30905. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30906. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30907. t + 2
  30908. }
  30909. ,
  30910. u.prototype.writeInt16BE = function(e, t, i) {
  30911. return e = +e,
  30912. t |= 0,
  30913. i || E(this, e, t, 2, 32767, -32768),
  30914. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30915. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30916. t + 2
  30917. }
  30918. ,
  30919. u.prototype.writeInt32LE = function(e, t, i) {
  30920. return e = +e,
  30921. t |= 0,
  30922. i || E(this, e, t, 4, 2147483647, -2147483648),
  30923. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30924. this[t + 1] = e >>> 8,
  30925. this[t + 2] = e >>> 16,
  30926. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30927. t + 4
  30928. }
  30929. ,
  30930. u.prototype.writeInt32BE = function(e, t, i) {
  30931. return e = +e,
  30932. t |= 0,
  30933. i || E(this, e, t, 4, 2147483647, -2147483648),
  30934. e < 0 && (e = 4294967295 + e + 1),
  30935. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30936. this[t + 1] = e >>> 16,
  30937. this[t + 2] = e >>> 8,
  30938. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30939. t + 4
  30940. }
  30941. ,
  30942. u.prototype.writeFloatLE = function(e, t, i) {
  30943. return T(this, e, t, !0, i)
  30944. }
  30945. ,
  30946. u.prototype.writeFloatBE = function(e, t, i) {
  30947. return T(this, e, t, !1, i)
  30948. }
  30949. ,
  30950. u.prototype.writeDoubleLE = function(e, t, i) {
  30951. return x(this, e, t, !0, i)
  30952. }
  30953. ,
  30954. u.prototype.writeDoubleBE = function(e, t, i) {
  30955. return x(this, e, t, !1, i)
  30956. }
  30957. ,
  30958. u.prototype.copy = function(e, t, i, n) {
  30959. if (i = i || 0,
  30960. n || 0 === n || (n = this.length),
  30961. t >= e.length && (t = e.length),
  30962. t = t || 0,
  30963. 0 < n && n < i && (n = i),
  30964. n === i)
  30965. return 0;
  30966. if (0 === e.length || 0 === this.length)
  30967. return 0;
  30968. if (t < 0)
  30969. throw new RangeError("targetStart out of bounds");
  30970. if (i < 0 || i >= this.length)
  30971. throw new RangeError("sourceStart out of bounds");
  30972. if (n < 0)
  30973. throw new RangeError("sourceEnd out of bounds");
  30974. n > this.length && (n = this.length),
  30975. e.length - t < n - i && (n = e.length - t + i);
  30976. var r, o = n - i;
  30977. if (this === e && i < t && t < n)
  30978. for (r = o - 1; 0 <= r; --r)
  30979. e[r + t] = this[r + i];
  30980. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  30981. for (r = 0; r < o; ++r)
  30982. e[r + t] = this[r + i];
  30983. else
  30984. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30985. return o
  30986. }
  30987. ,
  30988. u.prototype.fill = function(e, t, i, n) {
  30989. if ("string" == typeof e) {
  30990. if ("string" == typeof t ? (n = t,
  30991. t = 0,
  30992. i = this.length) : "string" == typeof i && (n = i,
  30993. i = this.length),
  30994. 1 === e.length) {
  30995. var r = e.charCodeAt(0);
  30996. r < 256 && (e = r)
  30997. }
  30998. if (void 0 !== n && "string" != typeof n)
  30999. throw new TypeError("encoding must be a string");
  31000. if ("string" == typeof n && !u.isEncoding(n))
  31001. throw new TypeError("Unknown encoding: " + n)
  31002. } else
  31003. "number" == typeof e && (e &= 255);
  31004. if (t < 0 || this.length < t || this.length < i)
  31005. throw new RangeError("Out of range index");
  31006. if (i <= t)
  31007. return this;
  31008. var o;
  31009. if (t >>>= 0,
  31010. i = void 0 === i ? this.length : i >>> 0,
  31011. "number" == typeof (e = e || 0))
  31012. for (o = t; o < i; ++o)
  31013. this[o] = e;
  31014. else {
  31015. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  31016. , s = a.length;
  31017. for (o = 0; o < i - t; ++o)
  31018. this[o + t] = a[o % s]
  31019. }
  31020. return this
  31021. }
  31022. ;
  31023. var t = /[^+\/0-9A-Za-z-_]/g
  31024. }
  31025. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31026. }
  31027. , {
  31028. "base64-js": 199,
  31029. ieee754: 200,
  31030. isarray: 201
  31031. }],
  31032. 199: [function(e, t, i) {
  31033. "use strict";
  31034. function l(e) {
  31035. var t = e.length;
  31036. if (0 < t % 4)
  31037. throw new Error("Invalid string. Length must be a multiple of 4");
  31038. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  31039. }
  31040. function c(e, t, i) {
  31041. for (var n, r = [], o = t; o < i; o += 3)
  31042. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  31043. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  31044. var a;
  31045. return r.join("")
  31046. }
  31047. i.byteLength = function(e) {
  31048. return 3 * e.length / 4 - l(e)
  31049. }
  31050. ,
  31051. i.toByteArray = function(e) {
  31052. var t, i, n, r, o, a = e.length;
  31053. r = l(e),
  31054. o = new d(3 * a / 4 - r),
  31055. i = 0 < r ? a - 4 : a;
  31056. var s = 0;
  31057. for (t = 0; t < i; t += 4,
  31058. 3)
  31059. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  31060. o[s++] = n >> 16 & 255,
  31061. o[s++] = n >> 8 & 255,
  31062. o[s++] = 255 & n;
  31063. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  31064. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  31065. o[s++] = n >> 8 & 255,
  31066. o[s++] = 255 & n),
  31067. o
  31068. }
  31069. ,
  31070. i.fromByteArray = function(e) {
  31071. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  31072. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  31073. return 1 == n ? (t = e[i - 1],
  31074. r += h[t >> 2],
  31075. r += h[t << 4 & 63],
  31076. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  31077. r += h[t >> 10],
  31078. r += h[t >> 4 & 63],
  31079. r += h[t << 2 & 63],
  31080. r += "="),
  31081. o.push(r),
  31082. o.join("")
  31083. }
  31084. ;
  31085. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  31086. h[r] = n[r],
  31087. u[n.charCodeAt(r)] = r;
  31088. u["-".charCodeAt(0)] = 62,
  31089. u["_".charCodeAt(0)] = 63
  31090. }
  31091. , {}],
  31092. 200: [function(e, t, i) {
  31093. i.read = function(e, t, i, n, r) {
  31094. 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];
  31095. for (u += d,
  31096. o = p & (1 << -h) - 1,
  31097. p >>= -h,
  31098. h += s; 0 < h; o = 256 * o + e[t + u],
  31099. u += d,
  31100. h -= 8)
  31101. ;
  31102. for (a = o & (1 << -h) - 1,
  31103. o >>= -h,
  31104. h += n; 0 < h; a = 256 * a + e[t + u],
  31105. u += d,
  31106. h -= 8)
  31107. ;
  31108. if (0 === o)
  31109. o = 1 - c;
  31110. else {
  31111. if (o === l)
  31112. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  31113. a += Math.pow(2, n),
  31114. o -= c
  31115. }
  31116. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  31117. }
  31118. ,
  31119. i.write = function(e, t, i, n, r, o) {
  31120. 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;
  31121. for (t = Math.abs(t),
  31122. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  31123. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  31124. t * (l = Math.pow(2, -a)) < 1 && (a--,
  31125. l *= 2),
  31126. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  31127. l /= 2),
  31128. h <= a + u ? (s = 0,
  31129. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  31130. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  31131. a = 0)); 8 <= r; e[i + p] = 255 & s,
  31132. p += f,
  31133. s /= 256,
  31134. r -= 8)
  31135. ;
  31136. for (a = a << r | s,
  31137. c += r; 0 < c; e[i + p] = 255 & a,
  31138. p += f,
  31139. a /= 256,
  31140. c -= 8)
  31141. ;
  31142. e[i + p - f] |= 128 * g
  31143. }
  31144. }
  31145. , {}],
  31146. 201: [function(e, t, i) {
  31147. var n = {}.toString;
  31148. t.exports = Array.isArray || function(e) {
  31149. return "[object Array]" == n.call(e)
  31150. }
  31151. }
  31152. , {}],
  31153. 202: [function(e, t, i) {
  31154. function n() {
  31155. this._events = this._events || {},
  31156. this._maxListeners = this._maxListeners || void 0
  31157. }
  31158. function l(e) {
  31159. return "function" == typeof e
  31160. }
  31161. function c(e) {
  31162. return "object" == typeof e && null !== e
  31163. }
  31164. function h(e) {
  31165. return void 0 === e
  31166. }
  31167. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  31168. n.prototype._maxListeners = void 0,
  31169. n.defaultMaxListeners = 10,
  31170. n.prototype.setMaxListeners = function(e) {
  31171. if (!function(e) {
  31172. return "number" == typeof e
  31173. }(e) || e < 0 || isNaN(e))
  31174. throw TypeError("n must be a positive number");
  31175. return this._maxListeners = e,
  31176. this
  31177. }
  31178. ,
  31179. n.prototype.emit = function(e) {
  31180. var t, i, n, r, o, a;
  31181. if (this._events || (this._events = {}),
  31182. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  31183. if ((t = arguments[1])instanceof Error)
  31184. throw t;
  31185. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  31186. throw s.context = t,
  31187. s
  31188. }
  31189. if (h(i = this._events[e]))
  31190. return !1;
  31191. if (l(i))
  31192. switch (arguments.length) {
  31193. case 1:
  31194. i.call(this);
  31195. break;
  31196. case 2:
  31197. i.call(this, arguments[1]);
  31198. break;
  31199. case 3:
  31200. i.call(this, arguments[1], arguments[2]);
  31201. break;
  31202. default:
  31203. r = Array.prototype.slice.call(arguments, 1),
  31204. i.apply(this, r)
  31205. }
  31206. else if (c(i))
  31207. for (r = Array.prototype.slice.call(arguments, 1),
  31208. n = (a = i.slice()).length,
  31209. o = 0; o < n; o++)
  31210. a[o].apply(this, r);
  31211. return !0
  31212. }
  31213. ,
  31214. n.prototype.on = n.prototype.addListener = function(e, t) {
  31215. var i;
  31216. if (!l(t))
  31217. throw TypeError("listener must be a function");
  31218. return this._events || (this._events = {}),
  31219. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  31220. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  31221. c(this._events[e]) && !this._events[e].warned && ((i = h(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners) && 0 < i && this._events[e].length > i && (this._events[e].warned = !0,
  31222. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  31223. "function" == typeof console.trace && console.trace())),
  31224. this
  31225. }
  31226. ,
  31227. n.prototype.once = function(e, t) {
  31228. function i() {
  31229. this.removeListener(e, i),
  31230. n || (n = !0,
  31231. t.apply(this, arguments))
  31232. }
  31233. if (!l(t))
  31234. throw TypeError("listener must be a function");
  31235. var n = !1;
  31236. return i.listener = t,
  31237. this.on(e, i),
  31238. this
  31239. }
  31240. ,
  31241. n.prototype.removeListener = function(e, t) {
  31242. var i, n, r, o;
  31243. if (!l(t))
  31244. throw TypeError("listener must be a function");
  31245. if (!this._events || !this._events[e])
  31246. return this;
  31247. if (r = (i = this._events[e]).length,
  31248. n = -1,
  31249. i === t || l(i.listener) && i.listener === t)
  31250. delete this._events[e],
  31251. this._events.removeListener && this.emit("removeListener", e, t);
  31252. else if (c(i)) {
  31253. for (o = r; 0 < o--; )
  31254. if (i[o] === t || i[o].listener && i[o].listener === t) {
  31255. n = o;
  31256. break
  31257. }
  31258. if (n < 0)
  31259. return this;
  31260. 1 === i.length ? (i.length = 0,
  31261. delete this._events[e]) : i.splice(n, 1),
  31262. this._events.removeListener && this.emit("removeListener", e, t)
  31263. }
  31264. return this
  31265. }
  31266. ,
  31267. n.prototype.removeAllListeners = function(e) {
  31268. var t, i;
  31269. if (!this._events)
  31270. return this;
  31271. if (!this._events.removeListener)
  31272. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  31273. this;
  31274. if (0 === arguments.length) {
  31275. for (t in this._events)
  31276. "removeListener" !== t && this.removeAllListeners(t);
  31277. return this.removeAllListeners("removeListener"),
  31278. this._events = {},
  31279. this
  31280. }
  31281. if (l(i = this._events[e]))
  31282. this.removeListener(e, i);
  31283. else if (i)
  31284. for (; i.length; )
  31285. this.removeListener(e, i[i.length - 1]);
  31286. return delete this._events[e],
  31287. this
  31288. }
  31289. ,
  31290. n.prototype.listeners = function(e) {
  31291. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  31292. }
  31293. ,
  31294. n.prototype.listenerCount = function(e) {
  31295. if (this._events) {
  31296. var t = this._events[e];
  31297. if (l(t))
  31298. return 1;
  31299. if (t)
  31300. return t.length
  31301. }
  31302. return 0
  31303. }
  31304. ,
  31305. n.listenerCount = function(e, t) {
  31306. return e.listenerCount(t)
  31307. }
  31308. }
  31309. , {}],
  31310. 203: [function(e, t, i) {
  31311. function n() {
  31312. throw new Error("setTimeout has not been defined")
  31313. }
  31314. function r() {
  31315. throw new Error("clearTimeout has not been defined")
  31316. }
  31317. function o(t) {
  31318. if (h === setTimeout)
  31319. return setTimeout(t, 0);
  31320. if ((h === n || !h) && setTimeout)
  31321. return h = setTimeout,
  31322. setTimeout(t, 0);
  31323. try {
  31324. return h(t, 0)
  31325. } catch (e) {
  31326. try {
  31327. return h.call(null, t, 0)
  31328. } catch (e) {
  31329. return h.call(this, t, 0)
  31330. }
  31331. }
  31332. }
  31333. function a() {
  31334. g && p && (g = !1,
  31335. p.length ? f = p.concat(f) : m = -1,
  31336. f.length && s())
  31337. }
  31338. function s() {
  31339. if (!g) {
  31340. var e = o(a);
  31341. g = !0;
  31342. for (var t = f.length; t; ) {
  31343. for (p = f,
  31344. f = []; ++m < t; )
  31345. p && p[m].run();
  31346. m = -1,
  31347. t = f.length
  31348. }
  31349. p = null,
  31350. g = !1,
  31351. function(t) {
  31352. if (u === clearTimeout)
  31353. return clearTimeout(t);
  31354. if ((u === r || !u) && clearTimeout)
  31355. return u = clearTimeout,
  31356. clearTimeout(t);
  31357. try {
  31358. u(t)
  31359. } catch (e) {
  31360. try {
  31361. return u.call(null, t)
  31362. } catch (e) {
  31363. return u.call(this, t)
  31364. }
  31365. }
  31366. }(e)
  31367. }
  31368. }
  31369. function l(e, t) {
  31370. this.fun = e,
  31371. this.array = t
  31372. }
  31373. function c() {}
  31374. var h, u, d = t.exports = {};
  31375. !function() {
  31376. try {
  31377. h = "function" == typeof setTimeout ? setTimeout : n
  31378. } catch (e) {
  31379. h = n
  31380. }
  31381. try {
  31382. u = "function" == typeof clearTimeout ? clearTimeout : r
  31383. } catch (e) {
  31384. u = r
  31385. }
  31386. }();
  31387. var p, f = [], g = !1, m = -1;
  31388. d.nextTick = function(e) {
  31389. var t = new Array(arguments.length - 1);
  31390. if (1 < arguments.length)
  31391. for (var i = 1; i < arguments.length; i++)
  31392. t[i - 1] = arguments[i];
  31393. f.push(new l(e,t)),
  31394. 1 !== f.length || g || o(s)
  31395. }
  31396. ,
  31397. l.prototype.run = function() {
  31398. this.fun.apply(null, this.array)
  31399. }
  31400. ,
  31401. d.title = "browser",
  31402. d.browser = !0,
  31403. d.env = {},
  31404. d.argv = [],
  31405. d.version = "",
  31406. d.versions = {},
  31407. d.on = c,
  31408. d.addListener = c,
  31409. d.once = c,
  31410. d.off = c,
  31411. d.removeListener = c,
  31412. d.removeAllListeners = c,
  31413. d.emit = c,
  31414. d.binding = function(e) {
  31415. throw new Error("process.binding is not supported")
  31416. }
  31417. ,
  31418. d.cwd = function() {
  31419. return "/"
  31420. }
  31421. ,
  31422. d.chdir = function(e) {
  31423. throw new Error("process.chdir is not supported")
  31424. }
  31425. ,
  31426. d.umask = function() {
  31427. return 0
  31428. }
  31429. }
  31430. , {}],
  31431. 204: [function(e, O, L) {
  31432. (function(P) {
  31433. !function(e) {
  31434. function v(e) {
  31435. throw new RangeError(g[e])
  31436. }
  31437. function r(e, t) {
  31438. for (var i = e.length, n = []; i--; )
  31439. n[i] = t(e[i]);
  31440. return n
  31441. }
  31442. function t(e, t) {
  31443. var i = e.split("@")
  31444. , n = "";
  31445. return 1 < i.length && (n = i[0] + "@",
  31446. e = i[1]),
  31447. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  31448. }
  31449. function y(e) {
  31450. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  31451. 55296 <= (t = e.charCodeAt(r++)) && t <= 56319 && r < o ? 56320 == (64512 & (i = e.charCodeAt(r++))) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  31452. r--) : n.push(t);
  31453. return n
  31454. }
  31455. function A(e) {
  31456. return r(e, function(e) {
  31457. var t = "";
  31458. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  31459. e = 56320 | 1023 & e),
  31460. t + R(e)
  31461. }).join("")
  31462. }
  31463. function C(e, t) {
  31464. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  31465. }
  31466. function I(e, t, i) {
  31467. var n = 0;
  31468. for (e = i ? M(e / u) : e >> 1,
  31469. e += M(e / t); m * w >> 1 < e; n += _)
  31470. e = M(e / m);
  31471. return M(n + (m + 1) * e / (e + h))
  31472. }
  31473. function i(e) {
  31474. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  31475. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  31476. n = 0; n < i; ++n)
  31477. 128 <= e.charCodeAt(n) && v("not-basic"),
  31478. d.push(e.charCodeAt(n));
  31479. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  31480. for (o = f,
  31481. a = 1,
  31482. s = _; p <= r && v("invalid-input"),
  31483. u = e.charCodeAt(r++),
  31484. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  31485. f += l * a,
  31486. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  31487. a > M(E / (h = _ - c)) && v("overflow"),
  31488. a *= h;
  31489. m = I(f - o, t = d.length + 1, 0 == o),
  31490. M(f / t) > E - g && v("overflow"),
  31491. g += M(f / t),
  31492. f %= t,
  31493. d.splice(f++, 0, g)
  31494. }
  31495. return A(d)
  31496. }
  31497. function n(e) {
  31498. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  31499. for (d = (e = y(e)).length,
  31500. t = x,
  31501. o = T,
  31502. a = i = 0; a < d; ++a)
  31503. (u = e[a]) < 128 && m.push(R(u));
  31504. for (n = r = m.length,
  31505. r && m.push(S); n < d; ) {
  31506. for (s = E,
  31507. a = 0; a < d; ++a)
  31508. t <= (u = e[a]) && u < s && (s = u);
  31509. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  31510. i += (s - t) * p,
  31511. t = s,
  31512. a = 0; a < d; ++a)
  31513. if ((u = e[a]) < t && ++i > E && v("overflow"),
  31514. u == t) {
  31515. for (l = i,
  31516. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  31517. g = l - h,
  31518. f = _ - h,
  31519. m.push(R(C(h + g % f, 0))),
  31520. l = M(g / f);
  31521. m.push(R(C(l, 0))),
  31522. o = I(i, p, n == r),
  31523. i = 0,
  31524. ++n
  31525. }
  31526. ++i,
  31527. ++t
  31528. }
  31529. return m.join("")
  31530. }
  31531. var o = "object" == typeof L && L && !L.nodeType && L
  31532. , a = "object" == typeof O && O && !O.nodeType && O
  31533. , s = "object" == typeof P && P;
  31534. s.global !== s && s.window !== s && s.self !== s || (e = s);
  31535. var l, c, E = 2147483647, _ = 36, b = 1, w = 26, h = 38, u = 700, T = 72, x = 128, S = "-", d = /^xn--/, p = /[^\x20-\x7E]/, f = /[\x2E\u3002\uFF0E\uFF61]/g, g = {
  31536. overflow: "Overflow: input needs wider integers to process",
  31537. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  31538. "invalid-input": "Invalid input"
  31539. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  31540. if (l = {
  31541. version: "1.4.1",
  31542. ucs2: {
  31543. decode: y,
  31544. encode: A
  31545. },
  31546. decode: i,
  31547. encode: n,
  31548. toASCII: function(e) {
  31549. return t(e, function(e) {
  31550. return p.test(e) ? "xn--" + n(e) : e
  31551. })
  31552. },
  31553. toUnicode: function(e) {
  31554. return t(e, function(e) {
  31555. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  31556. })
  31557. }
  31558. },
  31559. "function" == typeof define && "object" == typeof define.amd && define.amd)
  31560. define("punycode", function() {
  31561. return l
  31562. });
  31563. else if (o && a)
  31564. if (O.exports == o)
  31565. a.exports = l;
  31566. else
  31567. for (c in l)
  31568. l.hasOwnProperty(c) && (o[c] = l[c]);
  31569. else
  31570. e.punycode = l
  31571. }(this)
  31572. }
  31573. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31574. }
  31575. , {}],
  31576. 205: [function(e, t, i) {
  31577. "use strict";
  31578. t.exports = function(e, t, i, n) {
  31579. t = t || "&",
  31580. i = i || "=";
  31581. var r = {};
  31582. if ("string" != typeof e || 0 === e.length)
  31583. return r;
  31584. var o = /\+/g;
  31585. e = e.split(t);
  31586. var a = 1e3;
  31587. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  31588. var s, l, c = e.length;
  31589. 0 < a && a < c && (c = a);
  31590. for (var h = 0; h < c; ++h) {
  31591. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  31592. d = 0 <= m ? (u = g.substr(0, m),
  31593. g.substr(m + 1)) : (u = g,
  31594. ""),
  31595. p = decodeURIComponent(u),
  31596. f = decodeURIComponent(d),
  31597. s = r,
  31598. l = p,
  31599. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  31600. }
  31601. return r
  31602. }
  31603. ;
  31604. var v = Array.isArray || function(e) {
  31605. return "[object Array]" === Object.prototype.toString.call(e)
  31606. }
  31607. }
  31608. , {}],
  31609. 206: [function(e, t, i) {
  31610. "use strict";
  31611. function o(e, t) {
  31612. if (e.map)
  31613. return e.map(t);
  31614. for (var i = [], n = 0; n < e.length; n++)
  31615. i.push(t(e[n], n));
  31616. return i
  31617. }
  31618. function a(e) {
  31619. switch (typeof e) {
  31620. case "string":
  31621. return e;
  31622. case "boolean":
  31623. return e ? "true" : "false";
  31624. case "number":
  31625. return isFinite(e) ? e : "";
  31626. default:
  31627. return ""
  31628. }
  31629. }
  31630. t.exports = function(i, n, r, e) {
  31631. return n = n || "&",
  31632. r = r || "=",
  31633. null === i && (i = void 0),
  31634. "object" == typeof i ? o(l(i), function(e) {
  31635. var t = encodeURIComponent(a(e)) + r;
  31636. return s(i[e]) ? o(i[e], function(e) {
  31637. return t + encodeURIComponent(a(e))
  31638. }).join(n) : t + encodeURIComponent(a(i[e]))
  31639. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  31640. }
  31641. ;
  31642. var s = Array.isArray || function(e) {
  31643. return "[object Array]" === Object.prototype.toString.call(e)
  31644. }
  31645. , l = Object.keys || function(e) {
  31646. var t = [];
  31647. for (var i in e)
  31648. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31649. return t
  31650. }
  31651. }
  31652. , {}],
  31653. 207: [function(e, t, i) {
  31654. "use strict";
  31655. i.decode = i.parse = e("./decode"),
  31656. i.encode = i.stringify = e("./encode")
  31657. }
  31658. , {
  31659. "./decode": 205,
  31660. "./encode": 206
  31661. }],
  31662. 208: [function(e, t, i) {
  31663. "use strict";
  31664. function x() {
  31665. this.protocol = null,
  31666. this.slashes = null,
  31667. this.auth = null,
  31668. this.host = null,
  31669. this.port = null,
  31670. this.hostname = null,
  31671. this.hash = null,
  31672. this.search = null,
  31673. this.query = null,
  31674. this.pathname = null,
  31675. this.path = null,
  31676. this.href = null
  31677. }
  31678. function n(e, t, i) {
  31679. if (e && D.isObject(e) && e instanceof x)
  31680. return e;
  31681. var n = new x;
  31682. return n.parse(e, t, i),
  31683. n
  31684. }
  31685. var L = e("punycode")
  31686. , D = e("./util");
  31687. i.parse = n,
  31688. i.resolve = function(e, t) {
  31689. return n(e, !1, !0).resolve(t)
  31690. }
  31691. ,
  31692. i.resolveObject = function(e, t) {
  31693. return e ? n(e, !1, !0).resolveObject(t) : t
  31694. }
  31695. ,
  31696. i.format = function(e) {
  31697. return D.isString(e) && (e = n(e)),
  31698. e instanceof x ? e.format() : x.prototype.format.call(e)
  31699. }
  31700. ,
  31701. i.Url = x;
  31702. var N = /^([a-z0-9.+-]+:)/i
  31703. , r = /:[0-9]*$/
  31704. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31705. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  31706. , B = ["'"].concat(o)
  31707. , V = ["%", "/", "?", ";", "#"].concat(B)
  31708. , k = ["/", "?", "#"]
  31709. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  31710. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31711. , z = {
  31712. javascript: !0,
  31713. "javascript:": !0
  31714. }
  31715. , G = {
  31716. javascript: !0,
  31717. "javascript:": !0
  31718. }
  31719. , W = {
  31720. http: !0,
  31721. https: !0,
  31722. ftp: !0,
  31723. gopher: !0,
  31724. file: !0,
  31725. "http:": !0,
  31726. "https:": !0,
  31727. "ftp:": !0,
  31728. "gopher:": !0,
  31729. "file:": !0
  31730. }
  31731. , j = e("querystring");
  31732. x.prototype.parse = function(e, t, i) {
  31733. if (!D.isString(e))
  31734. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31735. var n = e.indexOf("?")
  31736. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  31737. , o = e.split(r);
  31738. o[0] = o[0].replace(/\\/g, "/");
  31739. var a = e = o.join(r);
  31740. if (a = a.trim(),
  31741. !i && 1 === e.split("#").length) {
  31742. var s = F.exec(a);
  31743. if (s)
  31744. return this.path = a,
  31745. this.href = a,
  31746. this.pathname = s[1],
  31747. s[2] ? (this.search = s[2],
  31748. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  31749. this.query = {}),
  31750. this
  31751. }
  31752. var l = N.exec(a);
  31753. if (l) {
  31754. var c = (l = l[0]).toLowerCase();
  31755. this.protocol = c,
  31756. a = a.substr(l.length)
  31757. }
  31758. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31759. var h = "//" === a.substr(0, 2);
  31760. !h || l && G[l] || (a = a.substr(2),
  31761. this.slashes = !0)
  31762. }
  31763. if (!G[l] && (h || l && !W[l])) {
  31764. for (var u = -1, d = 0; d < k.length; d++) {
  31765. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31766. }
  31767. var p, f;
  31768. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  31769. a = a.slice(f + 1),
  31770. this.auth = decodeURIComponent(p)),
  31771. u = -1;
  31772. for (d = 0; d < V.length; d++) {
  31773. var g;
  31774. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31775. }
  31776. -1 === u && (u = a.length),
  31777. this.host = a.slice(0, u),
  31778. a = a.slice(u),
  31779. this.parseHost(),
  31780. this.hostname = this.hostname || "";
  31781. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31782. if (!m)
  31783. for (var v = this.hostname.split(/\./), y = (d = 0,
  31784. v.length); d < y; d++) {
  31785. var A = v[d];
  31786. if (A && !A.match(U)) {
  31787. for (var C = "", I = 0, E = A.length; I < E; I++)
  31788. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31789. if (!C.match(U)) {
  31790. var _ = v.slice(0, d)
  31791. , b = v.slice(d + 1)
  31792. , w = A.match(H);
  31793. w && (_.push(w[1]),
  31794. b.unshift(w[2])),
  31795. b.length && (a = "/" + b.join(".") + a),
  31796. this.hostname = _.join(".");
  31797. break
  31798. }
  31799. }
  31800. }
  31801. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31802. m || (this.hostname = L.toASCII(this.hostname));
  31803. var T = this.port ? ":" + this.port : ""
  31804. , x = this.hostname || "";
  31805. this.host = x + T,
  31806. this.href += this.host,
  31807. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31808. "/" !== a[0] && (a = "/" + a))
  31809. }
  31810. if (!z[c])
  31811. for (d = 0,
  31812. y = B.length; d < y; d++) {
  31813. var S = B[d];
  31814. if (-1 !== a.indexOf(S)) {
  31815. var M = encodeURIComponent(S);
  31816. M === S && (M = escape(S)),
  31817. a = a.split(S).join(M)
  31818. }
  31819. }
  31820. var R = a.indexOf("#");
  31821. -1 !== R && (this.hash = a.substr(R),
  31822. a = a.slice(0, R));
  31823. var P = a.indexOf("?");
  31824. if (-1 !== P ? (this.search = a.substr(P),
  31825. this.query = a.substr(P + 1),
  31826. t && (this.query = j.parse(this.query)),
  31827. a = a.slice(0, P)) : t && (this.search = "",
  31828. this.query = {}),
  31829. a && (this.pathname = a),
  31830. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31831. this.pathname || this.search) {
  31832. T = this.pathname || "";
  31833. var O = this.search || "";
  31834. this.path = T + O
  31835. }
  31836. return this.href = this.format(),
  31837. this
  31838. }
  31839. ,
  31840. x.prototype.format = function() {
  31841. var e = this.auth || "";
  31842. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31843. e += "@");
  31844. var t = this.protocol || ""
  31845. , i = this.pathname || ""
  31846. , n = this.hash || ""
  31847. , r = !1
  31848. , o = "";
  31849. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31850. this.port && (r += ":" + this.port)),
  31851. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31852. var a = this.search || o && "?" + o || "";
  31853. return t && ":" !== t.substr(-1) && (t += ":"),
  31854. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31855. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31856. n && "#" !== n.charAt(0) && (n = "#" + n),
  31857. a && "?" !== a.charAt(0) && (a = "?" + a),
  31858. t + r + (i = i.replace(/[?#]/g, function(e) {
  31859. return encodeURIComponent(e)
  31860. })) + (a = a.replace("#", "%23")) + n
  31861. }
  31862. ,
  31863. x.prototype.resolve = function(e) {
  31864. return this.resolveObject(n(e, !1, !0)).format()
  31865. }
  31866. ,
  31867. x.prototype.resolveObject = function(e) {
  31868. if (D.isString(e)) {
  31869. var t = new x;
  31870. t.parse(e, !1, !0),
  31871. e = t
  31872. }
  31873. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31874. var o = n[r];
  31875. i[o] = this[o]
  31876. }
  31877. if (i.hash = e.hash,
  31878. "" === e.href)
  31879. return i.href = i.format(),
  31880. i;
  31881. if (e.slashes && !e.protocol) {
  31882. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31883. var l = a[s];
  31884. "protocol" !== l && (i[l] = e[l])
  31885. }
  31886. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31887. i.href = i.format(),
  31888. i
  31889. }
  31890. if (e.protocol && e.protocol !== i.protocol) {
  31891. if (!W[e.protocol]) {
  31892. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31893. var u = c[h];
  31894. i[u] = e[u]
  31895. }
  31896. return i.href = i.format(),
  31897. i
  31898. }
  31899. if (i.protocol = e.protocol,
  31900. e.host || G[e.protocol])
  31901. i.pathname = e.pathname;
  31902. else {
  31903. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31904. ;
  31905. e.host || (e.host = ""),
  31906. e.hostname || (e.hostname = ""),
  31907. "" !== d[0] && d.unshift(""),
  31908. d.length < 2 && d.unshift(""),
  31909. i.pathname = d.join("/")
  31910. }
  31911. if (i.search = e.search,
  31912. i.query = e.query,
  31913. i.host = e.host || "",
  31914. i.auth = e.auth,
  31915. i.hostname = e.hostname || e.host,
  31916. i.port = e.port,
  31917. i.pathname || i.search) {
  31918. var p = i.pathname || ""
  31919. , f = i.search || "";
  31920. i.path = p + f
  31921. }
  31922. return i.slashes = i.slashes || e.slashes,
  31923. i.href = i.format(),
  31924. i
  31925. }
  31926. var g = i.pathname && "/" === i.pathname.charAt(0)
  31927. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31928. , v = m || g || i.host && e.pathname
  31929. , y = v
  31930. , A = i.pathname && i.pathname.split("/") || []
  31931. , C = (d = e.pathname && e.pathname.split("/") || [],
  31932. i.protocol && !W[i.protocol]);
  31933. if (C && (i.hostname = "",
  31934. i.port = null,
  31935. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  31936. i.host = "",
  31937. e.protocol && (e.hostname = null,
  31938. e.port = null,
  31939. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  31940. e.host = null),
  31941. v = v && ("" === d[0] || "" === A[0])),
  31942. m)
  31943. i.host = e.host || "" === e.host ? e.host : i.host,
  31944. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31945. i.search = e.search,
  31946. i.query = e.query,
  31947. A = d;
  31948. else if (d.length)
  31949. (A = A || []).pop(),
  31950. A = A.concat(d),
  31951. i.search = e.search,
  31952. i.query = e.query;
  31953. else if (!D.isNullOrUndefined(e.search)) {
  31954. if (C)
  31955. i.hostname = i.host = A.shift(),
  31956. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31957. i.host = i.hostname = w.shift());
  31958. return i.search = e.search,
  31959. i.query = e.query,
  31960. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31961. i.href = i.format(),
  31962. i
  31963. }
  31964. if (!A.length)
  31965. return i.pathname = null,
  31966. i.search ? i.path = "/" + i.search : i.path = null,
  31967. i.href = i.format(),
  31968. i;
  31969. for (var I = A.slice(-1)[0], E = (i.host || e.host || 1 < A.length) && ("." === I || ".." === I) || "" === I, _ = 0, b = A.length; 0 <= b; b--)
  31970. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  31971. _++) : _ && (A.splice(b, 1),
  31972. _--);
  31973. if (!v && !y)
  31974. for (; _--; )
  31975. A.unshift("..");
  31976. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  31977. E && "/" !== A.join("/").substr(-1) && A.push("");
  31978. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  31979. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  31980. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31981. i.host = i.hostname = w.shift()));
  31982. return (v = v || i.host && A.length) && !T && A.unshift(""),
  31983. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  31984. i.path = null),
  31985. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31986. i.auth = e.auth || i.auth,
  31987. i.slashes = i.slashes || e.slashes,
  31988. i.href = i.format(),
  31989. i
  31990. }
  31991. ,
  31992. x.prototype.parseHost = function() {
  31993. var e = this.host
  31994. , t = r.exec(e);
  31995. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  31996. e = e.substr(0, e.length - t.length)),
  31997. e && (this.hostname = e)
  31998. }
  31999. }
  32000. , {
  32001. "./util": 209,
  32002. punycode: 204,
  32003. querystring: 207
  32004. }],
  32005. 209: [function(e, t, i) {
  32006. "use strict";
  32007. t.exports = {
  32008. isString: function(e) {
  32009. return "string" == typeof e
  32010. },
  32011. isObject: function(e) {
  32012. return "object" == typeof e && null !== e
  32013. },
  32014. isNull: function(e) {
  32015. return null === e
  32016. },
  32017. isNullOrUndefined: function(e) {
  32018. return null == e
  32019. }
  32020. }
  32021. }
  32022. , {}],
  32023. 210: [function(e, t, i) {
  32024. "use strict";
  32025. function r(e) {
  32026. return c + e
  32027. }
  32028. function s(e) {
  32029. if ("string" != typeof e)
  32030. throw new TypeError("key must be a string.")
  32031. }
  32032. var l = Object.prototype.hasOwnProperty
  32033. , c = "~";
  32034. t.exports = function(t) {
  32035. var o = Object.create(null)
  32036. , n = 0
  32037. , a = {};
  32038. return function(e, t) {
  32039. for (var i in t)
  32040. Object.defineProperty(e, i, {
  32041. value: t[i],
  32042. configurable: !0,
  32043. writable: !0
  32044. })
  32045. }(a, {
  32046. get: function(e, t) {
  32047. s(e);
  32048. var i = r(e);
  32049. return i in o ? o[i] : t
  32050. },
  32051. set: function(e, t) {
  32052. s(e);
  32053. var i = r(e);
  32054. return i in o || ++n,
  32055. o[i] = t
  32056. },
  32057. has: function(e) {
  32058. return s(e),
  32059. r(e)in o
  32060. },
  32061. delete: function(e) {
  32062. s(e);
  32063. var t = r(e);
  32064. return t in o && (--n,
  32065. delete o[t],
  32066. !0)
  32067. },
  32068. clear: function() {
  32069. o = Object.create(null),
  32070. n = 0
  32071. },
  32072. forEach: function(e, t) {
  32073. if ("function" != typeof e)
  32074. throw new TypeError("`callback` must be a function");
  32075. for (var i in o)
  32076. if (l.call(o, i)) {
  32077. var n = i.substring(c.length)
  32078. , r = o[i];
  32079. e.call(t, r, n, a)
  32080. }
  32081. }
  32082. }),
  32083. Object.defineProperty(a, "size", {
  32084. get: function() {
  32085. return n
  32086. },
  32087. configurable: !0
  32088. }),
  32089. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  32090. a.set(e, t[e])
  32091. }),
  32092. a
  32093. }
  32094. }
  32095. , {}],
  32096. 211: [function(e, t, i) {
  32097. t.exports = e("./lib/heap")
  32098. }
  32099. , {
  32100. "./lib/heap": 212
  32101. }],
  32102. 212: [function(e, y, A) {
  32103. (function() {
  32104. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  32105. function v(e) {
  32106. this.cmp = null != e ? e : d,
  32107. this.nodes = []
  32108. }
  32109. l = Math.floor,
  32110. m = Math.min,
  32111. d = function(e, t) {
  32112. return e < t ? -1 : t < e ? 1 : 0
  32113. }
  32114. ,
  32115. g = function(e, t, i, n, r) {
  32116. var o;
  32117. if (null == i && (i = 0),
  32118. null == r && (r = d),
  32119. i < 0)
  32120. throw new Error("lo must be non-negative");
  32121. for (null == n && (n = e.length); i < n; )
  32122. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  32123. return [].splice.apply(e, [i, i - i].concat(t)),
  32124. t
  32125. }
  32126. ,
  32127. t = function(e, t, i) {
  32128. return null == i && (i = d),
  32129. e.push(t),
  32130. h(e, 0, e.length - 1, i)
  32131. }
  32132. ,
  32133. f = function(e, t) {
  32134. var i, n;
  32135. return null == t && (t = d),
  32136. i = e.pop(),
  32137. e.length ? (n = e[0],
  32138. e[0] = i,
  32139. u(e, 0, t)) : n = i,
  32140. n
  32141. }
  32142. ,
  32143. i = function(e, t, i) {
  32144. var n;
  32145. return null == i && (i = d),
  32146. n = e[0],
  32147. e[0] = t,
  32148. u(e, 0, i),
  32149. n
  32150. }
  32151. ,
  32152. c = function(e, t, i) {
  32153. var n;
  32154. return null == i && (i = d),
  32155. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  32156. e[0] = n[1],
  32157. u(e, 0, i)),
  32158. t
  32159. }
  32160. ,
  32161. p = function(i, e) {
  32162. var t, n, r, o, a, s;
  32163. for (null == e && (e = d),
  32164. a = [],
  32165. n = 0,
  32166. r = (o = function() {
  32167. s = [];
  32168. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  32169. s.push(e);
  32170. return s
  32171. }
  32172. .apply(this).reverse()).length; n < r; n++)
  32173. t = o[n],
  32174. a.push(u(i, t, e));
  32175. return a
  32176. }
  32177. ,
  32178. o = function(e, t, i) {
  32179. var n;
  32180. if (null == i && (i = d),
  32181. -1 !== (n = e.indexOf(t)))
  32182. return h(e, 0, n, i),
  32183. u(e, n, i)
  32184. }
  32185. ,
  32186. n = function(e, t, i) {
  32187. var n, r, o, a, s;
  32188. if (null == i && (i = d),
  32189. !(r = e.slice(0, t)).length)
  32190. return r;
  32191. for (p(r, i),
  32192. o = 0,
  32193. a = (s = e.slice(t)).length; o < a; o++)
  32194. n = s[o],
  32195. c(r, n, i);
  32196. return r.sort(i).reverse()
  32197. }
  32198. ,
  32199. r = function(e, t, i) {
  32200. var n, r, o, a, s, l, c, h, u;
  32201. if (null == i && (i = d),
  32202. 10 * t <= e.length) {
  32203. if (!(o = e.slice(0, t).sort(i)).length)
  32204. return o;
  32205. for (r = o[o.length - 1],
  32206. a = 0,
  32207. l = (c = e.slice(t)).length; a < l; a++)
  32208. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  32209. o.pop(),
  32210. r = o[o.length - 1]);
  32211. return o
  32212. }
  32213. for (p(e, i),
  32214. u = [],
  32215. s = 0,
  32216. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  32217. u.push(f(e, i));
  32218. return u
  32219. }
  32220. ,
  32221. h = function(e, t, i, n) {
  32222. var r, o, a;
  32223. for (null == n && (n = d),
  32224. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  32225. e[i] = o,
  32226. i = a;
  32227. return e[i] = r
  32228. }
  32229. ,
  32230. u = function(e, t, i) {
  32231. var n, r, o, a, s;
  32232. for (null == i && (i = d),
  32233. r = e.length,
  32234. o = e[s = t],
  32235. n = 2 * t + 1; n < r; )
  32236. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  32237. e[t] = e[n],
  32238. n = 2 * (t = n) + 1;
  32239. return e[t] = o,
  32240. h(e, s, t, i)
  32241. }
  32242. ,
  32243. v.push = t,
  32244. v.pop = f,
  32245. v.replace = i,
  32246. v.pushpop = c,
  32247. v.heapify = p,
  32248. v.updateItem = o,
  32249. v.nlargest = n,
  32250. v.nsmallest = r,
  32251. v.prototype.push = function(e) {
  32252. return t(this.nodes, e, this.cmp)
  32253. }
  32254. ,
  32255. v.prototype.pop = function() {
  32256. return f(this.nodes, this.cmp)
  32257. }
  32258. ,
  32259. v.prototype.peek = function() {
  32260. return this.nodes[0]
  32261. }
  32262. ,
  32263. v.prototype.contains = function(e) {
  32264. return -1 !== this.nodes.indexOf(e)
  32265. }
  32266. ,
  32267. v.prototype.replace = function(e) {
  32268. return i(this.nodes, e, this.cmp)
  32269. }
  32270. ,
  32271. v.prototype.pushpop = function(e) {
  32272. return c(this.nodes, e, this.cmp)
  32273. }
  32274. ,
  32275. v.prototype.heapify = function() {
  32276. return p(this.nodes, this.cmp)
  32277. }
  32278. ,
  32279. v.prototype.updateItem = function(e) {
  32280. return o(this.nodes, e, this.cmp)
  32281. }
  32282. ,
  32283. v.prototype.clear = function() {
  32284. return this.nodes = []
  32285. }
  32286. ,
  32287. v.prototype.empty = function() {
  32288. return 0 === this.nodes.length
  32289. }
  32290. ,
  32291. v.prototype.size = function() {
  32292. return this.nodes.length
  32293. }
  32294. ,
  32295. v.prototype.clone = function() {
  32296. var e;
  32297. return (e = new v).nodes = this.nodes.slice(0),
  32298. e
  32299. }
  32300. ,
  32301. v.prototype.toArray = function() {
  32302. return this.nodes.slice(0)
  32303. }
  32304. ,
  32305. v.prototype.insert = v.prototype.push,
  32306. v.prototype.top = v.prototype.peek,
  32307. v.prototype.front = v.prototype.peek,
  32308. v.prototype.has = v.prototype.contains,
  32309. v.prototype.copy = v.prototype.clone,
  32310. e = v,
  32311. a = this,
  32312. s = function() {
  32313. return e
  32314. }
  32315. ,
  32316. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  32317. }
  32318. ).call(this)
  32319. }
  32320. , {}],
  32321. 213: [function(e, t, i) {
  32322. function n() {}
  32323. function o(e) {
  32324. if ("object" != typeof this)
  32325. throw new TypeError("Promises must be constructed via new");
  32326. if ("function" != typeof e)
  32327. throw new TypeError("not a function");
  32328. this._state = 0,
  32329. this._handled = !1,
  32330. this._value = void 0,
  32331. this._deferreds = [],
  32332. h(e, this)
  32333. }
  32334. function r(i, n) {
  32335. for (; 3 === i._state; )
  32336. i = i._value;
  32337. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  32338. void o._immediateFn(function() {
  32339. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  32340. if (null !== e) {
  32341. var t;
  32342. try {
  32343. t = e(i._value)
  32344. } catch (e) {
  32345. return void s(n.promise, e)
  32346. }
  32347. a(n.promise, t)
  32348. } else
  32349. (1 === i._state ? a : s)(n.promise, i._value)
  32350. }))
  32351. }
  32352. function a(e, t) {
  32353. try {
  32354. if (t === e)
  32355. throw new TypeError("A promise cannot be resolved with itself.");
  32356. if (t && ("object" == typeof t || "function" == typeof t)) {
  32357. var i = t.then;
  32358. if (t instanceof o)
  32359. return e._state = 3,
  32360. e._value = t,
  32361. void l(e);
  32362. if ("function" == typeof i)
  32363. return void h(function(e, t) {
  32364. return function() {
  32365. e.apply(t, arguments)
  32366. }
  32367. }(i, t), e)
  32368. }
  32369. e._state = 1,
  32370. e._value = t,
  32371. l(e)
  32372. } catch (t) {
  32373. s(e, t)
  32374. }
  32375. }
  32376. function s(e, t) {
  32377. e._state = 2,
  32378. e._value = t,
  32379. l(e)
  32380. }
  32381. function l(e) {
  32382. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  32383. e._handled || o._unhandledRejectionFn(e._value)
  32384. });
  32385. for (var t = 0, i = e._deferreds.length; t < i; t++)
  32386. r(e, e._deferreds[t]);
  32387. e._deferreds = null
  32388. }
  32389. function c(e, t, i) {
  32390. this.onFulfilled = "function" == typeof e ? e : null,
  32391. this.onRejected = "function" == typeof t ? t : null,
  32392. this.promise = i
  32393. }
  32394. function h(e, t) {
  32395. var i = !1;
  32396. try {
  32397. e(function(e) {
  32398. i || (i = !0,
  32399. a(t, e))
  32400. }, function(e) {
  32401. i || (i = !0,
  32402. s(t, e))
  32403. })
  32404. } catch (e) {
  32405. if (i)
  32406. return;
  32407. i = !0,
  32408. s(t, e)
  32409. }
  32410. }
  32411. var u, d;
  32412. u = this,
  32413. d = setTimeout,
  32414. o.prototype.catch = function(e) {
  32415. return this.then(null, e)
  32416. }
  32417. ,
  32418. o.prototype.then = function(e, t) {
  32419. var i = new this.constructor(n);
  32420. return r(this, new c(e,t,i)),
  32421. i
  32422. }
  32423. ,
  32424. o.all = function(e) {
  32425. var s = Array.prototype.slice.call(e);
  32426. return new o(function(n, r) {
  32427. function o(t, e) {
  32428. try {
  32429. if (e && ("object" == typeof e || "function" == typeof e)) {
  32430. var i = e.then;
  32431. if ("function" == typeof i)
  32432. return void i.call(e, function(e) {
  32433. o(t, e)
  32434. }, r)
  32435. }
  32436. s[t] = e,
  32437. 0 == --a && n(s)
  32438. } catch (e) {
  32439. r(e)
  32440. }
  32441. }
  32442. if (0 === s.length)
  32443. return n([]);
  32444. for (var a = s.length, e = 0; e < s.length; e++)
  32445. o(e, s[e])
  32446. }
  32447. )
  32448. }
  32449. ,
  32450. o.resolve = function(t) {
  32451. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  32452. e(t)
  32453. }
  32454. )
  32455. }
  32456. ,
  32457. o.reject = function(i) {
  32458. return new o(function(e, t) {
  32459. t(i)
  32460. }
  32461. )
  32462. }
  32463. ,
  32464. o.race = function(r) {
  32465. return new o(function(e, t) {
  32466. for (var i = 0, n = r.length; i < n; i++)
  32467. r[i].then(e, t)
  32468. }
  32469. )
  32470. }
  32471. ,
  32472. o._immediateFn = "function" == typeof setImmediate && function(e) {
  32473. setImmediate(e)
  32474. }
  32475. || function(e) {
  32476. d(e, 0)
  32477. }
  32478. ,
  32479. o._unhandledRejectionFn = function(e) {
  32480. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  32481. }
  32482. ,
  32483. o._setImmediateFn = function(e) {
  32484. o._immediateFn = e
  32485. }
  32486. ,
  32487. o._setUnhandledRejectionFn = function(e) {
  32488. o._unhandledRejectionFn = e
  32489. }
  32490. ,
  32491. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  32492. }
  32493. , {}],
  32494. 214: [function(p, i, e) {
  32495. (function(d) {
  32496. var e, t;
  32497. e = this,
  32498. t = function(I, e) {
  32499. "use strict";
  32500. var a, t, u, i, s, n, r, o = {};
  32501. return o.ByteBuffer = I,
  32502. o.Long = I.Long || null,
  32503. o.VERSION = "5.0.1",
  32504. o.WIRE_TYPES = {},
  32505. o.WIRE_TYPES.VARINT = 0,
  32506. o.WIRE_TYPES.BITS64 = 1,
  32507. o.WIRE_TYPES.LDELIM = 2,
  32508. o.WIRE_TYPES.STARTGROUP = 3,
  32509. o.WIRE_TYPES.ENDGROUP = 4,
  32510. o.WIRE_TYPES.BITS32 = 5,
  32511. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  32512. o.TYPES = {
  32513. int32: {
  32514. name: "int32",
  32515. wireType: o.WIRE_TYPES.VARINT,
  32516. defaultValue: 0
  32517. },
  32518. uint32: {
  32519. name: "uint32",
  32520. wireType: o.WIRE_TYPES.VARINT,
  32521. defaultValue: 0
  32522. },
  32523. sint32: {
  32524. name: "sint32",
  32525. wireType: o.WIRE_TYPES.VARINT,
  32526. defaultValue: 0
  32527. },
  32528. int64: {
  32529. name: "int64",
  32530. wireType: o.WIRE_TYPES.VARINT,
  32531. defaultValue: o.Long ? o.Long.ZERO : void 0
  32532. },
  32533. uint64: {
  32534. name: "uint64",
  32535. wireType: o.WIRE_TYPES.VARINT,
  32536. defaultValue: o.Long ? o.Long.UZERO : void 0
  32537. },
  32538. sint64: {
  32539. name: "sint64",
  32540. wireType: o.WIRE_TYPES.VARINT,
  32541. defaultValue: o.Long ? o.Long.ZERO : void 0
  32542. },
  32543. bool: {
  32544. name: "bool",
  32545. wireType: o.WIRE_TYPES.VARINT,
  32546. defaultValue: !1
  32547. },
  32548. double: {
  32549. name: "double",
  32550. wireType: o.WIRE_TYPES.BITS64,
  32551. defaultValue: 0
  32552. },
  32553. string: {
  32554. name: "string",
  32555. wireType: o.WIRE_TYPES.LDELIM,
  32556. defaultValue: ""
  32557. },
  32558. bytes: {
  32559. name: "bytes",
  32560. wireType: o.WIRE_TYPES.LDELIM,
  32561. defaultValue: null
  32562. },
  32563. fixed32: {
  32564. name: "fixed32",
  32565. wireType: o.WIRE_TYPES.BITS32,
  32566. defaultValue: 0
  32567. },
  32568. sfixed32: {
  32569. name: "sfixed32",
  32570. wireType: o.WIRE_TYPES.BITS32,
  32571. defaultValue: 0
  32572. },
  32573. fixed64: {
  32574. name: "fixed64",
  32575. wireType: o.WIRE_TYPES.BITS64,
  32576. defaultValue: o.Long ? o.Long.UZERO : void 0
  32577. },
  32578. sfixed64: {
  32579. name: "sfixed64",
  32580. wireType: o.WIRE_TYPES.BITS64,
  32581. defaultValue: o.Long ? o.Long.ZERO : void 0
  32582. },
  32583. float: {
  32584. name: "float",
  32585. wireType: o.WIRE_TYPES.BITS32,
  32586. defaultValue: 0
  32587. },
  32588. enum: {
  32589. name: "enum",
  32590. wireType: o.WIRE_TYPES.VARINT,
  32591. defaultValue: 0
  32592. },
  32593. message: {
  32594. name: "message",
  32595. wireType: o.WIRE_TYPES.LDELIM,
  32596. defaultValue: null
  32597. },
  32598. group: {
  32599. name: "group",
  32600. wireType: o.WIRE_TYPES.STARTGROUP,
  32601. defaultValue: null
  32602. }
  32603. },
  32604. o.MAP_KEY_TYPES = [o.TYPES.int32, o.TYPES.sint32, o.TYPES.sfixed32, o.TYPES.uint32, o.TYPES.fixed32, o.TYPES.int64, o.TYPES.sint64, o.TYPES.sfixed64, o.TYPES.uint64, o.TYPES.fixed64, o.TYPES.bool, o.TYPES.string, o.TYPES.bytes],
  32605. o.ID_MIN = 1,
  32606. o.ID_MAX = 536870911,
  32607. o.convertFieldsToCamelCase = !1,
  32608. o.populateAccessors = !0,
  32609. o.populateDefaults = !0,
  32610. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  32611. r.XHR = function() {
  32612. for (var e = [function() {
  32613. return new XMLHttpRequest
  32614. }
  32615. , function() {
  32616. return new ActiveXObject("Msxml2.XMLHTTP")
  32617. }
  32618. , function() {
  32619. return new ActiveXObject("Msxml3.XMLHTTP")
  32620. }
  32621. , function() {
  32622. return new ActiveXObject("Microsoft.XMLHTTP")
  32623. }
  32624. ], t = null, i = 0; i < e.length; i++) {
  32625. try {
  32626. t = e[i]()
  32627. } catch (e) {
  32628. continue
  32629. }
  32630. break
  32631. }
  32632. if (!t)
  32633. throw Error("XMLHttpRequest is not supported");
  32634. return t
  32635. }
  32636. ,
  32637. r.fetch = function(e, i) {
  32638. if (i && "function" != typeof i && (i = null),
  32639. r.IS_NODE) {
  32640. var t = p("fs");
  32641. if (i)
  32642. t.readFile(e, function(e, t) {
  32643. i(e ? null : "" + t)
  32644. });
  32645. else
  32646. try {
  32647. return t.readFileSync(e)
  32648. } catch (e) {
  32649. return null
  32650. }
  32651. } else {
  32652. var n = r.XHR();
  32653. if (n.open("GET", e, !!i),
  32654. n.setRequestHeader("Accept", "text/plain"),
  32655. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  32656. !i)
  32657. return n.send(null),
  32658. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  32659. if (n.onreadystatechange = function() {
  32660. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  32661. }
  32662. ,
  32663. 4 == n.readyState)
  32664. return;
  32665. n.send(null)
  32666. }
  32667. }
  32668. ,
  32669. r.toCamelCase = function(e) {
  32670. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32671. return t.toUpperCase()
  32672. })
  32673. }
  32674. ,
  32675. r),
  32676. o.Lang = {
  32677. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32678. RULE: /^(?:required|optional|repeated|map)$/,
  32679. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32680. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32681. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32682. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32683. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32684. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32685. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32686. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32687. NUMBER_OCT: /^0[0-7]+$/,
  32688. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32689. BOOL: /^(?:true|false)$/i,
  32690. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32691. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32692. WHITESPACE: /\s/,
  32693. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32694. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32695. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32696. },
  32697. o.DotProto = function(r, a) {
  32698. function s(e, t) {
  32699. var i = -1
  32700. , n = 1;
  32701. if ("-" == e.charAt(0) && (n = -1,
  32702. e = e.substring(1)),
  32703. a.NUMBER_DEC.test(e))
  32704. i = parseInt(e);
  32705. else if (a.NUMBER_HEX.test(e))
  32706. i = parseInt(e.substring(2), 16);
  32707. else {
  32708. if (!a.NUMBER_OCT.test(e))
  32709. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32710. i = parseInt(e.substring(1), 8)
  32711. }
  32712. if (i = n * i | 0,
  32713. !t && i < 0)
  32714. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32715. return i
  32716. }
  32717. function o(e) {
  32718. var t = 1;
  32719. if ("-" == e.charAt(0) && (t = -1,
  32720. e = e.substring(1)),
  32721. a.NUMBER_DEC.test(e))
  32722. return t * parseInt(e, 10);
  32723. if (a.NUMBER_HEX.test(e))
  32724. return t * parseInt(e.substring(2), 16);
  32725. if (a.NUMBER_OCT.test(e))
  32726. return t * parseInt(e.substring(1), 8);
  32727. if ("inf" === e)
  32728. return t * (1 / 0);
  32729. if ("nan" === e)
  32730. return NaN;
  32731. if (a.NUMBER_FLT.test(e))
  32732. return t * parseFloat(e);
  32733. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  32734. }
  32735. function n(e, t, i) {
  32736. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32737. e[t].push(i))
  32738. }
  32739. function t(e) {
  32740. this.source = e + "",
  32741. this.index = 0,
  32742. this.line = 1,
  32743. this.stack = [],
  32744. this._stringOpen = null
  32745. }
  32746. var e = {}
  32747. , i = t.prototype;
  32748. i._readString = function() {
  32749. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  32750. e.lastIndex = this.index - 1;
  32751. var t = e.exec(this.source);
  32752. if (!t)
  32753. throw Error("unterminated string");
  32754. return this.index = e.lastIndex,
  32755. this.stack.push(this._stringOpen),
  32756. this._stringOpen = null,
  32757. t[1]
  32758. }
  32759. ,
  32760. i.next = function() {
  32761. if (0 < this.stack.length)
  32762. return this.stack.shift();
  32763. if (this.index >= this.source.length)
  32764. return null;
  32765. if (null !== this._stringOpen)
  32766. return this._readString();
  32767. var e, t, i;
  32768. do {
  32769. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  32770. if ("\n" === i && ++this.line,
  32771. ++this.index === this.source.length)
  32772. return null;
  32773. if ("/" === this.source.charAt(this.index))
  32774. if (++this.index,
  32775. "/" === this.source.charAt(this.index)) {
  32776. for (; "\n" !== this.source.charAt(++this.index); )
  32777. if (this.index == this.source.length)
  32778. return null;
  32779. ++this.index,
  32780. ++this.line,
  32781. e = !0
  32782. } else {
  32783. if ("*" !== (i = this.source.charAt(this.index)))
  32784. return "/";
  32785. do {
  32786. if ("\n" === i && ++this.line,
  32787. ++this.index === this.source.length)
  32788. return null;
  32789. t = i,
  32790. i = this.source.charAt(this.index)
  32791. } while ("*" !== t || "/" !== i);++this.index,
  32792. e = !0
  32793. }
  32794. } while (e);if (this.index === this.source.length)
  32795. return null;
  32796. var n = this.index;
  32797. if (a.DELIM.lastIndex = 0,
  32798. !a.DELIM.test(this.source.charAt(n++)))
  32799. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32800. ++n;
  32801. var r = this.source.substring(this.index, this.index = n);
  32802. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32803. r
  32804. }
  32805. ,
  32806. i.peek = function() {
  32807. if (0 === this.stack.length) {
  32808. var e = this.next();
  32809. if (null === e)
  32810. return null;
  32811. this.stack.push(e)
  32812. }
  32813. return this.stack[0]
  32814. }
  32815. ,
  32816. i.skip = function(e) {
  32817. var t = this.next();
  32818. if (t !== e)
  32819. throw Error("illegal '" + t + "', '" + e + "' expected")
  32820. }
  32821. ,
  32822. i.omit = function(e) {
  32823. return this.peek() === e && (this.next(),
  32824. !0)
  32825. }
  32826. ,
  32827. i.toString = function() {
  32828. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32829. }
  32830. ,
  32831. e.Tokenizer = t;
  32832. function l(e) {
  32833. this.tn = new t(e),
  32834. this.proto3 = !1
  32835. }
  32836. var c = l.prototype;
  32837. return c.parse = function() {
  32838. var e, t, i = {
  32839. name: "[ROOT]",
  32840. package: null,
  32841. messages: [],
  32842. enums: [],
  32843. imports: [],
  32844. options: {},
  32845. services: []
  32846. }, n = !0;
  32847. try {
  32848. for (; e = this.tn.next(); )
  32849. switch (e) {
  32850. case "package":
  32851. if (!n || null !== i.package)
  32852. throw Error("unexpected 'package'");
  32853. if (e = this.tn.next(),
  32854. !a.TYPEREF.test(e))
  32855. throw Error("illegal package name: " + e);
  32856. this.tn.skip(";"),
  32857. i.package = e;
  32858. break;
  32859. case "import":
  32860. if (!n)
  32861. throw Error("unexpected 'import'");
  32862. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32863. e = this._readString(),
  32864. this.tn.skip(";"),
  32865. t || i.imports.push(e);
  32866. break;
  32867. case "syntax":
  32868. if (!n)
  32869. throw Error("unexpected 'syntax'");
  32870. this.tn.skip("="),
  32871. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32872. this.tn.skip(";");
  32873. break;
  32874. case "message":
  32875. this._parseMessage(i, null),
  32876. n = !1;
  32877. break;
  32878. case "enum":
  32879. this._parseEnum(i),
  32880. n = !1;
  32881. break;
  32882. case "option":
  32883. this._parseOption(i);
  32884. break;
  32885. case "service":
  32886. this._parseService(i);
  32887. break;
  32888. case "extend":
  32889. this._parseExtend(i);
  32890. break;
  32891. default:
  32892. throw Error("unexpected '" + e + "'")
  32893. }
  32894. } catch (e) {
  32895. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32896. e
  32897. }
  32898. return delete i.name,
  32899. i
  32900. }
  32901. ,
  32902. l.parse = function(e) {
  32903. return new l(e).parse()
  32904. }
  32905. ,
  32906. c._readString = function() {
  32907. var e, t, i = "";
  32908. do {
  32909. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32910. throw Error("illegal string delimiter: " + t);
  32911. i += this.tn.next(),
  32912. this.tn.skip(t),
  32913. e = this.tn.peek()
  32914. } while ('"' === e || '"' === e);return i
  32915. }
  32916. ,
  32917. c._readValue = function(e) {
  32918. var t = this.tn.peek();
  32919. if ('"' === t || "'" === t)
  32920. return this._readString();
  32921. if (this.tn.next(),
  32922. a.NUMBER.test(t))
  32923. return o(t);
  32924. if (a.BOOL.test(t))
  32925. return "true" === t.toLowerCase();
  32926. if (e && a.TYPEREF.test(t))
  32927. return t;
  32928. throw Error("illegal value: " + t)
  32929. }
  32930. ,
  32931. c._parseOption = function(e, t) {
  32932. var i = this.tn.next()
  32933. , n = !1;
  32934. if ("(" === i && (n = !0,
  32935. i = this.tn.next()),
  32936. !a.TYPEREF.test(i))
  32937. throw Error("illegal option name: " + i);
  32938. var r = i;
  32939. n && (this.tn.skip(")"),
  32940. r = "(" + r + ")",
  32941. i = this.tn.peek(),
  32942. a.FQTYPEREF.test(i) && (r += i,
  32943. this.tn.next())),
  32944. this.tn.skip("="),
  32945. this._parseOptionValue(e, r),
  32946. t || this.tn.skip(";")
  32947. }
  32948. ,
  32949. c._parseOptionValue = function(e, t) {
  32950. var i = this.tn.peek();
  32951. if ("{" !== i)
  32952. n(e.options, t, this._readValue(!0));
  32953. else
  32954. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  32955. if (!a.NAME.test(i))
  32956. throw Error("illegal option name: " + t + "." + i);
  32957. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  32958. }
  32959. }
  32960. ,
  32961. c._parseService = function(e) {
  32962. var t = this.tn.next();
  32963. if (!a.NAME.test(t))
  32964. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  32965. var i = {
  32966. name: t,
  32967. rpc: {},
  32968. options: {}
  32969. };
  32970. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32971. if ("option" === t)
  32972. this._parseOption(i);
  32973. else {
  32974. if ("rpc" !== t)
  32975. throw Error("illegal service token: " + t);
  32976. this._parseServiceRPC(i)
  32977. }
  32978. this.tn.omit(";"),
  32979. e.services.push(i)
  32980. }
  32981. ,
  32982. c._parseServiceRPC = function(e) {
  32983. var t = this.tn.next();
  32984. if (!a.NAME.test(t))
  32985. throw Error("illegal rpc service method name: " + t);
  32986. var i = t
  32987. , n = {
  32988. request: null,
  32989. response: null,
  32990. request_stream: !1,
  32991. response_stream: !1,
  32992. options: {}
  32993. };
  32994. if (this.tn.skip("("),
  32995. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  32996. t = this.tn.next()),
  32997. !a.TYPEREF.test(t))
  32998. throw Error("illegal rpc service request type: " + t);
  32999. if (n.request = t,
  33000. this.tn.skip(")"),
  33001. "returns" !== (t = this.tn.next()).toLowerCase())
  33002. throw Error("illegal rpc service request type delimiter: " + t);
  33003. if (this.tn.skip("("),
  33004. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  33005. t = this.tn.next()),
  33006. n.response = t,
  33007. this.tn.skip(")"),
  33008. "{" === (t = this.tn.peek())) {
  33009. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  33010. if ("option" !== t)
  33011. throw Error("illegal rpc service token: " + t);
  33012. this._parseOption(n)
  33013. }
  33014. this.tn.omit(";")
  33015. } else
  33016. this.tn.skip(";");
  33017. void 0 === e.rpc && (e.rpc = {}),
  33018. e.rpc[i] = n
  33019. }
  33020. ,
  33021. c._parseMessage = function(e, t) {
  33022. var i = !!t
  33023. , n = this.tn.next()
  33024. , r = {
  33025. name: "",
  33026. fields: [],
  33027. enums: [],
  33028. messages: [],
  33029. options: {},
  33030. services: [],
  33031. oneofs: {}
  33032. };
  33033. if (!a.NAME.test(n))
  33034. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  33035. for (r.name = n,
  33036. i && (this.tn.skip("="),
  33037. t.id = s(this.tn.next()),
  33038. r.isGroup = !0),
  33039. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  33040. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  33041. if (a.RULE.test(n))
  33042. this._parseMessageField(r, n);
  33043. else if ("oneof" === n)
  33044. this._parseMessageOneOf(r);
  33045. else if ("enum" === n)
  33046. this._parseEnum(r);
  33047. else if ("message" === n)
  33048. this._parseMessage(r);
  33049. else if ("option" === n)
  33050. this._parseOption(r);
  33051. else if ("service" === n)
  33052. this._parseService(r);
  33053. else if ("extensions" === n)
  33054. r.extensions = this._parseExtensionRanges();
  33055. else if ("reserved" === n)
  33056. this._parseIgnored();
  33057. else if ("extend" === n)
  33058. this._parseExtend(r);
  33059. else {
  33060. if (!a.TYPEREF.test(n))
  33061. throw Error("illegal message token: " + n);
  33062. if (!this.proto3)
  33063. throw Error("illegal field rule: " + n);
  33064. this._parseMessageField(r, "optional", n)
  33065. }
  33066. return this.tn.omit(";"),
  33067. e.messages.push(r),
  33068. r
  33069. }
  33070. ,
  33071. c._parseIgnored = function() {
  33072. for (; ";" !== this.tn.peek(); )
  33073. this.tn.next();
  33074. this.tn.skip(";")
  33075. }
  33076. ,
  33077. c._parseMessageField = function(e, t, i) {
  33078. if (!a.RULE.test(t))
  33079. throw Error("illegal message field rule: " + t);
  33080. var n, r = {
  33081. rule: t,
  33082. type: "",
  33083. name: "",
  33084. options: {},
  33085. id: 0
  33086. };
  33087. if ("map" === t) {
  33088. if (i)
  33089. throw Error("illegal type: " + i);
  33090. if (this.tn.skip("<"),
  33091. n = this.tn.next(),
  33092. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  33093. throw Error("illegal message field type: " + n);
  33094. if (r.keytype = n,
  33095. this.tn.skip(","),
  33096. n = this.tn.next(),
  33097. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  33098. throw Error("illegal message field: " + n);
  33099. if (r.type = n,
  33100. this.tn.skip(">"),
  33101. n = this.tn.next(),
  33102. !a.NAME.test(n))
  33103. throw Error("illegal message field name: " + n);
  33104. r.name = n,
  33105. this.tn.skip("="),
  33106. r.id = s(this.tn.next()),
  33107. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  33108. this.tn.skip(";")
  33109. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  33110. var o = this._parseMessage(e, r);
  33111. if (!/^[A-Z]/.test(o.name))
  33112. throw Error("illegal group name: " + o.name);
  33113. r.type = o.name,
  33114. r.name = o.name.toLowerCase(),
  33115. this.tn.omit(";")
  33116. } else {
  33117. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  33118. throw Error("illegal message field type: " + i);
  33119. if (r.type = i,
  33120. n = this.tn.next(),
  33121. !a.NAME.test(n))
  33122. throw Error("illegal message field name: " + n);
  33123. r.name = n,
  33124. this.tn.skip("="),
  33125. r.id = s(this.tn.next()),
  33126. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  33127. this.tn.skip(";")
  33128. }
  33129. return e.fields.push(r),
  33130. r
  33131. }
  33132. ,
  33133. c._parseMessageOneOf = function(e) {
  33134. var t = this.tn.next();
  33135. if (!a.NAME.test(t))
  33136. throw Error("illegal oneof name: " + t);
  33137. var i, n = t, r = [];
  33138. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  33139. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  33140. r.push(i.id);
  33141. this.tn.omit(";"),
  33142. e.oneofs[n] = r
  33143. }
  33144. ,
  33145. c._parseFieldOptions = function(e) {
  33146. this.tn.skip("[");
  33147. for (var t = !0; "]" !== this.tn.peek(); )
  33148. t || this.tn.skip(","),
  33149. this._parseOption(e, !0),
  33150. t = !1;
  33151. this.tn.next()
  33152. }
  33153. ,
  33154. c._parseEnum = function(e) {
  33155. var t = {
  33156. name: "",
  33157. values: [],
  33158. options: {}
  33159. }
  33160. , i = this.tn.next();
  33161. if (!a.NAME.test(i))
  33162. throw Error("illegal name: " + i);
  33163. for (t.name = i,
  33164. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  33165. if ("option" === i)
  33166. this._parseOption(t);
  33167. else {
  33168. if (!a.NAME.test(i))
  33169. throw Error("illegal name: " + i);
  33170. this.tn.skip("=");
  33171. var n = {
  33172. name: i,
  33173. id: s(this.tn.next(), !0)
  33174. };
  33175. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  33176. options: {}
  33177. }),
  33178. this.tn.skip(";"),
  33179. t.values.push(n)
  33180. }
  33181. this.tn.omit(";"),
  33182. e.enums.push(t)
  33183. }
  33184. ,
  33185. c._parseExtensionRanges = function() {
  33186. var e, t, i, n = [];
  33187. do {
  33188. for (t = []; ; ) {
  33189. switch (e = this.tn.next()) {
  33190. case "min":
  33191. i = r.ID_MIN;
  33192. break;
  33193. case "max":
  33194. i = r.ID_MAX;
  33195. break;
  33196. default:
  33197. i = o(e)
  33198. }
  33199. if (t.push(i),
  33200. 2 === t.length)
  33201. break;
  33202. if ("to" !== this.tn.peek()) {
  33203. t.push(i);
  33204. break
  33205. }
  33206. this.tn.next()
  33207. }
  33208. n.push(t)
  33209. } while (this.tn.omit(","));return this.tn.skip(";"),
  33210. n
  33211. }
  33212. ,
  33213. c._parseExtend = function(e) {
  33214. var t = this.tn.next();
  33215. if (!a.TYPEREF.test(t))
  33216. throw Error("illegal extend reference: " + t);
  33217. var i = {
  33218. ref: t,
  33219. fields: []
  33220. };
  33221. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  33222. if (a.RULE.test(t))
  33223. this._parseMessageField(i, t);
  33224. else {
  33225. if (!a.TYPEREF.test(t))
  33226. throw Error("illegal extend token: " + t);
  33227. if (!this.proto3)
  33228. throw Error("illegal field rule: " + t);
  33229. this._parseMessageField(i, "optional", t)
  33230. }
  33231. return this.tn.omit(";"),
  33232. e.messages.push(i),
  33233. i
  33234. }
  33235. ,
  33236. c.toString = function() {
  33237. return "Parser at line " + this.tn.line
  33238. }
  33239. ,
  33240. e.Parser = l,
  33241. e
  33242. }(o, o.Lang),
  33243. o.Reflect = function(g) {
  33244. function a(e, t) {
  33245. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  33246. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  33247. if ("string" == typeof e)
  33248. return g.Long.fromString(e, t || !1, 10);
  33249. if ("number" == typeof e)
  33250. return g.Long.fromNumber(e, t || !1);
  33251. throw Error("not convertible to Long")
  33252. }
  33253. function m(e, t) {
  33254. var i = t.readVarint32()
  33255. , n = 7 & i
  33256. , r = i >>> 3;
  33257. switch (n) {
  33258. case g.WIRE_TYPES.VARINT:
  33259. for (; 128 == (128 & (i = t.readUint8())); )
  33260. ;
  33261. break;
  33262. case g.WIRE_TYPES.BITS64:
  33263. t.offset += 8;
  33264. break;
  33265. case g.WIRE_TYPES.LDELIM:
  33266. i = t.readVarint32(),
  33267. t.offset += i;
  33268. break;
  33269. case g.WIRE_TYPES.STARTGROUP:
  33270. m(r, t);
  33271. break;
  33272. case g.WIRE_TYPES.ENDGROUP:
  33273. if (r === e)
  33274. return !1;
  33275. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  33276. case g.WIRE_TYPES.BITS32:
  33277. t.offset += 4;
  33278. break;
  33279. default:
  33280. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  33281. }
  33282. return !0
  33283. }
  33284. function h(e, t, i) {
  33285. this.builder = e,
  33286. this.parent = t,
  33287. this.name = i,
  33288. this.className
  33289. }
  33290. var s = {}
  33291. , e = h.prototype;
  33292. e.fqn = function() {
  33293. for (var e = this.name, t = this; null != (t = t.parent); )
  33294. e = t.name + "." + e;
  33295. return e
  33296. }
  33297. ,
  33298. e.toString = function(e) {
  33299. return (e ? this.className + " " : "") + this.fqn()
  33300. }
  33301. ,
  33302. e.build = function() {
  33303. throw Error(this.toString(!0) + " cannot be built directly")
  33304. }
  33305. ,
  33306. s.T = h;
  33307. function l(e, t, i, n, r) {
  33308. h.call(this, e, t, i),
  33309. this.className = "Namespace",
  33310. this.children = [],
  33311. this.options = n || {},
  33312. this.syntax = r || "proto2"
  33313. }
  33314. var t = l.prototype = Object.create(h.prototype);
  33315. t.getChildren = function(e) {
  33316. if (null == (e = e || null))
  33317. return this.children.slice();
  33318. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  33319. this.children[i]instanceof e && t.push(this.children[i]);
  33320. return t
  33321. }
  33322. ,
  33323. t.addChild = function(e) {
  33324. var t;
  33325. if (t = this.getChild(e.name))
  33326. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  33327. t.name = t.originalName;
  33328. else {
  33329. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  33330. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  33331. e.name = e.originalName
  33332. }
  33333. this.children.push(e)
  33334. }
  33335. ,
  33336. t.getChild = function(e) {
  33337. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  33338. if (this.children[i][t] === e)
  33339. return this.children[i];
  33340. return null
  33341. }
  33342. ,
  33343. t.resolve = function(e, t) {
  33344. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  33345. if ("" === n[o]) {
  33346. for (; null !== r.parent; )
  33347. r = r.parent;
  33348. o++
  33349. }
  33350. do {
  33351. do {
  33352. if (!(r instanceof s.Namespace)) {
  33353. r = null;
  33354. break
  33355. }
  33356. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  33357. r = null;
  33358. break
  33359. }
  33360. r = i,
  33361. o++
  33362. } while (o < n.length);if (null != r)
  33363. break;
  33364. if (null !== this.parent)
  33365. return this.parent.resolve(e, t)
  33366. } while (null != r);return r
  33367. }
  33368. ,
  33369. t.qn = function(e) {
  33370. for (var t = [], i = e; t.unshift(i.name),
  33371. null !== (i = i.parent); )
  33372. ;
  33373. for (var n = 1; n <= t.length; n++) {
  33374. var r = t.slice(t.length - n);
  33375. if (e === this.resolve(r, e instanceof s.Namespace))
  33376. return r.join(".")
  33377. }
  33378. return e.fqn()
  33379. }
  33380. ,
  33381. t.build = function() {
  33382. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  33383. (e = i[n])instanceof l && (t[e.name] = e.build());
  33384. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33385. value: this.buildOpt()
  33386. }),
  33387. t
  33388. }
  33389. ,
  33390. t.buildOpt = function() {
  33391. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  33392. var r = t[i]
  33393. , o = this.options[t[i]];
  33394. e[r] = o
  33395. }
  33396. return e
  33397. }
  33398. ,
  33399. t.getOption = function(e) {
  33400. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  33401. }
  33402. ,
  33403. s.Namespace = l;
  33404. function u(e, t, i, n) {
  33405. if (this.type = e,
  33406. this.resolvedType = t,
  33407. this.isMapKey = i,
  33408. this.syntax = n,
  33409. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  33410. throw Error("Invalid map key type: " + e.name)
  33411. }
  33412. var i = u.prototype;
  33413. u.defaultFieldValue = function(e) {
  33414. if ("string" == typeof e && (e = g.TYPES[e]),
  33415. void 0 === e.defaultValue)
  33416. throw Error("default value for type " + e.name + " is not supported");
  33417. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  33418. }
  33419. ,
  33420. i.verifyValue = function(t) {
  33421. function i(e, t) {
  33422. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  33423. }
  33424. var n = this;
  33425. switch (this.type) {
  33426. case g.TYPES.int32:
  33427. case g.TYPES.sint32:
  33428. case g.TYPES.sfixed32:
  33429. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33430. 4294967295 < t ? 0 | t : t;
  33431. case g.TYPES.uint32:
  33432. case g.TYPES.fixed32:
  33433. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33434. t < 0 ? t >>> 0 : t;
  33435. case g.TYPES.int64:
  33436. case g.TYPES.sint64:
  33437. case g.TYPES.sfixed64:
  33438. if (g.Long)
  33439. try {
  33440. return a(t, !1)
  33441. } catch (e) {
  33442. i(typeof t, e.message)
  33443. }
  33444. else
  33445. i(typeof t, "requires Long.js");
  33446. case g.TYPES.uint64:
  33447. case g.TYPES.fixed64:
  33448. if (g.Long)
  33449. try {
  33450. return a(t, !0)
  33451. } catch (e) {
  33452. i(typeof t, e.message)
  33453. }
  33454. else
  33455. i(typeof t, "requires Long.js");
  33456. case g.TYPES.bool:
  33457. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  33458. t;
  33459. case g.TYPES.float:
  33460. case g.TYPES.double:
  33461. return "number" != typeof t && i(typeof t, "not a number"),
  33462. t;
  33463. case g.TYPES.string:
  33464. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  33465. "" + t;
  33466. case g.TYPES.bytes:
  33467. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  33468. case g.TYPES.enum:
  33469. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  33470. for (o = 0; o < e.length; o++) {
  33471. if (e[o].name == t)
  33472. return e[o].id;
  33473. if (e[o].id == t)
  33474. return e[o].id
  33475. }
  33476. if ("proto3" === this.syntax)
  33477. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33478. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  33479. t;
  33480. i(t, "not a valid enum value");
  33481. case g.TYPES.group:
  33482. case g.TYPES.message:
  33483. if (t && "object" == typeof t || i(typeof t, "object expected"),
  33484. t instanceof this.resolvedType.clazz)
  33485. return t;
  33486. if (t instanceof g.Builder.Message) {
  33487. var r = {};
  33488. for (var o in t)
  33489. t.hasOwnProperty(o) && (r[o] = t[o]);
  33490. t = r
  33491. }
  33492. return new this.resolvedType.clazz(t)
  33493. }
  33494. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  33495. }
  33496. ,
  33497. i.calculateLength = function(e, t) {
  33498. if (null === t)
  33499. return 0;
  33500. var i;
  33501. switch (this.type) {
  33502. case g.TYPES.int32:
  33503. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  33504. case g.TYPES.uint32:
  33505. return I.calculateVarint32(t);
  33506. case g.TYPES.sint32:
  33507. return I.calculateVarint32(I.zigZagEncode32(t));
  33508. case g.TYPES.fixed32:
  33509. case g.TYPES.sfixed32:
  33510. case g.TYPES.float:
  33511. return 4;
  33512. case g.TYPES.int64:
  33513. case g.TYPES.uint64:
  33514. return I.calculateVarint64(t);
  33515. case g.TYPES.sint64:
  33516. return I.calculateVarint64(I.zigZagEncode64(t));
  33517. case g.TYPES.fixed64:
  33518. case g.TYPES.sfixed64:
  33519. return 8;
  33520. case g.TYPES.bool:
  33521. return 1;
  33522. case g.TYPES.enum:
  33523. return I.calculateVarint32(t);
  33524. case g.TYPES.double:
  33525. return 8;
  33526. case g.TYPES.string:
  33527. return i = I.calculateUTF8Bytes(t),
  33528. I.calculateVarint32(i) + i;
  33529. case g.TYPES.bytes:
  33530. if (t.remaining() < 0)
  33531. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33532. return I.calculateVarint32(t.remaining()) + t.remaining();
  33533. case g.TYPES.message:
  33534. return i = this.resolvedType.calculate(t),
  33535. I.calculateVarint32(i) + i;
  33536. case g.TYPES.group:
  33537. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  33538. }
  33539. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33540. }
  33541. ,
  33542. i.encodeValue = function(e, t, i) {
  33543. if (null === t)
  33544. return i;
  33545. switch (this.type) {
  33546. case g.TYPES.int32:
  33547. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  33548. break;
  33549. case g.TYPES.uint32:
  33550. i.writeVarint32(t);
  33551. break;
  33552. case g.TYPES.sint32:
  33553. i.writeVarint32ZigZag(t);
  33554. break;
  33555. case g.TYPES.fixed32:
  33556. i.writeUint32(t);
  33557. break;
  33558. case g.TYPES.sfixed32:
  33559. i.writeInt32(t);
  33560. break;
  33561. case g.TYPES.int64:
  33562. case g.TYPES.uint64:
  33563. i.writeVarint64(t);
  33564. break;
  33565. case g.TYPES.sint64:
  33566. i.writeVarint64ZigZag(t);
  33567. break;
  33568. case g.TYPES.fixed64:
  33569. i.writeUint64(t);
  33570. break;
  33571. case g.TYPES.sfixed64:
  33572. i.writeInt64(t);
  33573. break;
  33574. case g.TYPES.bool:
  33575. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  33576. break;
  33577. case g.TYPES.enum:
  33578. i.writeVarint32(t);
  33579. break;
  33580. case g.TYPES.float:
  33581. i.writeFloat32(t);
  33582. break;
  33583. case g.TYPES.double:
  33584. i.writeFloat64(t);
  33585. break;
  33586. case g.TYPES.string:
  33587. i.writeVString(t);
  33588. break;
  33589. case g.TYPES.bytes:
  33590. if (t.remaining() < 0)
  33591. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33592. var n = t.offset;
  33593. i.writeVarint32(t.remaining()),
  33594. i.append(t),
  33595. t.offset = n;
  33596. break;
  33597. case g.TYPES.message:
  33598. var r = (new I).LE();
  33599. this.resolvedType.encode(t, r),
  33600. i.writeVarint32(r.offset),
  33601. i.append(r.flip());
  33602. break;
  33603. case g.TYPES.group:
  33604. this.resolvedType.encode(t, i),
  33605. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  33606. break;
  33607. default:
  33608. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33609. }
  33610. return i
  33611. }
  33612. ,
  33613. i.decode = function(e, t, i) {
  33614. if (t != this.type.wireType)
  33615. throw Error("Unexpected wire type for element");
  33616. var n, r;
  33617. switch (this.type) {
  33618. case g.TYPES.int32:
  33619. return 0 | e.readVarint32();
  33620. case g.TYPES.uint32:
  33621. return e.readVarint32() >>> 0;
  33622. case g.TYPES.sint32:
  33623. return 0 | e.readVarint32ZigZag();
  33624. case g.TYPES.fixed32:
  33625. return e.readUint32() >>> 0;
  33626. case g.TYPES.sfixed32:
  33627. return 0 | e.readInt32();
  33628. case g.TYPES.int64:
  33629. return e.readVarint64();
  33630. case g.TYPES.uint64:
  33631. return e.readVarint64().toUnsigned();
  33632. case g.TYPES.sint64:
  33633. return e.readVarint64ZigZag();
  33634. case g.TYPES.fixed64:
  33635. return e.readUint64();
  33636. case g.TYPES.sfixed64:
  33637. return e.readInt64();
  33638. case g.TYPES.bool:
  33639. return !!e.readVarint32();
  33640. case g.TYPES.enum:
  33641. return e.readVarint32();
  33642. case g.TYPES.float:
  33643. return e.readFloat();
  33644. case g.TYPES.double:
  33645. return e.readDouble();
  33646. case g.TYPES.string:
  33647. return e.readVString();
  33648. case g.TYPES.bytes:
  33649. if (r = e.readVarint32(),
  33650. e.remaining() < r)
  33651. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  33652. return (n = e.clone()).limit = n.offset + r,
  33653. e.offset += r,
  33654. n;
  33655. case g.TYPES.message:
  33656. return r = e.readVarint32(),
  33657. this.resolvedType.decode(e, r);
  33658. case g.TYPES.group:
  33659. return this.resolvedType.decode(e, -1, i)
  33660. }
  33661. throw Error("[INTERNAL] Illegal decode type")
  33662. }
  33663. ,
  33664. i.valueFromString = function(e) {
  33665. if (!this.isMapKey)
  33666. throw Error("valueFromString() called on non-map-key element");
  33667. switch (this.type) {
  33668. case g.TYPES.int32:
  33669. case g.TYPES.sint32:
  33670. case g.TYPES.sfixed32:
  33671. case g.TYPES.uint32:
  33672. case g.TYPES.fixed32:
  33673. return this.verifyValue(parseInt(e));
  33674. case g.TYPES.int64:
  33675. case g.TYPES.sint64:
  33676. case g.TYPES.sfixed64:
  33677. case g.TYPES.uint64:
  33678. case g.TYPES.fixed64:
  33679. return this.verifyValue(e);
  33680. case g.TYPES.bool:
  33681. return "true" === e;
  33682. case g.TYPES.string:
  33683. return this.verifyValue(e);
  33684. case g.TYPES.bytes:
  33685. return I.fromBinary(e)
  33686. }
  33687. }
  33688. ,
  33689. i.valueToString = function(e) {
  33690. if (!this.isMapKey)
  33691. throw Error("valueToString() called on non-map-key element");
  33692. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  33693. }
  33694. ,
  33695. s.Element = u;
  33696. var d = function(e, t, i, n, r, o) {
  33697. l.call(this, e, t, i, n, o),
  33698. this.className = "Message",
  33699. this.extensions = void 0,
  33700. this.clazz = null,
  33701. this.isGroup = !!r,
  33702. this._fields = null,
  33703. this._fieldsById = null,
  33704. this._fieldsByName = null
  33705. }
  33706. , n = d.prototype = Object.create(l.prototype);
  33707. n.build = function(e) {
  33708. if (this.clazz && !e)
  33709. return this.clazz;
  33710. var t = function(u, a) {
  33711. function d(e, i, n, r) {
  33712. if (null === e || "object" != typeof e) {
  33713. if (r && r instanceof u.Reflect.Enum) {
  33714. var t = u.Reflect.Enum.getName(r.object, e);
  33715. if (null !== t)
  33716. return t
  33717. }
  33718. return e
  33719. }
  33720. if (I.isByteBuffer(e))
  33721. return i ? e.toBase64() : e.toBuffer();
  33722. if (u.Long.isLong(e))
  33723. return n ? e.toString() : u.Long.fromValue(e);
  33724. var o;
  33725. if (Array.isArray(e))
  33726. return o = [],
  33727. e.forEach(function(e, t) {
  33728. o[t] = d(e, i, n, r)
  33729. }),
  33730. o;
  33731. if (o = {},
  33732. e instanceof u.Map) {
  33733. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  33734. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  33735. return o
  33736. }
  33737. var l = e.$type
  33738. , c = void 0;
  33739. for (var h in e)
  33740. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  33741. return o
  33742. }
  33743. var s = a.getChildren(u.Reflect.Message.Field)
  33744. , l = a.getChildren(u.Reflect.Message.OneOf)
  33745. , c = function(e, t) {
  33746. u.Builder.Message.call(this);
  33747. for (var i = 0, n = l.length; i < n; ++i)
  33748. this[l[i].name] = null;
  33749. for (i = 0,
  33750. n = s.length; i < n; ++i) {
  33751. var r = s[i];
  33752. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  33753. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  33754. }
  33755. var o;
  33756. if (0 < arguments.length)
  33757. if (1 !== arguments.length || null === e || "object" != typeof e || !("function" != typeof e.encode || e instanceof c) || Array.isArray(e) || e instanceof u.Map || I.isByteBuffer(e) || e instanceof ArrayBuffer || u.Long && e instanceof u.Long)
  33758. for (i = 0,
  33759. n = arguments.length; i < n; ++i)
  33760. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  33761. else
  33762. this.$set(e)
  33763. }
  33764. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  33765. o.add = function(e, t, i) {
  33766. var n = a._fieldsByName[e];
  33767. if (!i) {
  33768. if (!n)
  33769. throw Error(this + "#" + e + " is undefined");
  33770. if (!(n instanceof u.Reflect.Message.Field))
  33771. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  33772. if (!n.repeated)
  33773. throw Error(this + "#" + e + " is not a repeated field");
  33774. t = n.verifyValue(t, !0)
  33775. }
  33776. return null === this[e] && (this[e] = []),
  33777. this[e].push(t),
  33778. this
  33779. }
  33780. ,
  33781. o.$add = o.add,
  33782. o.set = function(e, t, i) {
  33783. if (e && "object" == typeof e) {
  33784. for (var n in i = t,
  33785. e)
  33786. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  33787. return this
  33788. }
  33789. var r = a._fieldsByName[e];
  33790. if (i)
  33791. this[e] = t;
  33792. else {
  33793. if (!r)
  33794. throw Error(this + "#" + e + " is not a field: undefined");
  33795. if (!(r instanceof u.Reflect.Message.Field))
  33796. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33797. this[r.name] = t = r.verifyValue(t)
  33798. }
  33799. if (r && r.oneof) {
  33800. var o = this[r.oneof.name];
  33801. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33802. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33803. }
  33804. return this
  33805. }
  33806. ,
  33807. o.$set = o.set,
  33808. o.get = function(e, t) {
  33809. if (t)
  33810. return this[e];
  33811. var i = a._fieldsByName[e];
  33812. if (!(i && i instanceof u.Reflect.Message.Field))
  33813. throw Error(this + "#" + e + " is not a field: undefined");
  33814. if (!(i instanceof u.Reflect.Message.Field))
  33815. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33816. return this[i.name]
  33817. }
  33818. ,
  33819. o.$get = o.get;
  33820. for (var e = 0; e < s.length; e++) {
  33821. var t = s[e];
  33822. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33823. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33824. return e.toUpperCase().replace("_", "")
  33825. });
  33826. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33827. function t(e, t) {
  33828. return this[i.name] = t ? e : i.verifyValue(e),
  33829. this
  33830. }
  33831. function n() {
  33832. return this[i.name]
  33833. }
  33834. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33835. return "_" + e
  33836. });
  33837. null === a.getChild("set" + e) && (o["set" + e] = t),
  33838. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33839. null === a.getChild("get" + e) && (o["get" + e] = n),
  33840. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33841. }(t)
  33842. }
  33843. return o.encode = function(t, e) {
  33844. "boolean" == typeof t && (e = t,
  33845. t = void 0);
  33846. var i = !1;
  33847. t || (t = new I,
  33848. i = !0);
  33849. var n = t.littleEndian;
  33850. try {
  33851. return a.encode(this, t.LE(), e),
  33852. (i ? t.flip() : t).LE(n)
  33853. } catch (e) {
  33854. throw t.LE(n),
  33855. e
  33856. }
  33857. }
  33858. ,
  33859. c.encode = function(e, t, i) {
  33860. return new c(e).encode(t, i)
  33861. }
  33862. ,
  33863. o.calculate = function() {
  33864. return a.calculate(this)
  33865. }
  33866. ,
  33867. o.encodeDelimited = function(e, t) {
  33868. var i = !1;
  33869. e || (e = new I,
  33870. i = !0);
  33871. var n = (new I).LE();
  33872. return a.encode(this, n, t).flip(),
  33873. e.writeVarint32(n.remaining()),
  33874. e.append(n),
  33875. i ? e.flip() : e
  33876. }
  33877. ,
  33878. o.encodeAB = function() {
  33879. try {
  33880. return this.encode().toArrayBuffer()
  33881. } catch (e) {
  33882. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33883. e
  33884. }
  33885. }
  33886. ,
  33887. o.toArrayBuffer = o.encodeAB,
  33888. o.encodeNB = function() {
  33889. try {
  33890. return this.encode().toBuffer()
  33891. } catch (e) {
  33892. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33893. e
  33894. }
  33895. }
  33896. ,
  33897. o.toBuffer = o.encodeNB,
  33898. o.encode64 = function() {
  33899. try {
  33900. return this.encode().toBase64()
  33901. } catch (e) {
  33902. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33903. e
  33904. }
  33905. }
  33906. ,
  33907. o.toBase64 = o.encode64,
  33908. o.encodeHex = function() {
  33909. try {
  33910. return this.encode().toHex()
  33911. } catch (e) {
  33912. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33913. e
  33914. }
  33915. }
  33916. ,
  33917. o.toHex = o.encodeHex,
  33918. o.toRaw = function(e, t) {
  33919. return d(this, !!e, !!t, this.$type)
  33920. }
  33921. ,
  33922. o.encodeJSON = function() {
  33923. return JSON.stringify(d(this, !0, !0, this.$type))
  33924. }
  33925. ,
  33926. c.decode = function(t, e, i) {
  33927. "string" == typeof e && (i = e,
  33928. e = -1),
  33929. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33930. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33931. try {
  33932. var r = a.decode(t.LE());
  33933. return t.LE(n),
  33934. r
  33935. } catch (e) {
  33936. throw t.LE(n),
  33937. e
  33938. }
  33939. }
  33940. ,
  33941. c.decodeDelimited = function(t, e) {
  33942. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  33943. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  33944. return null;
  33945. var i = t.offset
  33946. , n = t.readVarint32();
  33947. if (t.remaining() < n)
  33948. return t.offset = i,
  33949. null;
  33950. try {
  33951. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  33952. return t.offset += n,
  33953. r
  33954. } catch (e) {
  33955. throw t.offset += n,
  33956. e
  33957. }
  33958. }
  33959. ,
  33960. c.decode64 = function(e) {
  33961. return c.decode(e, "base64")
  33962. }
  33963. ,
  33964. c.decodeHex = function(e) {
  33965. return c.decode(e, "hex")
  33966. }
  33967. ,
  33968. c.decodeJSON = function(e) {
  33969. return new c(JSON.parse(e))
  33970. }
  33971. ,
  33972. o.toString = function() {
  33973. return a.toString()
  33974. }
  33975. ,
  33976. Object.defineProperty && (Object.defineProperty(c, "$options", {
  33977. value: a.buildOpt()
  33978. }),
  33979. Object.defineProperty(o, "$options", {
  33980. value: c.$options
  33981. }),
  33982. Object.defineProperty(c, "$type", {
  33983. value: a
  33984. }),
  33985. Object.defineProperty(o, "$type", {
  33986. value: a
  33987. })),
  33988. c
  33989. }(g, this);
  33990. this._fields = [],
  33991. this._fieldsById = {},
  33992. this._fieldsByName = {};
  33993. for (var i, n = 0, r = this.children.length; n < r; n++)
  33994. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  33995. if (t.hasOwnProperty(i.name))
  33996. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  33997. t[i.name] = i.build()
  33998. } else if (i instanceof d.Field)
  33999. i.build(),
  34000. this._fields.push(i),
  34001. this._fieldsById[i.id] = i,
  34002. this._fieldsByName[i.name] = i;
  34003. else if (!(i instanceof d.OneOf || i instanceof v))
  34004. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  34005. return this.clazz = t
  34006. }
  34007. ,
  34008. n.encode = function(e, t, i) {
  34009. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  34010. r = e[(n = this._fields[a]).name],
  34011. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  34012. if (null === o)
  34013. return t;
  34014. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  34015. throw l.encoded = t,
  34016. l
  34017. }
  34018. ,
  34019. n.calculate = function(e) {
  34020. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  34021. if (i = e[(t = this._fields[r]).name],
  34022. t.required && null === i)
  34023. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  34024. n += t.calculate(i, e)
  34025. }
  34026. return n
  34027. }
  34028. ,
  34029. n.decode = function(e, t, i) {
  34030. t = "number" == typeof t ? t : -1;
  34031. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  34032. if (o = (n = e.readVarint32()) >>> 3,
  34033. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  34034. if (o !== i)
  34035. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  34036. break
  34037. }
  34038. if (a = this._fieldsById[o]) {
  34039. if (a.repeated && !a.options.packed)
  34040. l[a.name].push(a.decode(r, e));
  34041. else if (a.map) {
  34042. var c = a.decode(r, e);
  34043. l[a.name].set(c[0], c[1])
  34044. } else if (l[a.name] = a.decode(r, e),
  34045. a.oneof) {
  34046. var h = l[a.oneof.name];
  34047. null !== h && h !== a.name && (l[h] = null),
  34048. l[a.oneof.name] = a.name
  34049. }
  34050. } else
  34051. switch (r) {
  34052. case g.WIRE_TYPES.VARINT:
  34053. e.readVarint32();
  34054. break;
  34055. case g.WIRE_TYPES.BITS32:
  34056. e.offset += 4;
  34057. break;
  34058. case g.WIRE_TYPES.BITS64:
  34059. e.offset += 8;
  34060. break;
  34061. case g.WIRE_TYPES.LDELIM:
  34062. var u = e.readVarint32();
  34063. e.offset += u;
  34064. break;
  34065. case g.WIRE_TYPES.STARTGROUP:
  34066. for (; m(o, e); )
  34067. ;
  34068. break;
  34069. default:
  34070. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  34071. }
  34072. }
  34073. for (var d = 0, p = this._fields.length; d < p; ++d)
  34074. if (null === l[(a = this._fields[d]).name])
  34075. if ("proto3" === this.syntax)
  34076. l[a.name] = a.defaultValue;
  34077. else {
  34078. if (a.required) {
  34079. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  34080. throw f.decoded = l,
  34081. f
  34082. }
  34083. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  34084. }
  34085. return l
  34086. }
  34087. ,
  34088. s.Message = d;
  34089. function c(e, t, i, n, r, o, a, s, l, c) {
  34090. h.call(this, e, t, o),
  34091. this.className = "Message.Field",
  34092. this.required = "required" === i,
  34093. this.repeated = "repeated" === i,
  34094. this.map = "map" === i,
  34095. this.keyType = n || null,
  34096. this.type = r,
  34097. this.resolvedType = null,
  34098. this.id = a,
  34099. this.options = s || {},
  34100. this.defaultValue = null,
  34101. this.oneof = l || null,
  34102. this.syntax = c || "proto2",
  34103. this.originalName = this.name,
  34104. this.element = null,
  34105. this.keyElement = null,
  34106. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  34107. }
  34108. var r = c.prototype = Object.create(h.prototype);
  34109. r.build = function() {
  34110. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  34111. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  34112. "proto3" !== this.syntax || this.repeated || this.map ? void 0 !== this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = u.defaultFieldValue(this.type)
  34113. }
  34114. ,
  34115. r.verifyValue = function(e, t) {
  34116. function i(e, t) {
  34117. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  34118. }
  34119. t = t || !1;
  34120. var n, r = this;
  34121. if (null === e)
  34122. return this.required && i(typeof e, "required"),
  34123. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  34124. null;
  34125. if (!this.repeated || t)
  34126. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  34127. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  34128. this.element.verifyValue(e));
  34129. Array.isArray(e) || (e = [e]);
  34130. var o = [];
  34131. for (n = 0; n < e.length; n++)
  34132. o.push(this.element.verifyValue(e[n]));
  34133. return o
  34134. }
  34135. ,
  34136. r.hasWirePresence = function(e, t) {
  34137. if ("proto3" !== this.syntax)
  34138. return null !== e;
  34139. if (this.oneof && t[this.oneof.name] === this.name)
  34140. return !0;
  34141. switch (this.type) {
  34142. case g.TYPES.int32:
  34143. case g.TYPES.sint32:
  34144. case g.TYPES.sfixed32:
  34145. case g.TYPES.uint32:
  34146. case g.TYPES.fixed32:
  34147. return 0 !== e;
  34148. case g.TYPES.int64:
  34149. case g.TYPES.sint64:
  34150. case g.TYPES.sfixed64:
  34151. case g.TYPES.uint64:
  34152. case g.TYPES.fixed64:
  34153. return 0 !== e.low || 0 !== e.high;
  34154. case g.TYPES.bool:
  34155. return e;
  34156. case g.TYPES.float:
  34157. case g.TYPES.double:
  34158. return 0 !== e;
  34159. case g.TYPES.string:
  34160. return 0 < e.length;
  34161. case g.TYPES.bytes:
  34162. return 0 < e.remaining();
  34163. case g.TYPES.enum:
  34164. return 0 !== e;
  34165. case g.TYPES.message:
  34166. return null !== e;
  34167. default:
  34168. return !0
  34169. }
  34170. }
  34171. ,
  34172. r.encode = function(t, r, e) {
  34173. if (null === this.type || "object" != typeof this.type)
  34174. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  34175. if (null === t || this.repeated && 0 == t.length)
  34176. return r;
  34177. try {
  34178. var i;
  34179. if (this.repeated)
  34180. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  34181. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34182. r.ensureCapacity(r.offset += 1);
  34183. var n = r.offset;
  34184. for (i = 0; i < t.length; i++)
  34185. this.element.encodeValue(this.id, t[i], r);
  34186. var o = r.offset - n
  34187. , a = I.calculateVarint32(o);
  34188. if (1 < a) {
  34189. var s = r.slice(n, r.offset);
  34190. n += a - 1,
  34191. r.offset = n,
  34192. r.append(s)
  34193. }
  34194. r.writeVarint32(o, n - a)
  34195. } else
  34196. for (i = 0; i < t.length; i++)
  34197. r.writeVarint32(this.id << 3 | this.type.wireType),
  34198. this.element.encodeValue(this.id, t[i], r);
  34199. else
  34200. this.map ? t.forEach(function(e, t, i) {
  34201. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  34202. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34203. r.writeVarint32(n),
  34204. r.writeVarint32(8 | this.keyType.wireType),
  34205. this.keyElement.encodeValue(1, t, r),
  34206. r.writeVarint32(16 | this.type.wireType),
  34207. this.element.encodeValue(2, e, r)
  34208. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  34209. this.element.encodeValue(this.id, t, r))
  34210. } catch (e) {
  34211. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  34212. }
  34213. return r
  34214. }
  34215. ,
  34216. r.calculate = function(t, e) {
  34217. if (t = this.verifyValue(t),
  34218. null === this.type || "object" != typeof this.type)
  34219. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  34220. if (null === t || this.repeated && 0 == t.length)
  34221. return 0;
  34222. var r = 0;
  34223. try {
  34224. var i, n;
  34225. if (this.repeated)
  34226. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  34227. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34228. i = n = 0; i < t.length; i++)
  34229. n += this.element.calculateLength(this.id, t[i]);
  34230. r += I.calculateVarint32(n),
  34231. r += n
  34232. } else
  34233. for (i = 0; i < t.length; i++)
  34234. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  34235. r += this.element.calculateLength(this.id, t[i]);
  34236. else
  34237. this.map ? t.forEach(function(e, t, i) {
  34238. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  34239. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34240. r += I.calculateVarint32(n),
  34241. r += n
  34242. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  34243. r += this.element.calculateLength(this.id, t))
  34244. } catch (e) {
  34245. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  34246. }
  34247. return r
  34248. }
  34249. ,
  34250. r.decode = function(e, t, i) {
  34251. var n, r;
  34252. if (!(!this.map && e == this.type.wireType || !i && this.repeated && this.options.packed && e == g.WIRE_TYPES.LDELIM || this.map && e == g.WIRE_TYPES.LDELIM))
  34253. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  34254. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  34255. r = t.readVarint32(),
  34256. r = t.offset + r;
  34257. for (var o = []; t.offset < r; )
  34258. o.push(this.decode(this.type.wireType, t, !0));
  34259. return o
  34260. }
  34261. if (this.map) {
  34262. var a = u.defaultFieldValue(this.keyType);
  34263. if (n = u.defaultFieldValue(this.type),
  34264. r = t.readVarint32(),
  34265. t.remaining() < r)
  34266. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  34267. var s = t.clone();
  34268. for (s.limit = s.offset + r,
  34269. t.offset += r; 0 < s.remaining(); ) {
  34270. var l = s.readVarint32();
  34271. e = 7 & l;
  34272. var c = l >>> 3;
  34273. if (1 == c)
  34274. a = this.keyElement.decode(s, e, c);
  34275. else {
  34276. if (2 != c)
  34277. throw Error("Unexpected tag in map field key/value submessage");
  34278. n = this.element.decode(s, e, c)
  34279. }
  34280. }
  34281. return [a, n]
  34282. }
  34283. return this.element.decode(t, e, this.id)
  34284. }
  34285. ,
  34286. s.Message.Field = c;
  34287. function o(e, t, i, n, r, o, a) {
  34288. c.call(this, e, t, i, null, n, r, o, a),
  34289. this.extension
  34290. }
  34291. o.prototype = Object.create(c.prototype),
  34292. s.Message.ExtensionField = o;
  34293. s.Message.OneOf = function(e, t, i) {
  34294. h.call(this, e, t, i),
  34295. this.fields = []
  34296. }
  34297. ;
  34298. var p = function(e, t, i, n, r) {
  34299. l.call(this, e, t, i, n, r),
  34300. this.className = "Enum",
  34301. this.object = null
  34302. };
  34303. p.getName = function(e, t) {
  34304. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  34305. if (e[i = n[r]] === t)
  34306. return i;
  34307. return null
  34308. }
  34309. ,
  34310. (p.prototype = Object.create(l.prototype)).build = function(e) {
  34311. if (this.object && !e)
  34312. return this.object;
  34313. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  34314. t[i[n].name] = i[n].id;
  34315. return Object.defineProperty && Object.defineProperty(t, "$options", {
  34316. value: this.buildOpt(),
  34317. enumerable: !1
  34318. }),
  34319. this.object = t
  34320. }
  34321. ,
  34322. s.Enum = p;
  34323. function f(e, t, i, n) {
  34324. h.call(this, e, t, i),
  34325. this.className = "Enum.Value",
  34326. this.id = n
  34327. }
  34328. f.prototype = Object.create(h.prototype),
  34329. s.Enum.Value = f;
  34330. var v = function(e, t, i, n) {
  34331. h.call(this, e, t, i),
  34332. this.field = n
  34333. };
  34334. v.prototype = Object.create(h.prototype),
  34335. s.Extension = v;
  34336. var y = function(e, t, i, n) {
  34337. l.call(this, e, t, i, n),
  34338. this.className = "Service",
  34339. this.clazz = null
  34340. };
  34341. (y.prototype = Object.create(l.prototype)).build = function(e) {
  34342. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  34343. for (var o = function(e) {
  34344. t.Builder.Service.call(this),
  34345. this.rpcImpl = e || function(e, t, i) {
  34346. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  34347. }
  34348. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  34349. !function(n) {
  34350. e[n.name] = function(e, i) {
  34351. try {
  34352. try {
  34353. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  34354. } catch (e) {
  34355. if (!(e instanceof TypeError))
  34356. throw e
  34357. }
  34358. if (null === e || "object" != typeof e)
  34359. throw Error("Illegal arguments");
  34360. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  34361. this.rpcImpl(n.fqn(), e, function(e, t) {
  34362. if (!e) {
  34363. null === t && (t = "");
  34364. try {
  34365. t = n.resolvedResponseType.clazz.decode(t)
  34366. } catch (e) {}
  34367. return t && t instanceof n.resolvedResponseType.clazz ? void i(null, t) : void i(Error("Illegal response type received in service method " + r.name + "#" + n.name))
  34368. }
  34369. i(e)
  34370. })
  34371. } catch (e) {
  34372. setTimeout(i.bind(this, e), 0)
  34373. }
  34374. }
  34375. ,
  34376. o[n.name] = function(e, t, i) {
  34377. new o(e)[n.name](t, i)
  34378. }
  34379. ,
  34380. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  34381. value: n.buildOpt()
  34382. }),
  34383. Object.defineProperty(e[n.name], "$options", {
  34384. value: o[n.name].$options
  34385. }))
  34386. }(i[n]);
  34387. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  34388. value: r.buildOpt()
  34389. }),
  34390. Object.defineProperty(e, "$options", {
  34391. value: o.$options
  34392. }),
  34393. Object.defineProperty(o, "$type", {
  34394. value: r
  34395. }),
  34396. Object.defineProperty(e, "$type", {
  34397. value: r
  34398. })),
  34399. o
  34400. }(g, this)
  34401. }
  34402. ,
  34403. s.Service = y;
  34404. function A(e, t, i, n) {
  34405. h.call(this, e, t, i),
  34406. this.className = "Service.Method",
  34407. this.options = n || {}
  34408. }
  34409. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  34410. s.Service.Method = A;
  34411. function C(e, t, i, n, r, o, a, s) {
  34412. A.call(this, e, t, i, s),
  34413. this.className = "Service.RPCMethod",
  34414. this.requestName = n,
  34415. this.responseName = r,
  34416. this.requestStream = o,
  34417. this.responseStream = a,
  34418. this.resolvedRequestType = null,
  34419. this.resolvedResponseType = null
  34420. }
  34421. return C.prototype = Object.create(A.prototype),
  34422. s.Service.RPCMethod = C,
  34423. s
  34424. }(o),
  34425. o.Builder = (i = (u = o).Lang,
  34426. s = o.Reflect,
  34427. n = h.prototype,
  34428. h.isMessage = function(e) {
  34429. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  34430. }
  34431. ,
  34432. h.isMessageField = function(e) {
  34433. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  34434. }
  34435. ,
  34436. h.isEnum = function(e) {
  34437. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  34438. }
  34439. ,
  34440. h.isService = function(e) {
  34441. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  34442. }
  34443. ,
  34444. h.isExtend = function(e) {
  34445. return "string" == typeof e.ref
  34446. }
  34447. ,
  34448. n.reset = function() {
  34449. return this.ptr = this.ns,
  34450. this
  34451. }
  34452. ,
  34453. n.define = function(e) {
  34454. if ("string" != typeof e || !i.TYPEREF.test(e))
  34455. throw Error("illegal namespace: " + e);
  34456. return e.split(".").forEach(function(e) {
  34457. var t = this.ptr.getChild(e);
  34458. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  34459. this.ptr = t
  34460. }, this),
  34461. this
  34462. }
  34463. ,
  34464. n.create = function(e) {
  34465. if (!e)
  34466. return this;
  34467. if (Array.isArray(e)) {
  34468. if (0 === e.length)
  34469. return this;
  34470. e = e.slice()
  34471. } else
  34472. e = [e];
  34473. for (var t = [e]; 0 < t.length; ) {
  34474. if (e = t.pop(),
  34475. !Array.isArray(e))
  34476. throw Error("not a valid namespace: " + JSON.stringify(e));
  34477. for (; 0 < e.length; ) {
  34478. var i = e.shift();
  34479. if (h.isMessage(i)) {
  34480. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  34481. , n = {};
  34482. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  34483. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  34484. }, this),
  34485. i.fields && i.fields.forEach(function(e) {
  34486. if (null !== o.getChild(0 | e.id))
  34487. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  34488. if (e.options && "object" != typeof e.options)
  34489. throw Error("illegal field options in " + o.name + "#" + e.name);
  34490. var t = null;
  34491. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  34492. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  34493. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  34494. t && t.fields.push(e),
  34495. o.addChild(e)
  34496. }, this);
  34497. var r = [];
  34498. if (i.enums && i.enums.forEach(function(e) {
  34499. r.push(e)
  34500. }),
  34501. i.messages && i.messages.forEach(function(e) {
  34502. r.push(e)
  34503. }),
  34504. i.services && i.services.forEach(function(e) {
  34505. r.push(e)
  34506. }),
  34507. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  34508. this.ptr.addChild(o),
  34509. 0 < r.length) {
  34510. t.push(e),
  34511. e = r,
  34512. r = null,
  34513. this.ptr = o,
  34514. o = null;
  34515. continue
  34516. }
  34517. r = null
  34518. } else if (h.isEnum(i))
  34519. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  34520. i.values.forEach(function(e) {
  34521. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  34522. }, this),
  34523. this.ptr.addChild(o);
  34524. else if (h.isService(i))
  34525. o = new s.Service(this,this.ptr,i.name,i.options),
  34526. Object.keys(i.rpc).forEach(function(e) {
  34527. var t = i.rpc[e];
  34528. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  34529. }, this),
  34530. this.ptr.addChild(o);
  34531. else {
  34532. if (!h.isExtend(i))
  34533. throw Error("not a valid definition: " + JSON.stringify(i));
  34534. if (o = this.ptr.resolve(i.ref, !0))
  34535. i.fields.forEach(function(t) {
  34536. if (null !== o.getChild(0 | t.id))
  34537. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  34538. if (o.extensions) {
  34539. var i = !1;
  34540. if (o.extensions.forEach(function(e) {
  34541. t.id >= e[0] && t.id <= e[1] && (i = !0)
  34542. }),
  34543. !i)
  34544. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  34545. }
  34546. var e = t.name;
  34547. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  34548. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  34549. , r = new s.Extension(this,this.ptr,t.name,n);
  34550. n.extension = r,
  34551. this.ptr.addChild(r),
  34552. o.addChild(n)
  34553. }, this);
  34554. else if (!/\.?google\.protobuf\./.test(i.ref))
  34555. throw Error("extended message " + i.ref + " is not defined")
  34556. }
  34557. o = i = null
  34558. }
  34559. e = null,
  34560. this.ptr = this.ptr.parent
  34561. }
  34562. return this.resolved = !1,
  34563. this.result = null,
  34564. this
  34565. }
  34566. ,
  34567. n.import = function(t, e) {
  34568. var i = "/";
  34569. if ("string" == typeof e) {
  34570. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  34571. !0 === this.files[e])
  34572. return this.reset();
  34573. this.files[e] = !0
  34574. } else if ("object" == typeof e) {
  34575. var n = e.root;
  34576. u.Util.IS_NODE && (n = p("path").resolve(n)),
  34577. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  34578. var r = n + i + e.file;
  34579. if (!0 === this.files[r])
  34580. return this.reset();
  34581. this.files[r] = !0
  34582. }
  34583. if (t.imports && 0 < t.imports.length) {
  34584. var o, a = !1;
  34585. "object" == typeof e ? (this.importRoot = e.root,
  34586. a = !0,
  34587. o = this.importRoot,
  34588. e = e.file,
  34589. (0 <= o.indexOf("\\") || 0 <= e.indexOf("\\")) && (i = "\\")) : "string" == typeof e ? this.importRoot ? o = this.importRoot : 0 <= e.indexOf("/") ? "" === (o = e.replace(/\/[^\/]*$/, "")) && (o = "/") : 0 <= e.indexOf("\\") ? (o = e.replace(/\\[^\\]*$/, ""),
  34590. i = "\\") : o = "." : o = null;
  34591. for (var s = 0; s < t.imports.length; s++)
  34592. if ("string" == typeof t.imports[s]) {
  34593. if (!o)
  34594. throw Error("cannot determine import root");
  34595. var l = t.imports[s];
  34596. if ("google/protobuf/descriptor.proto" === l)
  34597. continue;
  34598. if (l = o + i + l,
  34599. !0 === this.files[l])
  34600. continue;
  34601. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  34602. var c = u.Util.fetch(l);
  34603. if (null === c)
  34604. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  34605. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  34606. } else
  34607. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34608. return t + "_import" + s + "." + i
  34609. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  34610. a && (this.importRoot = null)
  34611. }
  34612. t.package && this.define(t.package),
  34613. t.syntax && function t(i) {
  34614. i.messages && i.messages.forEach(function(e) {
  34615. e.syntax = i.syntax,
  34616. t(e)
  34617. }),
  34618. i.enums && i.enums.forEach(function(e) {
  34619. e.syntax = i.syntax
  34620. })
  34621. }(t);
  34622. var h = this.ptr;
  34623. return t.options && Object.keys(t.options).forEach(function(e) {
  34624. h.options[e] = t.options[e]
  34625. }),
  34626. t.messages && (this.create(t.messages),
  34627. this.ptr = h),
  34628. t.enums && (this.create(t.enums),
  34629. this.ptr = h),
  34630. t.services && (this.create(t.services),
  34631. this.ptr = h),
  34632. t.extends && this.create(t.extends),
  34633. this.reset()
  34634. }
  34635. ,
  34636. n.resolveAll = function() {
  34637. var e;
  34638. if (null == this.ptr || "object" == typeof this.ptr.type)
  34639. return this;
  34640. if (this.ptr instanceof s.Namespace)
  34641. this.ptr.children.forEach(function(e) {
  34642. this.ptr = e,
  34643. this.resolveAll()
  34644. }, this);
  34645. else if (this.ptr instanceof s.Message.Field) {
  34646. if (i.TYPE.test(this.ptr.type))
  34647. this.ptr.type = u.TYPES[this.ptr.type];
  34648. else {
  34649. if (!i.TYPEREF.test(this.ptr.type))
  34650. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34651. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  34652. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34653. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  34654. if (this.ptr.type = u.TYPES.enum,
  34655. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34656. throw Error("proto3 message cannot reference proto2 enum")
  34657. } else {
  34658. if (!(e instanceof s.Message))
  34659. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34660. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  34661. }
  34662. }
  34663. if (this.ptr.map) {
  34664. if (!i.TYPE.test(this.ptr.keyType))
  34665. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34666. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  34667. }
  34668. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  34669. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  34670. throw Error("illegal service type in " + this.ptr.toString(!0));
  34671. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  34672. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34673. if (this.ptr.resolvedRequestType = e,
  34674. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  34675. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34676. this.ptr.resolvedResponseType = e
  34677. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  34678. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34679. return this.reset()
  34680. }
  34681. ,
  34682. n.build = function(e) {
  34683. if (this.reset(),
  34684. this.resolved || (this.resolveAll(),
  34685. this.resolved = !0,
  34686. this.result = null),
  34687. null === this.result && (this.result = this.ns.build()),
  34688. !e)
  34689. return this.result;
  34690. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34691. if (!i[t[n]]) {
  34692. i = null;
  34693. break
  34694. }
  34695. i = i[t[n]]
  34696. }
  34697. return i
  34698. }
  34699. ,
  34700. n.lookup = function(e, t) {
  34701. return e ? this.ns.resolve(e, t) : this.ns
  34702. }
  34703. ,
  34704. n.toString = function() {
  34705. return "Builder"
  34706. }
  34707. ,
  34708. h.Message = function() {}
  34709. ,
  34710. h.Enum = function() {}
  34711. ,
  34712. h.Service = function() {}
  34713. ,
  34714. h),
  34715. o.Map = (a = o.Reflect,
  34716. (t = c.prototype).clear = function() {
  34717. this.map = {}
  34718. }
  34719. ,
  34720. t.delete = function(e) {
  34721. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34722. , i = t in this.map;
  34723. return delete this.map[t],
  34724. i
  34725. }
  34726. ,
  34727. t.entries = function() {
  34728. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  34729. t.push([(e = this.map[i[n]]).key, e.value]);
  34730. return l(t)
  34731. }
  34732. ,
  34733. t.keys = function() {
  34734. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34735. e.push(this.map[t[i]].key);
  34736. return l(e)
  34737. }
  34738. ,
  34739. t.values = function() {
  34740. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34741. e.push(this.map[t[i]].value);
  34742. return l(e)
  34743. }
  34744. ,
  34745. t.forEach = function(e, t) {
  34746. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34747. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34748. }
  34749. ,
  34750. t.set = function(e, t) {
  34751. var i = this.keyElem.verifyValue(e)
  34752. , n = this.valueElem.verifyValue(t);
  34753. return this.map[this.keyElem.valueToString(i)] = {
  34754. key: i,
  34755. value: n
  34756. },
  34757. this
  34758. }
  34759. ,
  34760. t.get = function(e) {
  34761. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34762. if (t in this.map)
  34763. return this.map[t].value
  34764. }
  34765. ,
  34766. t.has = function(e) {
  34767. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  34768. }
  34769. ,
  34770. c),
  34771. o.loadProto = function(e, t, i) {
  34772. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34773. t = void 0),
  34774. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  34775. }
  34776. ,
  34777. o.protoFromString = o.loadProto,
  34778. o.loadProtoFile = function(t, i, n) {
  34779. if (i && "object" == typeof i ? (n = i,
  34780. i = null) : i && "function" == typeof i || (i = null),
  34781. i)
  34782. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34783. if (null !== e)
  34784. try {
  34785. i(null, o.loadProto(e, n, t))
  34786. } catch (e) {
  34787. i(e)
  34788. }
  34789. else
  34790. i(Error("Failed to fetch file"))
  34791. });
  34792. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34793. return null === e ? null : o.loadProto(e, n, t)
  34794. }
  34795. ,
  34796. o.protoFromFile = o.loadProtoFile,
  34797. o.newBuilder = function(e) {
  34798. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34799. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34800. new o.Builder(e)
  34801. }
  34802. ,
  34803. o.loadJson = function(e, t, i) {
  34804. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34805. t = null),
  34806. t && "object" == typeof t || (t = o.newBuilder()),
  34807. "string" == typeof e && (e = JSON.parse(e)),
  34808. t.import(e, i),
  34809. t.resolveAll(),
  34810. t
  34811. }
  34812. ,
  34813. o.loadJsonFile = function(t, i, n) {
  34814. if (i && "object" == typeof i ? (n = i,
  34815. i = null) : i && "function" == typeof i || (i = null),
  34816. i)
  34817. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34818. if (null !== e)
  34819. try {
  34820. i(null, o.loadJson(JSON.parse(e), n, t))
  34821. } catch (e) {
  34822. i(e)
  34823. }
  34824. else
  34825. i(Error("Failed to fetch file"))
  34826. });
  34827. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34828. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34829. }
  34830. ,
  34831. o;
  34832. function l(e) {
  34833. var t = 0;
  34834. return {
  34835. next: function() {
  34836. return t < e.length ? {
  34837. done: !1,
  34838. value: e[t++]
  34839. } : {
  34840. done: !0
  34841. }
  34842. }
  34843. }
  34844. }
  34845. function c(e, t) {
  34846. if (!e.map)
  34847. throw Error("field is not a map");
  34848. if (this.field = e,
  34849. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34850. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34851. this.map = {},
  34852. Object.defineProperty(this, "size", {
  34853. get: function() {
  34854. return Object.keys(this.map).length
  34855. }
  34856. }),
  34857. t)
  34858. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34859. var r = this.keyElem.valueFromString(i[n])
  34860. , o = this.valueElem.verifyValue(t[i[n]]);
  34861. this.map[this.keyElem.valueToString(r)] = {
  34862. key: r,
  34863. value: o
  34864. }
  34865. }
  34866. }
  34867. function h(e) {
  34868. this.ns = new s.Namespace(this,null,""),
  34869. this.ptr = this.ns,
  34870. this.resolved = !1,
  34871. this.result = null,
  34872. this.files = {},
  34873. this.importRoot = null,
  34874. this.options = e || {}
  34875. }
  34876. }
  34877. ,
  34878. "function" == typeof define && define.amd ? define(["bytebuffer"], t) : "function" == typeof p && "object" == typeof i && i && i.exports ? i.exports = t(p("bytebuffer")) : (e.dcodeIO = e.dcodeIO || {}).ProtoBuf = t(e.dcodeIO.ByteBuffer)
  34879. }
  34880. ).call(this, p("_process"))
  34881. }
  34882. , {
  34883. _process: 203,
  34884. bytebuffer: 215,
  34885. fs: 197,
  34886. path: 197
  34887. }],
  34888. 215: [function(t, e, i) {
  34889. var n, r;
  34890. n = this,
  34891. r = function(l) {
  34892. "use strict";
  34893. function s(e) {
  34894. var t = 0;
  34895. return function() {
  34896. return t < e.length ? e.charCodeAt(t++) : null
  34897. }
  34898. }
  34899. function c() {
  34900. var e = []
  34901. , t = [];
  34902. return function() {
  34903. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34904. e.length = 0),
  34905. void Array.prototype.push.apply(e, arguments))
  34906. }
  34907. }
  34908. function n(e, t, i, n, r) {
  34909. 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];
  34910. for (u += d,
  34911. o = p & (1 << -h) - 1,
  34912. p >>= -h,
  34913. h += s; 0 < h; o = 256 * o + e[t + u],
  34914. u += d,
  34915. h -= 8)
  34916. ;
  34917. for (a = o & (1 << -h) - 1,
  34918. o >>= -h,
  34919. h += n; 0 < h; a = 256 * a + e[t + u],
  34920. u += d,
  34921. h -= 8)
  34922. ;
  34923. if (0 === o)
  34924. o = 1 - c;
  34925. else {
  34926. if (o === l)
  34927. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34928. a += Math.pow(2, n),
  34929. o -= c
  34930. }
  34931. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34932. }
  34933. function r(e, t, i, n, r, o) {
  34934. 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;
  34935. for (t = Math.abs(t),
  34936. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34937. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34938. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34939. l *= 2),
  34940. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  34941. l /= 2),
  34942. h <= a + u ? (s = 0,
  34943. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  34944. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34945. a = 0)); 8 <= r; e[i + p] = 255 & s,
  34946. p += f,
  34947. s /= 256,
  34948. r -= 8)
  34949. ;
  34950. for (a = a << r | s,
  34951. c += r; 0 < c; e[i + p] = 255 & a,
  34952. p += f,
  34953. a /= 256,
  34954. c -= 8)
  34955. ;
  34956. e[i + p - f] |= 128 * g
  34957. }
  34958. var f = function(e, t, i) {
  34959. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  34960. void 0 === t && (t = f.DEFAULT_ENDIAN),
  34961. void 0 === i && (i = f.DEFAULT_NOASSERT),
  34962. !i) {
  34963. if ((e |= 0) < 0)
  34964. throw RangeError("Illegal capacity");
  34965. t = !!t,
  34966. i = !!i
  34967. }
  34968. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  34969. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34970. this.offset = 0,
  34971. this.markedOffset = -1,
  34972. this.limit = e,
  34973. this.littleEndian = t,
  34974. this.noAssert = i
  34975. };
  34976. f.VERSION = "5.0.1",
  34977. f.LITTLE_ENDIAN = !0,
  34978. f.BIG_ENDIAN = !1,
  34979. f.DEFAULT_CAPACITY = 16,
  34980. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  34981. f.DEFAULT_NOASSERT = !1,
  34982. f.Long = l || null;
  34983. var a = f.prototype;
  34984. a.__isByteBuffer__,
  34985. Object.defineProperty(a, "__isByteBuffer__", {
  34986. value: !0,
  34987. enumerable: !1,
  34988. configurable: !1
  34989. });
  34990. var o = new ArrayBuffer(0)
  34991. , i = String.fromCharCode;
  34992. f.accessor = function() {
  34993. return Uint8Array
  34994. }
  34995. ,
  34996. f.allocate = function(e, t, i) {
  34997. return new f(e,t,i)
  34998. }
  34999. ,
  35000. f.concat = function(e, t, i, n) {
  35001. "boolean" != typeof t && "string" == typeof t || (n = i,
  35002. i = t,
  35003. t = void 0);
  35004. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  35005. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  35006. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  35007. if (0 === o)
  35008. return new f(0,i,n);
  35009. var l, c = new f(o,i,n);
  35010. for (a = 0; a < s; )
  35011. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  35012. c.offset += r);
  35013. return c.limit = c.offset,
  35014. c.offset = 0,
  35015. c
  35016. }
  35017. ,
  35018. f.isByteBuffer = function(e) {
  35019. return !0 === (e && e.__isByteBuffer__)
  35020. }
  35021. ,
  35022. f.type = function() {
  35023. return ArrayBuffer
  35024. }
  35025. ,
  35026. f.wrap = function(e, t, i, n) {
  35027. if ("string" != typeof t && (n = i,
  35028. i = t,
  35029. t = void 0),
  35030. "string" == typeof e)
  35031. switch (void 0 === t && (t = "utf8"),
  35032. t) {
  35033. case "base64":
  35034. return f.fromBase64(e, i);
  35035. case "hex":
  35036. return f.fromHex(e, i);
  35037. case "binary":
  35038. return f.fromBinary(e, i);
  35039. case "utf8":
  35040. return f.fromUTF8(e, i);
  35041. case "debug":
  35042. return f.fromDebug(e, i);
  35043. default:
  35044. throw Error("Unsupported encoding: " + t)
  35045. }
  35046. if (null === e || "object" != typeof e)
  35047. throw TypeError("Illegal buffer");
  35048. var r;
  35049. if (f.isByteBuffer(e))
  35050. return (r = a.clone.call(e)).markedOffset = -1,
  35051. r;
  35052. if (e instanceof Uint8Array)
  35053. r = new f(0,i,n),
  35054. 0 < e.length && (r.buffer = e.buffer,
  35055. r.offset = e.byteOffset,
  35056. r.limit = e.byteOffset + e.byteLength,
  35057. r.view = new Uint8Array(e.buffer));
  35058. else if (e instanceof ArrayBuffer)
  35059. r = new f(0,i,n),
  35060. 0 < e.byteLength && (r.buffer = e,
  35061. r.offset = 0,
  35062. r.limit = e.byteLength,
  35063. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  35064. else {
  35065. if ("[object Array]" !== Object.prototype.toString.call(e))
  35066. throw TypeError("Illegal buffer");
  35067. (r = new f(e.length,i,n)).limit = e.length;
  35068. for (var o = 0; o < e.length; ++o)
  35069. r.view[o] = e[o]
  35070. }
  35071. return r
  35072. }
  35073. ,
  35074. a.writeBitSet = function(e, t) {
  35075. var i = void 0 === t;
  35076. if (i && (t = this.offset),
  35077. !this.noAssert) {
  35078. if (!(e instanceof Array))
  35079. throw TypeError("Illegal BitSet: Not an array");
  35080. if ("number" != typeof t || t % 1 != 0)
  35081. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35082. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35083. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35084. }
  35085. var n, r = t, o = e.length, a = o >> 3, s = 0;
  35086. for (t += this.writeVarint32(o, t); a--; )
  35087. 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,
  35088. this.writeByte(n, t++);
  35089. if (s < o) {
  35090. var l = 0;
  35091. for (n = 0; s < o; )
  35092. n |= (1 & !!e[s++]) << l++;
  35093. this.writeByte(n, t++)
  35094. }
  35095. return i ? (this.offset = t,
  35096. this) : t - r
  35097. }
  35098. ,
  35099. a.readBitSet = function(e) {
  35100. var t = void 0 === e;
  35101. t && (e = this.offset);
  35102. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  35103. for (e += n.length; o--; )
  35104. i = this.readByte(e++),
  35105. s[a++] = !!(1 & i),
  35106. s[a++] = !!(2 & i),
  35107. s[a++] = !!(4 & i),
  35108. s[a++] = !!(8 & i),
  35109. s[a++] = !!(16 & i),
  35110. s[a++] = !!(32 & i),
  35111. s[a++] = !!(64 & i),
  35112. s[a++] = !!(128 & i);
  35113. if (a < r) {
  35114. var l = 0;
  35115. for (i = this.readByte(e++); a < r; )
  35116. s[a++] = !!(i >> l++ & 1)
  35117. }
  35118. return t && (this.offset = e),
  35119. s
  35120. }
  35121. ,
  35122. a.readBytes = function(e, t) {
  35123. var i = void 0 === t;
  35124. if (i && (t = this.offset),
  35125. !this.noAssert) {
  35126. if ("number" != typeof t || t % 1 != 0)
  35127. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35128. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  35129. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  35130. }
  35131. var n = this.slice(t, t + e);
  35132. return i && (this.offset += e),
  35133. n
  35134. }
  35135. ,
  35136. a.writeBytes = a.append,
  35137. a.writeInt8 = function(e, t) {
  35138. var i = void 0 === t;
  35139. if (i && (t = this.offset),
  35140. !this.noAssert) {
  35141. if ("number" != typeof e || e % 1 != 0)
  35142. throw TypeError("Illegal value: " + e + " (not an integer)");
  35143. if (e |= 0,
  35144. "number" != typeof t || t % 1 != 0)
  35145. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35146. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35147. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35148. }
  35149. t += 1;
  35150. var n = this.buffer.byteLength;
  35151. return n < t && this.resize((n *= 2) > t ? n : t),
  35152. t -= 1,
  35153. this.view[t] = e,
  35154. i && (this.offset += 1),
  35155. this
  35156. }
  35157. ,
  35158. a.writeByte = a.writeInt8,
  35159. a.readInt8 = function(e) {
  35160. var t = void 0 === e;
  35161. if (t && (e = this.offset),
  35162. !this.noAssert) {
  35163. if ("number" != typeof e || e % 1 != 0)
  35164. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35165. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35166. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35167. }
  35168. var i = this.view[e];
  35169. return 128 == (128 & i) && (i = -(255 - i + 1)),
  35170. t && (this.offset += 1),
  35171. i
  35172. }
  35173. ,
  35174. a.readByte = a.readInt8,
  35175. a.writeUint8 = function(e, t) {
  35176. var i = void 0 === t;
  35177. if (i && (t = this.offset),
  35178. !this.noAssert) {
  35179. if ("number" != typeof e || e % 1 != 0)
  35180. throw TypeError("Illegal value: " + e + " (not an integer)");
  35181. if (e >>>= 0,
  35182. "number" != typeof t || t % 1 != 0)
  35183. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35184. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35185. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35186. }
  35187. t += 1;
  35188. var n = this.buffer.byteLength;
  35189. return n < t && this.resize((n *= 2) > t ? n : t),
  35190. t -= 1,
  35191. this.view[t] = e,
  35192. i && (this.offset += 1),
  35193. this
  35194. }
  35195. ,
  35196. a.writeUInt8 = a.writeUint8,
  35197. a.readUint8 = function(e) {
  35198. var t = void 0 === e;
  35199. if (t && (e = this.offset),
  35200. !this.noAssert) {
  35201. if ("number" != typeof e || e % 1 != 0)
  35202. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35203. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35204. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35205. }
  35206. var i = this.view[e];
  35207. return t && (this.offset += 1),
  35208. i
  35209. }
  35210. ,
  35211. a.readUInt8 = a.readUint8,
  35212. a.writeInt16 = function(e, t) {
  35213. var i = void 0 === t;
  35214. if (i && (t = this.offset),
  35215. !this.noAssert) {
  35216. if ("number" != typeof e || e % 1 != 0)
  35217. throw TypeError("Illegal value: " + e + " (not an integer)");
  35218. if (e |= 0,
  35219. "number" != typeof t || t % 1 != 0)
  35220. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35221. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35222. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35223. }
  35224. t += 2;
  35225. var n = this.buffer.byteLength;
  35226. return n < t && this.resize((n *= 2) > t ? n : t),
  35227. t -= 2,
  35228. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  35229. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  35230. this.view[t + 1] = 255 & e),
  35231. i && (this.offset += 2),
  35232. this
  35233. }
  35234. ,
  35235. a.writeShort = a.writeInt16,
  35236. a.readInt16 = function(e) {
  35237. var t = void 0 === e;
  35238. if (t && (e = this.offset),
  35239. !this.noAssert) {
  35240. if ("number" != typeof e || e % 1 != 0)
  35241. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35242. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  35243. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  35244. }
  35245. var i = 0;
  35246. return this.littleEndian ? (i = this.view[e],
  35247. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  35248. i |= this.view[e + 1]),
  35249. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  35250. t && (this.offset += 2),
  35251. i
  35252. }
  35253. ,
  35254. a.readShort = a.readInt16,
  35255. a.writeUint16 = function(e, t) {
  35256. var i = void 0 === t;
  35257. if (i && (t = this.offset),
  35258. !this.noAssert) {
  35259. if ("number" != typeof e || e % 1 != 0)
  35260. throw TypeError("Illegal value: " + e + " (not an integer)");
  35261. if (e >>>= 0,
  35262. "number" != typeof t || t % 1 != 0)
  35263. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35264. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35265. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35266. }
  35267. t += 2;
  35268. var n = this.buffer.byteLength;
  35269. return n < t && this.resize((n *= 2) > t ? n : t),
  35270. t -= 2,
  35271. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  35272. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  35273. this.view[t + 1] = 255 & e),
  35274. i && (this.offset += 2),
  35275. this
  35276. }
  35277. ,
  35278. a.writeUInt16 = a.writeUint16,
  35279. a.readUint16 = function(e) {
  35280. var t = void 0 === e;
  35281. if (t && (e = this.offset),
  35282. !this.noAssert) {
  35283. if ("number" != typeof e || e % 1 != 0)
  35284. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35285. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  35286. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  35287. }
  35288. var i = 0;
  35289. return this.littleEndian ? (i = this.view[e],
  35290. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  35291. i |= this.view[e + 1]),
  35292. t && (this.offset += 2),
  35293. i
  35294. }
  35295. ,
  35296. a.readUInt16 = a.readUint16,
  35297. a.writeInt32 = function(e, t) {
  35298. var i = void 0 === t;
  35299. if (i && (t = this.offset),
  35300. !this.noAssert) {
  35301. if ("number" != typeof e || e % 1 != 0)
  35302. throw TypeError("Illegal value: " + e + " (not an integer)");
  35303. if (e |= 0,
  35304. "number" != typeof t || t % 1 != 0)
  35305. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35306. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35307. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35308. }
  35309. t += 4;
  35310. var n = this.buffer.byteLength;
  35311. return n < t && this.resize((n *= 2) > t ? n : t),
  35312. t -= 4,
  35313. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35314. this.view[t + 2] = e >>> 16 & 255,
  35315. this.view[t + 1] = e >>> 8 & 255,
  35316. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35317. this.view[t + 1] = e >>> 16 & 255,
  35318. this.view[t + 2] = e >>> 8 & 255,
  35319. this.view[t + 3] = 255 & e),
  35320. i && (this.offset += 4),
  35321. this
  35322. }
  35323. ,
  35324. a.writeInt = a.writeInt32,
  35325. a.readInt32 = function(e) {
  35326. var t = void 0 === e;
  35327. if (t && (e = this.offset),
  35328. !this.noAssert) {
  35329. if ("number" != typeof e || e % 1 != 0)
  35330. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35331. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35332. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35333. }
  35334. var i = 0;
  35335. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35336. i |= this.view[e + 1] << 8,
  35337. i |= this.view[e],
  35338. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35339. i |= this.view[e + 2] << 8,
  35340. i |= this.view[e + 3],
  35341. i += this.view[e] << 24 >>> 0),
  35342. i |= 0,
  35343. t && (this.offset += 4),
  35344. i
  35345. }
  35346. ,
  35347. a.readInt = a.readInt32,
  35348. a.writeUint32 = function(e, t) {
  35349. var i = void 0 === t;
  35350. if (i && (t = this.offset),
  35351. !this.noAssert) {
  35352. if ("number" != typeof e || e % 1 != 0)
  35353. throw TypeError("Illegal value: " + e + " (not an integer)");
  35354. if (e >>>= 0,
  35355. "number" != typeof t || t % 1 != 0)
  35356. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35357. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35358. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35359. }
  35360. t += 4;
  35361. var n = this.buffer.byteLength;
  35362. return n < t && this.resize((n *= 2) > t ? n : t),
  35363. t -= 4,
  35364. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35365. this.view[t + 2] = e >>> 16 & 255,
  35366. this.view[t + 1] = e >>> 8 & 255,
  35367. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35368. this.view[t + 1] = e >>> 16 & 255,
  35369. this.view[t + 2] = e >>> 8 & 255,
  35370. this.view[t + 3] = 255 & e),
  35371. i && (this.offset += 4),
  35372. this
  35373. }
  35374. ,
  35375. a.writeUInt32 = a.writeUint32,
  35376. a.readUint32 = function(e) {
  35377. var t = void 0 === e;
  35378. if (t && (e = this.offset),
  35379. !this.noAssert) {
  35380. if ("number" != typeof e || e % 1 != 0)
  35381. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35382. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35383. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35384. }
  35385. var i = 0;
  35386. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35387. i |= this.view[e + 1] << 8,
  35388. i |= this.view[e],
  35389. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35390. i |= this.view[e + 2] << 8,
  35391. i |= this.view[e + 3],
  35392. i += this.view[e] << 24 >>> 0),
  35393. t && (this.offset += 4),
  35394. i
  35395. }
  35396. ,
  35397. a.readUInt32 = a.readUint32,
  35398. l && (a.writeInt64 = function(e, t) {
  35399. var i = void 0 === t;
  35400. if (i && (t = this.offset),
  35401. !this.noAssert) {
  35402. if ("number" == typeof e)
  35403. e = l.fromNumber(e);
  35404. else if ("string" == typeof e)
  35405. e = l.fromString(e);
  35406. else if (!(e && e instanceof l))
  35407. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35408. if ("number" != typeof t || t % 1 != 0)
  35409. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35410. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35411. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35412. }
  35413. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35414. t += 8;
  35415. var n = this.buffer.byteLength;
  35416. n < t && this.resize((n *= 2) > t ? n : t),
  35417. t -= 8;
  35418. var r = e.low
  35419. , o = e.high;
  35420. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35421. this.view[t + 2] = r >>> 16 & 255,
  35422. this.view[t + 1] = r >>> 8 & 255,
  35423. this.view[t] = 255 & r,
  35424. t += 4,
  35425. this.view[t + 3] = o >>> 24 & 255,
  35426. this.view[t + 2] = o >>> 16 & 255,
  35427. this.view[t + 1] = o >>> 8 & 255,
  35428. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35429. this.view[t + 1] = o >>> 16 & 255,
  35430. this.view[t + 2] = o >>> 8 & 255,
  35431. this.view[t + 3] = 255 & o,
  35432. t += 4,
  35433. this.view[t] = r >>> 24 & 255,
  35434. this.view[t + 1] = r >>> 16 & 255,
  35435. this.view[t + 2] = r >>> 8 & 255,
  35436. this.view[t + 3] = 255 & r),
  35437. i && (this.offset += 8),
  35438. this
  35439. }
  35440. ,
  35441. a.writeLong = a.writeInt64,
  35442. a.readInt64 = function(e) {
  35443. var t = void 0 === e;
  35444. if (t && (e = this.offset),
  35445. !this.noAssert) {
  35446. if ("number" != typeof e || e % 1 != 0)
  35447. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35448. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35449. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35450. }
  35451. var i = 0
  35452. , n = 0;
  35453. this.littleEndian ? (i = this.view[e + 2] << 16,
  35454. i |= this.view[e + 1] << 8,
  35455. i |= this.view[e],
  35456. i += this.view[e + 3] << 24 >>> 0,
  35457. e += 4,
  35458. n = this.view[e + 2] << 16,
  35459. n |= this.view[e + 1] << 8,
  35460. n |= this.view[e],
  35461. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35462. n |= this.view[e + 2] << 8,
  35463. n |= this.view[e + 3],
  35464. n += this.view[e] << 24 >>> 0,
  35465. e += 4,
  35466. i = this.view[e + 1] << 16,
  35467. i |= this.view[e + 2] << 8,
  35468. i |= this.view[e + 3],
  35469. i += this.view[e] << 24 >>> 0);
  35470. var r = new l(i,n,!1);
  35471. return t && (this.offset += 8),
  35472. r
  35473. }
  35474. ,
  35475. a.readLong = a.readInt64,
  35476. a.writeUint64 = function(e, t) {
  35477. var i = void 0 === t;
  35478. if (i && (t = this.offset),
  35479. !this.noAssert) {
  35480. if ("number" == typeof e)
  35481. e = l.fromNumber(e);
  35482. else if ("string" == typeof e)
  35483. e = l.fromString(e);
  35484. else if (!(e && e instanceof l))
  35485. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35486. if ("number" != typeof t || t % 1 != 0)
  35487. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35488. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35489. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35490. }
  35491. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35492. t += 8;
  35493. var n = this.buffer.byteLength;
  35494. n < t && this.resize((n *= 2) > t ? n : t),
  35495. t -= 8;
  35496. var r = e.low
  35497. , o = e.high;
  35498. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35499. this.view[t + 2] = r >>> 16 & 255,
  35500. this.view[t + 1] = r >>> 8 & 255,
  35501. this.view[t] = 255 & r,
  35502. t += 4,
  35503. this.view[t + 3] = o >>> 24 & 255,
  35504. this.view[t + 2] = o >>> 16 & 255,
  35505. this.view[t + 1] = o >>> 8 & 255,
  35506. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35507. this.view[t + 1] = o >>> 16 & 255,
  35508. this.view[t + 2] = o >>> 8 & 255,
  35509. this.view[t + 3] = 255 & o,
  35510. t += 4,
  35511. this.view[t] = r >>> 24 & 255,
  35512. this.view[t + 1] = r >>> 16 & 255,
  35513. this.view[t + 2] = r >>> 8 & 255,
  35514. this.view[t + 3] = 255 & r),
  35515. i && (this.offset += 8),
  35516. this
  35517. }
  35518. ,
  35519. a.writeUInt64 = a.writeUint64,
  35520. a.readUint64 = function(e) {
  35521. var t = void 0 === e;
  35522. if (t && (e = this.offset),
  35523. !this.noAssert) {
  35524. if ("number" != typeof e || e % 1 != 0)
  35525. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35526. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35527. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35528. }
  35529. var i = 0
  35530. , n = 0;
  35531. this.littleEndian ? (i = this.view[e + 2] << 16,
  35532. i |= this.view[e + 1] << 8,
  35533. i |= this.view[e],
  35534. i += this.view[e + 3] << 24 >>> 0,
  35535. e += 4,
  35536. n = this.view[e + 2] << 16,
  35537. n |= this.view[e + 1] << 8,
  35538. n |= this.view[e],
  35539. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35540. n |= this.view[e + 2] << 8,
  35541. n |= this.view[e + 3],
  35542. n += this.view[e] << 24 >>> 0,
  35543. e += 4,
  35544. i = this.view[e + 1] << 16,
  35545. i |= this.view[e + 2] << 8,
  35546. i |= this.view[e + 3],
  35547. i += this.view[e] << 24 >>> 0);
  35548. var r = new l(i,n,!0);
  35549. return t && (this.offset += 8),
  35550. r
  35551. }
  35552. ,
  35553. a.readUInt64 = a.readUint64),
  35554. a.writeFloat32 = function(e, t) {
  35555. var i = void 0 === t;
  35556. if (i && (t = this.offset),
  35557. !this.noAssert) {
  35558. if ("number" != typeof e)
  35559. throw TypeError("Illegal value: " + e + " (not a number)");
  35560. if ("number" != typeof t || t % 1 != 0)
  35561. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35562. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35563. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35564. }
  35565. t += 4;
  35566. var n = this.buffer.byteLength;
  35567. return n < t && this.resize((n *= 2) > t ? n : t),
  35568. t -= 4,
  35569. r(this.view, e, t, this.littleEndian, 23, 4),
  35570. i && (this.offset += 4),
  35571. this
  35572. }
  35573. ,
  35574. a.writeFloat = a.writeFloat32,
  35575. a.readFloat32 = function(e) {
  35576. var t = void 0 === e;
  35577. if (t && (e = this.offset),
  35578. !this.noAssert) {
  35579. if ("number" != typeof e || e % 1 != 0)
  35580. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35581. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35582. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35583. }
  35584. var i = n(this.view, e, this.littleEndian, 23, 4);
  35585. return t && (this.offset += 4),
  35586. i
  35587. }
  35588. ,
  35589. a.readFloat = a.readFloat32,
  35590. a.writeFloat64 = function(e, t) {
  35591. var i = void 0 === t;
  35592. if (i && (t = this.offset),
  35593. !this.noAssert) {
  35594. if ("number" != typeof e)
  35595. throw TypeError("Illegal value: " + e + " (not a number)");
  35596. if ("number" != typeof t || t % 1 != 0)
  35597. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35598. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35599. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35600. }
  35601. t += 8;
  35602. var n = this.buffer.byteLength;
  35603. return n < t && this.resize((n *= 2) > t ? n : t),
  35604. t -= 8,
  35605. r(this.view, e, t, this.littleEndian, 52, 8),
  35606. i && (this.offset += 8),
  35607. this
  35608. }
  35609. ,
  35610. a.writeDouble = a.writeFloat64,
  35611. a.readFloat64 = function(e) {
  35612. var t = void 0 === e;
  35613. if (t && (e = this.offset),
  35614. !this.noAssert) {
  35615. if ("number" != typeof e || e % 1 != 0)
  35616. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35617. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35618. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35619. }
  35620. var i = n(this.view, e, this.littleEndian, 52, 8);
  35621. return t && (this.offset += 8),
  35622. i
  35623. }
  35624. ,
  35625. a.readDouble = a.readFloat64,
  35626. f.MAX_VARINT32_BYTES = 5,
  35627. f.calculateVarint32 = function(e) {
  35628. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35629. }
  35630. ,
  35631. f.zigZagEncode32 = function(e) {
  35632. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35633. }
  35634. ,
  35635. f.zigZagDecode32 = function(e) {
  35636. return e >>> 1 ^ -(1 & e) | 0
  35637. }
  35638. ,
  35639. a.writeVarint32 = function(e, t) {
  35640. var i = void 0 === t;
  35641. if (i && (t = this.offset),
  35642. !this.noAssert) {
  35643. if ("number" != typeof e || e % 1 != 0)
  35644. throw TypeError("Illegal value: " + e + " (not an integer)");
  35645. if (e |= 0,
  35646. "number" != typeof t || t % 1 != 0)
  35647. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35648. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35649. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35650. }
  35651. var n, r = f.calculateVarint32(e);
  35652. t += r;
  35653. var o = this.buffer.byteLength;
  35654. for (o < t && this.resize((o *= 2) > t ? o : t),
  35655. t -= r,
  35656. e >>>= 0; 128 <= e; )
  35657. n = 127 & e | 128,
  35658. this.view[t++] = n,
  35659. e >>>= 7;
  35660. return this.view[t++] = e,
  35661. i ? (this.offset = t,
  35662. this) : r
  35663. }
  35664. ,
  35665. a.writeVarint32ZigZag = function(e, t) {
  35666. return this.writeVarint32(f.zigZagEncode32(e), t)
  35667. }
  35668. ,
  35669. a.readVarint32 = function(e) {
  35670. var t = void 0 === e;
  35671. if (t && (e = this.offset),
  35672. !this.noAssert) {
  35673. if ("number" != typeof e || e % 1 != 0)
  35674. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35675. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35676. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35677. }
  35678. var i, n = 0, r = 0;
  35679. do {
  35680. if (!this.noAssert && e > this.limit) {
  35681. var o = Error("Truncated");
  35682. throw o.truncated = !0,
  35683. o
  35684. }
  35685. i = this.view[e++],
  35686. n < 5 && (r |= (127 & i) << 7 * n),
  35687. ++n
  35688. } while (0 != (128 & i));return r |= 0,
  35689. t ? (this.offset = e,
  35690. r) : {
  35691. value: r,
  35692. length: n
  35693. }
  35694. }
  35695. ,
  35696. a.readVarint32ZigZag = function(e) {
  35697. var t = this.readVarint32(e);
  35698. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  35699. t
  35700. }
  35701. ,
  35702. l && (f.MAX_VARINT64_BYTES = 10,
  35703. f.calculateVarint64 = function(e) {
  35704. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  35705. var t = e.toInt() >>> 0
  35706. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  35707. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  35708. return 0 == n ? 0 == i ? t < 16384 ? t < 128 ? 1 : 2 : t < 1 << 21 ? 3 : 4 : i < 16384 ? i < 128 ? 5 : 6 : i < 1 << 21 ? 7 : 8 : n < 128 ? 9 : 10
  35709. }
  35710. ,
  35711. f.zigZagEncode64 = function(e) {
  35712. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35713. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  35714. }
  35715. ,
  35716. f.zigZagDecode64 = function(e) {
  35717. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35718. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  35719. }
  35720. ,
  35721. a.writeVarint64 = function(e, t) {
  35722. var i = void 0 === t;
  35723. if (i && (t = this.offset),
  35724. !this.noAssert) {
  35725. if ("number" == typeof e)
  35726. e = l.fromNumber(e);
  35727. else if ("string" == typeof e)
  35728. e = l.fromString(e);
  35729. else if (!(e && e instanceof l))
  35730. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35731. if ("number" != typeof t || t % 1 != 0)
  35732. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35733. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35734. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35735. }
  35736. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  35737. var n = f.calculateVarint64(e)
  35738. , r = e.toInt() >>> 0
  35739. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  35740. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  35741. t += n;
  35742. var s = this.buffer.byteLength;
  35743. switch (s < t && this.resize((s *= 2) > t ? s : t),
  35744. t -= n,
  35745. n) {
  35746. case 10:
  35747. this.view[t + 9] = a >>> 7 & 1;
  35748. case 9:
  35749. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  35750. case 8:
  35751. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  35752. case 7:
  35753. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  35754. case 6:
  35755. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  35756. case 5:
  35757. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  35758. case 4:
  35759. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  35760. case 3:
  35761. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  35762. case 2:
  35763. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  35764. case 1:
  35765. this.view[t] = 1 !== n ? 128 | r : 127 & r
  35766. }
  35767. return i ? (this.offset += n,
  35768. this) : n
  35769. }
  35770. ,
  35771. a.writeVarint64ZigZag = function(e, t) {
  35772. return this.writeVarint64(f.zigZagEncode64(e), t)
  35773. }
  35774. ,
  35775. a.readVarint64 = function(e) {
  35776. var t = void 0 === e;
  35777. if (t && (e = this.offset),
  35778. !this.noAssert) {
  35779. if ("number" != typeof e || e % 1 != 0)
  35780. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35781. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35782. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35783. }
  35784. var i = e
  35785. , n = 0
  35786. , r = 0
  35787. , o = 0
  35788. , a = 0;
  35789. if (n = 127 & (a = this.view[e++]),
  35790. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35791. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35792. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35793. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35794. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35795. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35796. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35797. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35798. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35799. 128 & a || this.noAssert && void 0 === a))))))))))
  35800. throw Error("Buffer overrun");
  35801. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35802. return t ? (this.offset = e,
  35803. s) : {
  35804. value: s,
  35805. length: e - i
  35806. }
  35807. }
  35808. ,
  35809. a.readVarint64ZigZag = function(e) {
  35810. var t = this.readVarint64(e);
  35811. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35812. t
  35813. }
  35814. ),
  35815. a.writeCString = function(e, t) {
  35816. var i = void 0 === t;
  35817. i && (t = this.offset);
  35818. var n, r = e.length;
  35819. if (!this.noAssert) {
  35820. if ("string" != typeof e)
  35821. throw TypeError("Illegal str: Not a string");
  35822. for (n = 0; n < r; ++n)
  35823. if (0 === e.charCodeAt(n))
  35824. throw RangeError("Illegal str: Contains NULL-characters");
  35825. if ("number" != typeof t || t % 1 != 0)
  35826. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35827. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35828. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35829. }
  35830. r = d.calculateUTF16asUTF8(s(e))[1],
  35831. t += r + 1;
  35832. var o = this.buffer.byteLength;
  35833. return o < t && this.resize((o *= 2) > t ? o : t),
  35834. t -= r + 1,
  35835. d.encodeUTF16toUTF8(s(e), function(e) {
  35836. this.view[t++] = e
  35837. }
  35838. .bind(this)),
  35839. this.view[t++] = 0,
  35840. i ? (this.offset = t,
  35841. this) : r
  35842. }
  35843. ,
  35844. a.readCString = function(e) {
  35845. var t = void 0 === e;
  35846. if (t && (e = this.offset),
  35847. !this.noAssert) {
  35848. if ("number" != typeof e || e % 1 != 0)
  35849. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35850. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35851. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35852. }
  35853. var i, n = e, r = -1;
  35854. return d.decodeUTF8toUTF16(function() {
  35855. if (0 === r)
  35856. return null;
  35857. if (e >= this.limit)
  35858. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35859. return 0 === (r = this.view[e++]) ? null : r
  35860. }
  35861. .bind(this), i = c(), !0),
  35862. t ? (this.offset = e,
  35863. i()) : {
  35864. string: i(),
  35865. length: e - n
  35866. }
  35867. }
  35868. ,
  35869. a.writeIString = function(e, t) {
  35870. var i = void 0 === t;
  35871. if (i && (t = this.offset),
  35872. !this.noAssert) {
  35873. if ("string" != typeof e)
  35874. throw TypeError("Illegal str: Not a string");
  35875. if ("number" != typeof t || t % 1 != 0)
  35876. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35877. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35878. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35879. }
  35880. var n, r = t;
  35881. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35882. t += 4 + n;
  35883. var o = this.buffer.byteLength;
  35884. if (o < t && this.resize((o *= 2) > t ? o : t),
  35885. t -= 4 + n,
  35886. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35887. this.view[t + 2] = n >>> 16 & 255,
  35888. this.view[t + 1] = n >>> 8 & 255,
  35889. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35890. this.view[t + 1] = n >>> 16 & 255,
  35891. this.view[t + 2] = n >>> 8 & 255,
  35892. this.view[t + 3] = 255 & n),
  35893. t += 4,
  35894. d.encodeUTF16toUTF8(s(e), function(e) {
  35895. this.view[t++] = e
  35896. }
  35897. .bind(this)),
  35898. t !== r + 4 + n)
  35899. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35900. return i ? (this.offset = t,
  35901. this) : t - r
  35902. }
  35903. ,
  35904. a.readIString = function(e) {
  35905. var t = void 0 === e;
  35906. if (t && (e = this.offset),
  35907. !this.noAssert) {
  35908. if ("number" != typeof e || e % 1 != 0)
  35909. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35910. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35911. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35912. }
  35913. var i = e
  35914. , n = this.readUint32(e)
  35915. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35916. return e += r.length,
  35917. t ? (this.offset = e,
  35918. r.string) : {
  35919. string: r.string,
  35920. length: e - i
  35921. }
  35922. }
  35923. ,
  35924. f.METRICS_CHARS = "c",
  35925. f.METRICS_BYTES = "b",
  35926. a.writeUTF8String = function(e, t) {
  35927. var i = void 0 === t;
  35928. if (i && (t = this.offset),
  35929. !this.noAssert) {
  35930. if ("number" != typeof t || t % 1 != 0)
  35931. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35932. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35933. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35934. }
  35935. var n, r = t;
  35936. n = d.calculateUTF16asUTF8(s(e))[1],
  35937. t += n;
  35938. var o = this.buffer.byteLength;
  35939. return o < t && this.resize((o *= 2) > t ? o : t),
  35940. t -= n,
  35941. d.encodeUTF16toUTF8(s(e), function(e) {
  35942. this.view[t++] = e
  35943. }
  35944. .bind(this)),
  35945. i ? (this.offset = t,
  35946. this) : t - r
  35947. }
  35948. ,
  35949. a.writeString = a.writeUTF8String,
  35950. f.calculateUTF8Chars = function(e) {
  35951. return d.calculateUTF16asUTF8(s(e))[0]
  35952. }
  35953. ,
  35954. f.calculateUTF8Bytes = function(e) {
  35955. return d.calculateUTF16asUTF8(s(e))[1]
  35956. }
  35957. ,
  35958. f.calculateString = f.calculateUTF8Bytes,
  35959. a.readUTF8String = function(e, t, i) {
  35960. "number" == typeof t && (i = t,
  35961. t = void 0);
  35962. var n = void 0 === i;
  35963. if (n && (i = this.offset),
  35964. void 0 === t && (t = f.METRICS_CHARS),
  35965. !this.noAssert) {
  35966. if ("number" != typeof e || e % 1 != 0)
  35967. throw TypeError("Illegal length: " + e + " (not an integer)");
  35968. if (e |= 0,
  35969. "number" != typeof i || i % 1 != 0)
  35970. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35971. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35972. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35973. }
  35974. var r, o = 0, a = i;
  35975. if (t === f.METRICS_CHARS) {
  35976. if (r = c(),
  35977. d.decodeUTF8(function() {
  35978. return o < e && i < this.limit ? this.view[i++] : null
  35979. }
  35980. .bind(this), function(e) {
  35981. ++o,
  35982. d.UTF8toUTF16(e, r)
  35983. }),
  35984. o !== e)
  35985. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  35986. return n ? (this.offset = i,
  35987. r()) : {
  35988. string: r(),
  35989. length: i - a
  35990. }
  35991. }
  35992. if (t !== f.METRICS_BYTES)
  35993. throw TypeError("Unsupported metrics: " + t);
  35994. if (!this.noAssert) {
  35995. if ("number" != typeof i || i % 1 != 0)
  35996. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35997. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  35998. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  35999. }
  36000. var s = i + e;
  36001. if (d.decodeUTF8toUTF16(function() {
  36002. return i < s ? this.view[i++] : null
  36003. }
  36004. .bind(this), r = c(), this.noAssert),
  36005. i !== s)
  36006. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  36007. return n ? (this.offset = i,
  36008. r()) : {
  36009. string: r(),
  36010. length: i - a
  36011. }
  36012. }
  36013. ,
  36014. a.readString = a.readUTF8String,
  36015. a.writeVString = function(e, t) {
  36016. var i = void 0 === t;
  36017. if (i && (t = this.offset),
  36018. !this.noAssert) {
  36019. if ("string" != typeof e)
  36020. throw TypeError("Illegal str: Not a string");
  36021. if ("number" != typeof t || t % 1 != 0)
  36022. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36023. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  36024. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36025. }
  36026. var n, r, o = t;
  36027. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  36028. r = f.calculateVarint32(n),
  36029. t += r + n;
  36030. var a = this.buffer.byteLength;
  36031. if (a < t && this.resize((a *= 2) > t ? a : t),
  36032. t -= r + n,
  36033. t += this.writeVarint32(n, t),
  36034. d.encodeUTF16toUTF8(s(e), function(e) {
  36035. this.view[t++] = e
  36036. }
  36037. .bind(this)),
  36038. t !== o + n + r)
  36039. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  36040. return i ? (this.offset = t,
  36041. this) : t - o
  36042. }
  36043. ,
  36044. a.readVString = function(e) {
  36045. var t = void 0 === e;
  36046. if (t && (e = this.offset),
  36047. !this.noAssert) {
  36048. if ("number" != typeof e || e % 1 != 0)
  36049. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36050. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  36051. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36052. }
  36053. var i = e
  36054. , n = this.readVarint32(e)
  36055. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  36056. return e += r.length,
  36057. t ? (this.offset = e,
  36058. r.string) : {
  36059. string: r.string,
  36060. length: e - i
  36061. }
  36062. }
  36063. ,
  36064. a.append = function(e, t, i) {
  36065. "number" != typeof t && "string" == typeof t || (i = t,
  36066. t = void 0);
  36067. var n = void 0 === i;
  36068. if (n && (i = this.offset),
  36069. !this.noAssert) {
  36070. if ("number" != typeof i || i % 1 != 0)
  36071. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36072. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  36073. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36074. }
  36075. e instanceof f || (e = f.wrap(e, t));
  36076. var r = e.limit - e.offset;
  36077. if (r <= 0)
  36078. return this;
  36079. i += r;
  36080. var o = this.buffer.byteLength;
  36081. return o < i && this.resize((o *= 2) > i ? o : i),
  36082. i -= r,
  36083. this.view.set(e.view.subarray(e.offset, e.limit), i),
  36084. e.offset += r,
  36085. n && (this.offset += r),
  36086. this
  36087. }
  36088. ,
  36089. a.appendTo = function(e, t) {
  36090. return e.append(this, t),
  36091. this
  36092. }
  36093. ,
  36094. a.assert = function(e) {
  36095. return this.noAssert = !e,
  36096. this
  36097. }
  36098. ,
  36099. a.capacity = function() {
  36100. return this.buffer.byteLength
  36101. }
  36102. ,
  36103. a.clear = function() {
  36104. return this.offset = 0,
  36105. this.limit = this.buffer.byteLength,
  36106. this.markedOffset = -1,
  36107. this
  36108. }
  36109. ,
  36110. a.clone = function(e) {
  36111. var t = new f(0,this.littleEndian,this.noAssert);
  36112. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  36113. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  36114. t.view = this.view),
  36115. t.offset = this.offset,
  36116. t.markedOffset = this.markedOffset,
  36117. t.limit = this.limit,
  36118. t
  36119. }
  36120. ,
  36121. a.compact = function(e, t) {
  36122. if (void 0 === e && (e = this.offset),
  36123. void 0 === t && (t = this.limit),
  36124. !this.noAssert) {
  36125. if ("number" != typeof e || e % 1 != 0)
  36126. throw TypeError("Illegal begin: Not an integer");
  36127. if (e >>>= 0,
  36128. "number" != typeof t || t % 1 != 0)
  36129. throw TypeError("Illegal end: Not an integer");
  36130. if (t >>>= 0,
  36131. e < 0 || t < e || t > this.buffer.byteLength)
  36132. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36133. }
  36134. if (0 === e && t === this.buffer.byteLength)
  36135. return this;
  36136. var i = t - e;
  36137. if (0 == i)
  36138. return this.buffer = o,
  36139. this.view = null,
  36140. 0 <= this.markedOffset && (this.markedOffset -= e),
  36141. this.offset = 0,
  36142. this.limit = 0,
  36143. this;
  36144. var n = new ArrayBuffer(i)
  36145. , r = new Uint8Array(n);
  36146. return r.set(this.view.subarray(e, t)),
  36147. this.buffer = n,
  36148. this.view = r,
  36149. 0 <= this.markedOffset && (this.markedOffset -= e),
  36150. this.offset = 0,
  36151. this.limit = i,
  36152. this
  36153. }
  36154. ,
  36155. a.copy = function(e, t) {
  36156. if (void 0 === e && (e = this.offset),
  36157. void 0 === t && (t = this.limit),
  36158. !this.noAssert) {
  36159. if ("number" != typeof e || e % 1 != 0)
  36160. throw TypeError("Illegal begin: Not an integer");
  36161. if (e >>>= 0,
  36162. "number" != typeof t || t % 1 != 0)
  36163. throw TypeError("Illegal end: Not an integer");
  36164. if (t >>>= 0,
  36165. e < 0 || t < e || t > this.buffer.byteLength)
  36166. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36167. }
  36168. if (e === t)
  36169. return new f(0,this.littleEndian,this.noAssert);
  36170. var i = t - e
  36171. , n = new f(i,this.littleEndian,this.noAssert);
  36172. return n.offset = 0,
  36173. n.limit = i,
  36174. 0 <= n.markedOffset && (n.markedOffset -= e),
  36175. this.copyTo(n, 0, e, t),
  36176. n
  36177. }
  36178. ,
  36179. a.copyTo = function(e, t, i, n) {
  36180. var r, o;
  36181. if (!this.noAssert && !f.isByteBuffer(e))
  36182. throw TypeError("Illegal target: Not a ByteBuffer");
  36183. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  36184. i = (r = void 0 === i) ? this.offset : 0 | i,
  36185. n = void 0 === n ? this.limit : 0 | n,
  36186. t < 0 || t > e.buffer.byteLength)
  36187. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  36188. if (i < 0 || n > this.buffer.byteLength)
  36189. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  36190. var a = n - i;
  36191. return 0 == a ? e : (e.ensureCapacity(t + a),
  36192. e.view.set(this.view.subarray(i, n), t),
  36193. r && (this.offset += a),
  36194. o && (e.offset += a),
  36195. this)
  36196. }
  36197. ,
  36198. a.ensureCapacity = function(e) {
  36199. var t = this.buffer.byteLength;
  36200. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  36201. }
  36202. ,
  36203. a.fill = function(e, t, i) {
  36204. var n = void 0 === t;
  36205. if (n && (t = this.offset),
  36206. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  36207. void 0 === t && (t = this.offset),
  36208. void 0 === i && (i = this.limit),
  36209. !this.noAssert) {
  36210. if ("number" != typeof e || e % 1 != 0)
  36211. throw TypeError("Illegal value: " + e + " (not an integer)");
  36212. if (e |= 0,
  36213. "number" != typeof t || t % 1 != 0)
  36214. throw TypeError("Illegal begin: Not an integer");
  36215. if (t >>>= 0,
  36216. "number" != typeof i || i % 1 != 0)
  36217. throw TypeError("Illegal end: Not an integer");
  36218. if (i >>>= 0,
  36219. t < 0 || i < t || i > this.buffer.byteLength)
  36220. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36221. }
  36222. if (i <= t)
  36223. return this;
  36224. for (; t < i; )
  36225. this.view[t++] = e;
  36226. return n && (this.offset = t),
  36227. this
  36228. }
  36229. ,
  36230. a.flip = function() {
  36231. return this.limit = this.offset,
  36232. this.offset = 0,
  36233. this
  36234. }
  36235. ,
  36236. a.mark = function(e) {
  36237. if (e = void 0 === e ? this.offset : e,
  36238. !this.noAssert) {
  36239. if ("number" != typeof e || e % 1 != 0)
  36240. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36241. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  36242. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  36243. }
  36244. return this.markedOffset = e,
  36245. this
  36246. }
  36247. ,
  36248. a.order = function(e) {
  36249. if (!this.noAssert && "boolean" != typeof e)
  36250. throw TypeError("Illegal littleEndian: Not a boolean");
  36251. return this.littleEndian = !!e,
  36252. this
  36253. }
  36254. ,
  36255. a.LE = function(e) {
  36256. return this.littleEndian = void 0 === e || !!e,
  36257. this
  36258. }
  36259. ,
  36260. a.BE = function(e) {
  36261. return this.littleEndian = void 0 !== e && !e,
  36262. this
  36263. }
  36264. ,
  36265. a.prepend = function(e, t, i) {
  36266. "number" != typeof t && "string" == typeof t || (i = t,
  36267. t = void 0);
  36268. var n = void 0 === i;
  36269. if (n && (i = this.offset),
  36270. !this.noAssert) {
  36271. if ("number" != typeof i || i % 1 != 0)
  36272. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36273. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  36274. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36275. }
  36276. e instanceof f || (e = f.wrap(e, t));
  36277. var r = e.limit - e.offset;
  36278. if (r <= 0)
  36279. return this;
  36280. var o = r - i;
  36281. if (0 < o) {
  36282. var a = new ArrayBuffer(this.buffer.byteLength + o)
  36283. , s = new Uint8Array(a);
  36284. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  36285. this.buffer = a,
  36286. this.view = s,
  36287. this.offset += o,
  36288. 0 <= this.markedOffset && (this.markedOffset += o),
  36289. this.limit += o,
  36290. i += o
  36291. } else
  36292. new Uint8Array(this.buffer);
  36293. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  36294. e.offset = e.limit,
  36295. n && (this.offset -= r),
  36296. this
  36297. }
  36298. ,
  36299. a.prependTo = function(e, t) {
  36300. return e.prepend(this, t),
  36301. this
  36302. }
  36303. ,
  36304. a.printDebug = function(e) {
  36305. "function" != typeof e && (e = console.log.bind(console)),
  36306. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  36307. }
  36308. ,
  36309. a.remaining = function() {
  36310. return this.limit - this.offset
  36311. }
  36312. ,
  36313. a.reset = function() {
  36314. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  36315. this.markedOffset = -1) : this.offset = 0,
  36316. this
  36317. }
  36318. ,
  36319. a.resize = function(e) {
  36320. if (!this.noAssert) {
  36321. if ("number" != typeof e || e % 1 != 0)
  36322. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  36323. if ((e |= 0) < 0)
  36324. throw RangeError("Illegal capacity: 0 <= " + e)
  36325. }
  36326. if (this.buffer.byteLength < e) {
  36327. var t = new ArrayBuffer(e)
  36328. , i = new Uint8Array(t);
  36329. i.set(this.view),
  36330. this.buffer = t,
  36331. this.view = i
  36332. }
  36333. return this
  36334. }
  36335. ,
  36336. a.reverse = function(e, t) {
  36337. if (void 0 === e && (e = this.offset),
  36338. void 0 === t && (t = this.limit),
  36339. !this.noAssert) {
  36340. if ("number" != typeof e || e % 1 != 0)
  36341. throw TypeError("Illegal begin: Not an integer");
  36342. if (e >>>= 0,
  36343. "number" != typeof t || t % 1 != 0)
  36344. throw TypeError("Illegal end: Not an integer");
  36345. if (t >>>= 0,
  36346. e < 0 || t < e || t > this.buffer.byteLength)
  36347. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36348. }
  36349. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  36350. this
  36351. }
  36352. ,
  36353. a.skip = function(e) {
  36354. if (!this.noAssert) {
  36355. if ("number" != typeof e || e % 1 != 0)
  36356. throw TypeError("Illegal length: " + e + " (not an integer)");
  36357. e |= 0
  36358. }
  36359. var t = this.offset + e;
  36360. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  36361. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  36362. return this.offset = t,
  36363. this
  36364. }
  36365. ,
  36366. a.slice = function(e, t) {
  36367. if (void 0 === e && (e = this.offset),
  36368. void 0 === t && (t = this.limit),
  36369. !this.noAssert) {
  36370. if ("number" != typeof e || e % 1 != 0)
  36371. throw TypeError("Illegal begin: Not an integer");
  36372. if (e >>>= 0,
  36373. "number" != typeof t || t % 1 != 0)
  36374. throw TypeError("Illegal end: Not an integer");
  36375. if (t >>>= 0,
  36376. e < 0 || t < e || t > this.buffer.byteLength)
  36377. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36378. }
  36379. var i = this.clone();
  36380. return i.offset = e,
  36381. i.limit = t,
  36382. i
  36383. }
  36384. ,
  36385. a.toBuffer = function(e) {
  36386. var t = this.offset
  36387. , i = this.limit;
  36388. if (!this.noAssert) {
  36389. if ("number" != typeof t || t % 1 != 0)
  36390. throw TypeError("Illegal offset: Not an integer");
  36391. if (t >>>= 0,
  36392. "number" != typeof i || i % 1 != 0)
  36393. throw TypeError("Illegal limit: Not an integer");
  36394. if (i >>>= 0,
  36395. t < 0 || i < t || i > this.buffer.byteLength)
  36396. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36397. }
  36398. if (!e && 0 === t && i === this.buffer.byteLength)
  36399. return this.buffer;
  36400. if (t === i)
  36401. return o;
  36402. var n = new ArrayBuffer(i - t);
  36403. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  36404. n
  36405. }
  36406. ,
  36407. a.toArrayBuffer = a.toBuffer,
  36408. a.toString = function(e, t, i) {
  36409. if (void 0 === e)
  36410. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  36411. switch ("number" == typeof e && (i = t = e = "utf8"),
  36412. e) {
  36413. case "utf8":
  36414. return this.toUTF8(t, i);
  36415. case "base64":
  36416. return this.toBase64(t, i);
  36417. case "hex":
  36418. return this.toHex(t, i);
  36419. case "binary":
  36420. return this.toBinary(t, i);
  36421. case "debug":
  36422. return this.toDebug();
  36423. case "columns":
  36424. return this.toColumns();
  36425. default:
  36426. throw Error("Unsupported encoding: " + e)
  36427. }
  36428. }
  36429. ;
  36430. var h = function() {
  36431. for (var e = {}, r = [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], a = [], t = 0, i = r.length; t < i; ++t)
  36432. a[r[t]] = t;
  36433. return e.encode = function(e, t) {
  36434. for (var i, n; null !== (i = e()); )
  36435. t(r[i >> 2 & 63]),
  36436. n = (3 & i) << 4,
  36437. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  36438. n = (15 & i) << 2,
  36439. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  36440. t(r[63 & i])) : (t(r[63 & n]),
  36441. t(61))) : (t(r[63 & n]),
  36442. t(61),
  36443. t(61))
  36444. }
  36445. ,
  36446. e.decode = function(e, t) {
  36447. function i(e) {
  36448. throw Error("Illegal character code: " + e)
  36449. }
  36450. for (var n, r, o; null !== (n = e()); )
  36451. if (void 0 === (r = a[n]) && i(n),
  36452. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  36453. t(r << 2 >>> 0 | (48 & o) >> 4),
  36454. null !== (n = e()))) {
  36455. if (void 0 === (r = a[n])) {
  36456. if (61 === n)
  36457. break;
  36458. i(n)
  36459. }
  36460. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  36461. null !== (n = e())) {
  36462. if (void 0 === (o = a[n])) {
  36463. if (61 === n)
  36464. break;
  36465. i(n)
  36466. }
  36467. t((3 & r) << 6 >>> 0 | o)
  36468. }
  36469. }
  36470. }
  36471. ,
  36472. e.test = function(e) {
  36473. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36474. }
  36475. ,
  36476. e
  36477. }();
  36478. a.toBase64 = function(e, t) {
  36479. if (void 0 === e && (e = this.offset),
  36480. void 0 === t && (t = this.limit),
  36481. t |= 0,
  36482. (e |= 0) < 0 || t > this.capacity || t < e)
  36483. throw RangeError("begin, end");
  36484. var i;
  36485. return h.encode(function() {
  36486. return e < t ? this.view[e++] : null
  36487. }
  36488. .bind(this), i = c()),
  36489. i()
  36490. }
  36491. ,
  36492. f.fromBase64 = function(e, t) {
  36493. if ("string" != typeof e)
  36494. throw TypeError("str");
  36495. var i = new f(e.length / 4 * 3,t)
  36496. , n = 0;
  36497. return h.decode(s(e), function(e) {
  36498. i.view[n++] = e
  36499. }),
  36500. i.limit = n,
  36501. i
  36502. }
  36503. ,
  36504. f.btoa = function(e) {
  36505. return f.fromBinary(e).toBase64()
  36506. }
  36507. ,
  36508. f.atob = function(e) {
  36509. return f.fromBase64(e).toBinary()
  36510. }
  36511. ,
  36512. a.toBinary = function(e, t) {
  36513. if (void 0 === e && (e = this.offset),
  36514. void 0 === t && (t = this.limit),
  36515. t |= 0,
  36516. (e |= 0) < 0 || t > this.capacity() || t < e)
  36517. throw RangeError("begin, end");
  36518. if (e === t)
  36519. return "";
  36520. for (var i = [], n = []; e < t; )
  36521. i.push(this.view[e++]),
  36522. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  36523. i = []);
  36524. return n.join("") + String.fromCharCode.apply(String, i)
  36525. }
  36526. ,
  36527. f.fromBinary = function(e, t) {
  36528. if ("string" != typeof e)
  36529. throw TypeError("str");
  36530. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  36531. if (255 < (i = e.charCodeAt(n)))
  36532. throw RangeError("illegal char code: " + i);
  36533. o.view[n++] = i
  36534. }
  36535. return o.limit = r,
  36536. o
  36537. }
  36538. ,
  36539. a.toDebug = function(e) {
  36540. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  36541. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  36542. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  36543. ++i,
  36544. e && 0 < i && i % 16 == 0 && i !== n) {
  36545. for (; r.length < 51; )
  36546. r += " ";
  36547. a += r + o + "\n",
  36548. r = o = ""
  36549. }
  36550. 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 ? " " : ""
  36551. }
  36552. if (e && " " !== r) {
  36553. for (; r.length < 51; )
  36554. r += " ";
  36555. a += r + o + "\n"
  36556. }
  36557. return e ? a : r
  36558. }
  36559. ,
  36560. f.fromDebug = function(e, t, i) {
  36561. for (var n, r, o = e.length, a = new f((o + 1) / 3 | 0,t,i), s = 0, l = 0, c = !1, h = !1, u = !1, d = !1, p = !1; s < o; ) {
  36562. switch (n = e.charAt(s++)) {
  36563. case "!":
  36564. if (!i) {
  36565. if (h || u || d) {
  36566. p = !0;
  36567. break
  36568. }
  36569. h = u = d = !0
  36570. }
  36571. a.offset = a.markedOffset = a.limit = l,
  36572. c = !1;
  36573. break;
  36574. case "|":
  36575. if (!i) {
  36576. if (h || d) {
  36577. p = !0;
  36578. break
  36579. }
  36580. h = d = !0
  36581. }
  36582. a.offset = a.limit = l,
  36583. c = !1;
  36584. break;
  36585. case "[":
  36586. if (!i) {
  36587. if (h || u) {
  36588. p = !0;
  36589. break
  36590. }
  36591. h = u = !0
  36592. }
  36593. a.offset = a.markedOffset = l,
  36594. c = !1;
  36595. break;
  36596. case "<":
  36597. if (!i) {
  36598. if (h) {
  36599. p = !0;
  36600. break
  36601. }
  36602. h = !0
  36603. }
  36604. a.offset = l,
  36605. c = !1;
  36606. break;
  36607. case "]":
  36608. if (!i) {
  36609. if (d || u) {
  36610. p = !0;
  36611. break
  36612. }
  36613. d = u = !0
  36614. }
  36615. a.limit = a.markedOffset = l,
  36616. c = !1;
  36617. break;
  36618. case ">":
  36619. if (!i) {
  36620. if (d) {
  36621. p = !0;
  36622. break
  36623. }
  36624. d = !0
  36625. }
  36626. a.limit = l,
  36627. c = !1;
  36628. break;
  36629. case "'":
  36630. if (!i) {
  36631. if (u) {
  36632. p = !0;
  36633. break
  36634. }
  36635. u = !0
  36636. }
  36637. a.markedOffset = l,
  36638. c = !1;
  36639. break;
  36640. case " ":
  36641. c = !1;
  36642. break;
  36643. default:
  36644. if (!i && c) {
  36645. p = !0;
  36646. break
  36647. }
  36648. if (r = parseInt(n + e.charAt(s++), 16),
  36649. !i && (isNaN(r) || r < 0 || 255 < r))
  36650. throw TypeError("Illegal str: Not a debug encoded string");
  36651. a.view[l++] = r,
  36652. c = !0
  36653. }
  36654. if (p)
  36655. throw TypeError("Illegal str: Invalid symbol at " + s)
  36656. }
  36657. if (!i) {
  36658. if (!h || !d)
  36659. throw TypeError("Illegal str: Missing offset or limit");
  36660. if (l < a.buffer.byteLength)
  36661. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  36662. }
  36663. return a
  36664. }
  36665. ,
  36666. a.toHex = function(e, t) {
  36667. if (e = void 0 === e ? this.offset : e,
  36668. t = void 0 === t ? this.limit : t,
  36669. !this.noAssert) {
  36670. if ("number" != typeof e || e % 1 != 0)
  36671. throw TypeError("Illegal begin: Not an integer");
  36672. if (e >>>= 0,
  36673. "number" != typeof t || t % 1 != 0)
  36674. throw TypeError("Illegal end: Not an integer");
  36675. if (t >>>= 0,
  36676. e < 0 || t < e || t > this.buffer.byteLength)
  36677. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36678. }
  36679. for (var i, n = new Array(t - e); e < t; )
  36680. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36681. return n.join("")
  36682. }
  36683. ,
  36684. f.fromHex = function(e, t, i) {
  36685. if (!i) {
  36686. if ("string" != typeof e)
  36687. throw TypeError("Illegal str: Not a string");
  36688. if (e.length % 2 != 0)
  36689. throw TypeError("Illegal str: Length not a multiple of 2")
  36690. }
  36691. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  36692. if (n = parseInt(e.substring(a, a + 2), 16),
  36693. !i && (!isFinite(n) || n < 0 || 255 < n))
  36694. throw TypeError("Illegal str: Contains non-hex characters");
  36695. o.view[s++] = n
  36696. }
  36697. return o.limit = s,
  36698. o
  36699. }
  36700. ;
  36701. var u, d = u = {
  36702. MAX_CODEPOINT: 1114111,
  36703. encodeUTF8: function(e, t) {
  36704. var i = null;
  36705. for ("number" == typeof e && (i = e,
  36706. e = function() {
  36707. return null
  36708. }
  36709. ); null !== i || null !== (i = e()); )
  36710. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  36711. t(i >> 12 & 63 | 128)),
  36712. t(i >> 6 & 63 | 128)),
  36713. t(63 & i | 128)),
  36714. i = null
  36715. },
  36716. decodeUTF8: function(e, t) {
  36717. for (var i, n, r, o, a = function(e) {
  36718. e = e.slice(0, e.indexOf(null));
  36719. var t = Error(e.toString());
  36720. throw t.name = "TruncatedError",
  36721. t.bytes = e,
  36722. t
  36723. }; null !== (i = e()); )
  36724. if (0 == (128 & i))
  36725. t(i);
  36726. else if (192 == (224 & i))
  36727. null === (n = e()) && a([i, n]),
  36728. t((31 & i) << 6 | 63 & n);
  36729. else if (224 == (240 & i))
  36730. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  36731. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36732. else {
  36733. if (240 != (248 & i))
  36734. throw RangeError("Illegal starting byte: " + i);
  36735. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  36736. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36737. }
  36738. },
  36739. UTF16toUTF8: function(e, t) {
  36740. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  36741. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36742. n = null) : t(i);
  36743. null !== n && t(n)
  36744. },
  36745. UTF8toUTF16: function(e, t) {
  36746. var i = null;
  36747. for ("number" == typeof e && (i = e,
  36748. e = function() {
  36749. return null
  36750. }
  36751. ); null !== i || null !== (i = e()); )
  36752. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  36753. t(i % 1024 + 56320)),
  36754. i = null
  36755. },
  36756. encodeUTF16toUTF8: function(e, t) {
  36757. u.UTF16toUTF8(e, function(e) {
  36758. u.encodeUTF8(e, t)
  36759. })
  36760. },
  36761. decodeUTF8toUTF16: function(e, t) {
  36762. u.decodeUTF8(e, function(e) {
  36763. u.UTF8toUTF16(e, t)
  36764. })
  36765. },
  36766. calculateCodePoint: function(e) {
  36767. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36768. },
  36769. calculateUTF8: function(e) {
  36770. for (var t, i = 0; null !== (t = e()); )
  36771. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36772. return i
  36773. },
  36774. calculateUTF16asUTF8: function(e) {
  36775. var t = 0
  36776. , i = 0;
  36777. return u.UTF16toUTF8(e, function(e) {
  36778. ++t,
  36779. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36780. }),
  36781. [t, i]
  36782. }
  36783. };
  36784. return a.toUTF8 = function(t, i) {
  36785. if (void 0 === t && (t = this.offset),
  36786. void 0 === i && (i = this.limit),
  36787. !this.noAssert) {
  36788. if ("number" != typeof t || t % 1 != 0)
  36789. throw TypeError("Illegal begin: Not an integer");
  36790. if (t >>>= 0,
  36791. "number" != typeof i || i % 1 != 0)
  36792. throw TypeError("Illegal end: Not an integer");
  36793. if (i >>>= 0,
  36794. t < 0 || i < t || i > this.buffer.byteLength)
  36795. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36796. }
  36797. var e;
  36798. try {
  36799. d.decodeUTF8toUTF16(function() {
  36800. return t < i ? this.view[t++] : null
  36801. }
  36802. .bind(this), e = c())
  36803. } catch (e) {
  36804. if (t !== i)
  36805. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36806. }
  36807. return e()
  36808. }
  36809. ,
  36810. f.fromUTF8 = function(e, t, i) {
  36811. if (!i && "string" != typeof e)
  36812. throw TypeError("Illegal str: Not a string");
  36813. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36814. , r = 0;
  36815. return d.encodeUTF16toUTF8(s(e), function(e) {
  36816. n.view[r++] = e
  36817. }),
  36818. n.limit = r,
  36819. n
  36820. }
  36821. ,
  36822. f
  36823. }
  36824. ,
  36825. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36826. var e;
  36827. try {
  36828. e = t("long")
  36829. } catch (e) {}
  36830. return r(e)
  36831. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36832. }
  36833. , {
  36834. long: 216
  36835. }],
  36836. 216: [function(e, t, i) {
  36837. var n, r;
  36838. n = this,
  36839. r = function() {
  36840. "use strict";
  36841. function n(e, t, i) {
  36842. this.low = 0 | e,
  36843. this.high = 0 | t,
  36844. this.unsigned = !!i
  36845. }
  36846. function p(e) {
  36847. return !0 === (e && e.__isLong__)
  36848. }
  36849. function e(e, t) {
  36850. var i, n, r;
  36851. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36852. r && (a[e] = i),
  36853. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36854. r && (o[e] = i),
  36855. i)
  36856. }
  36857. function f(e, t) {
  36858. if (isNaN(e) || !isFinite(e))
  36859. return t ? l : y;
  36860. if (t) {
  36861. if (e < 0)
  36862. return l;
  36863. if (r <= e)
  36864. return I
  36865. } else {
  36866. if (e <= -s)
  36867. return E;
  36868. if (s <= e + 1)
  36869. return C
  36870. }
  36871. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36872. }
  36873. function g(e, t, i) {
  36874. return new n(e,t,i)
  36875. }
  36876. function h(e, t, i) {
  36877. if (0 === e.length)
  36878. throw Error("empty string");
  36879. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36880. return y;
  36881. if (t = "number" == typeof t ? (i = t,
  36882. !1) : !!t,
  36883. (i = i || 10) < 2 || 36 < i)
  36884. throw RangeError("radix");
  36885. var n;
  36886. if (0 < (n = e.indexOf("-")))
  36887. throw Error("interior hyphen");
  36888. if (0 === n)
  36889. return h(e.substring(1), t, i).neg();
  36890. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36891. var s = Math.min(8, e.length - a)
  36892. , l = parseInt(e.substring(a, a + s), i);
  36893. if (s < 8) {
  36894. var c = f(u(i, s));
  36895. o = o.mul(c).add(f(l))
  36896. } else
  36897. o = (o = o.mul(r)).add(f(l))
  36898. }
  36899. return o.unsigned = t,
  36900. o
  36901. }
  36902. function m(e) {
  36903. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36904. }
  36905. Object.defineProperty(n.prototype, "__isLong__", {
  36906. value: !0,
  36907. enumerable: !1,
  36908. configurable: !1
  36909. }),
  36910. n.isLong = p;
  36911. var o = {}
  36912. , a = {};
  36913. n.fromInt = e,
  36914. n.fromNumber = f,
  36915. n.fromBits = g;
  36916. var u = Math.pow;
  36917. n.fromString = h,
  36918. n.fromValue = m;
  36919. var i = 4294967296
  36920. , r = 0x10000000000000000
  36921. , s = r / 2
  36922. , v = e(1 << 24)
  36923. , y = e(0);
  36924. n.ZERO = y;
  36925. var l = e(0, !0);
  36926. n.UZERO = l;
  36927. var c = e(1);
  36928. n.ONE = c;
  36929. var d = e(1, !0);
  36930. n.UONE = d;
  36931. var A = e(-1);
  36932. n.NEG_ONE = A;
  36933. var C = g(-1, 2147483647, !1);
  36934. n.MAX_VALUE = C;
  36935. var I = g(-1, -1, !0);
  36936. n.MAX_UNSIGNED_VALUE = I;
  36937. var E = g(0, -2147483648, !1);
  36938. n.MIN_VALUE = E;
  36939. var t = n.prototype;
  36940. return t.toInt = function() {
  36941. return this.unsigned ? this.low >>> 0 : this.low
  36942. }
  36943. ,
  36944. t.toNumber = function() {
  36945. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  36946. }
  36947. ,
  36948. t.toString = function(e) {
  36949. if ((e = e || 10) < 2 || 36 < e)
  36950. throw RangeError("radix");
  36951. if (this.isZero())
  36952. return "0";
  36953. if (this.isNegative()) {
  36954. if (this.eq(E)) {
  36955. var t = f(e)
  36956. , i = this.div(t)
  36957. , n = i.mul(t).sub(this);
  36958. return i.toString(e) + n.toInt().toString(e)
  36959. }
  36960. return "-" + this.neg().toString(e)
  36961. }
  36962. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  36963. var s = o.div(r)
  36964. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  36965. if ((o = s).isZero())
  36966. return l + a;
  36967. for (; l.length < 6; )
  36968. l = "0" + l;
  36969. a = "" + l + a
  36970. }
  36971. }
  36972. ,
  36973. t.getHighBits = function() {
  36974. return this.high
  36975. }
  36976. ,
  36977. t.getHighBitsUnsigned = function() {
  36978. return this.high >>> 0
  36979. }
  36980. ,
  36981. t.getLowBits = function() {
  36982. return this.low
  36983. }
  36984. ,
  36985. t.getLowBitsUnsigned = function() {
  36986. return this.low >>> 0
  36987. }
  36988. ,
  36989. t.getNumBitsAbs = function() {
  36990. if (this.isNegative())
  36991. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36992. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  36993. ;
  36994. return 0 != this.high ? t + 33 : t + 1
  36995. }
  36996. ,
  36997. t.isZero = function() {
  36998. return 0 === this.high && 0 === this.low
  36999. }
  37000. ,
  37001. t.isNegative = function() {
  37002. return !this.unsigned && this.high < 0
  37003. }
  37004. ,
  37005. t.isPositive = function() {
  37006. return this.unsigned || 0 <= this.high
  37007. }
  37008. ,
  37009. t.isOdd = function() {
  37010. return 1 == (1 & this.low)
  37011. }
  37012. ,
  37013. t.isEven = function() {
  37014. return 0 == (1 & this.low)
  37015. }
  37016. ,
  37017. t.equals = function(e) {
  37018. return p(e) || (e = m(e)),
  37019. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  37020. }
  37021. ,
  37022. t.eq = t.equals,
  37023. t.notEquals = function(e) {
  37024. return !this.eq(e)
  37025. }
  37026. ,
  37027. t.neq = t.notEquals,
  37028. t.lessThan = function(e) {
  37029. return this.comp(e) < 0
  37030. }
  37031. ,
  37032. t.lt = t.lessThan,
  37033. t.lessThanOrEqual = function(e) {
  37034. return this.comp(e) <= 0
  37035. }
  37036. ,
  37037. t.lte = t.lessThanOrEqual,
  37038. t.greaterThan = function(e) {
  37039. return 0 < this.comp(e)
  37040. }
  37041. ,
  37042. t.gt = t.greaterThan,
  37043. t.greaterThanOrEqual = function(e) {
  37044. return 0 <= this.comp(e)
  37045. }
  37046. ,
  37047. t.gte = t.greaterThanOrEqual,
  37048. t.compare = function(e) {
  37049. if (p(e) || (e = m(e)),
  37050. this.eq(e))
  37051. return 0;
  37052. var t = this.isNegative()
  37053. , i = e.isNegative();
  37054. return t && !i ? -1 : !t && i ? 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
  37055. }
  37056. ,
  37057. t.comp = t.compare,
  37058. t.negate = function() {
  37059. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  37060. }
  37061. ,
  37062. t.neg = t.negate,
  37063. t.add = function(e) {
  37064. p(e) || (e = m(e));
  37065. var t = this.high >>> 16
  37066. , i = 65535 & this.high
  37067. , n = this.low >>> 16
  37068. , r = 65535 & this.low
  37069. , o = e.high >>> 16
  37070. , a = 65535 & e.high
  37071. , s = e.low >>> 16
  37072. , l = 0
  37073. , c = 0
  37074. , h = 0
  37075. , u = 0;
  37076. return h += (u += r + (65535 & e.low)) >>> 16,
  37077. c += (h += n + s) >>> 16,
  37078. l += (c += i + a) >>> 16,
  37079. l += t + o,
  37080. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  37081. }
  37082. ,
  37083. t.subtract = function(e) {
  37084. return p(e) || (e = m(e)),
  37085. this.add(e.neg())
  37086. }
  37087. ,
  37088. t.sub = t.subtract,
  37089. t.multiply = function(e) {
  37090. if (this.isZero())
  37091. return y;
  37092. if (p(e) || (e = m(e)),
  37093. e.isZero())
  37094. return y;
  37095. if (this.eq(E))
  37096. return e.isOdd() ? E : y;
  37097. if (e.eq(E))
  37098. return this.isOdd() ? E : y;
  37099. if (this.isNegative())
  37100. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  37101. if (e.isNegative())
  37102. return this.mul(e.neg()).neg();
  37103. if (this.lt(v) && e.lt(v))
  37104. return f(this.toNumber() * e.toNumber(), this.unsigned);
  37105. var t = this.high >>> 16
  37106. , i = 65535 & this.high
  37107. , n = this.low >>> 16
  37108. , r = 65535 & this.low
  37109. , o = e.high >>> 16
  37110. , a = 65535 & e.high
  37111. , s = e.low >>> 16
  37112. , l = 65535 & e.low
  37113. , c = 0
  37114. , h = 0
  37115. , u = 0
  37116. , d = 0;
  37117. return u += (d += r * l) >>> 16,
  37118. h += (u += n * l) >>> 16,
  37119. u &= 65535,
  37120. h += (u += r * s) >>> 16,
  37121. c += (h += i * l) >>> 16,
  37122. h &= 65535,
  37123. c += (h += n * s) >>> 16,
  37124. h &= 65535,
  37125. c += (h += r * a) >>> 16,
  37126. c += t * l + i * s + n * a + r * o,
  37127. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  37128. }
  37129. ,
  37130. t.mul = t.multiply,
  37131. t.divide = function(e) {
  37132. if (p(e) || (e = m(e)),
  37133. e.isZero())
  37134. throw Error("division by zero");
  37135. if (this.isZero())
  37136. return this.unsigned ? l : y;
  37137. var t, i, n;
  37138. if (this.unsigned) {
  37139. if (e.unsigned || (e = e.toUnsigned()),
  37140. e.gt(this))
  37141. return l;
  37142. if (e.gt(this.shru(1)))
  37143. return d;
  37144. n = l
  37145. } else {
  37146. if (this.eq(E))
  37147. return e.eq(c) || e.eq(A) ? E : e.eq(E) ? c : (t = this.shr(1).div(e).shl(1)).eq(y) ? e.isNegative() ? c : A : (i = this.sub(e.mul(t)),
  37148. n = t.add(i.div(e)));
  37149. if (e.eq(E))
  37150. return this.unsigned ? l : y;
  37151. if (this.isNegative())
  37152. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  37153. if (e.isNegative())
  37154. return this.div(e.neg()).neg();
  37155. n = y
  37156. }
  37157. for (i = this; i.gte(e); ) {
  37158. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  37159. for (var r = Math.ceil(Math.log(t) / Math.LN2), o = r <= 48 ? 1 : u(2, r - 48), a = f(t), s = a.mul(e); s.isNegative() || s.gt(i); )
  37160. s = (a = f(t -= o, this.unsigned)).mul(e);
  37161. a.isZero() && (a = c),
  37162. n = n.add(a),
  37163. i = i.sub(s)
  37164. }
  37165. return n
  37166. }
  37167. ,
  37168. t.div = t.divide,
  37169. t.modulo = function(e) {
  37170. return p(e) || (e = m(e)),
  37171. this.sub(this.div(e).mul(e))
  37172. }
  37173. ,
  37174. t.mod = t.modulo,
  37175. t.not = function() {
  37176. return g(~this.low, ~this.high, this.unsigned)
  37177. }
  37178. ,
  37179. t.and = function(e) {
  37180. return p(e) || (e = m(e)),
  37181. g(this.low & e.low, this.high & e.high, this.unsigned)
  37182. }
  37183. ,
  37184. t.or = function(e) {
  37185. return p(e) || (e = m(e)),
  37186. g(this.low | e.low, this.high | e.high, this.unsigned)
  37187. }
  37188. ,
  37189. t.xor = function(e) {
  37190. return p(e) || (e = m(e)),
  37191. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  37192. }
  37193. ,
  37194. t.shiftLeft = function(e) {
  37195. return p(e) && (e = e.toInt()),
  37196. 0 == (e &= 63) ? this : e < 32 ? g(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : g(0, this.low << e - 32, this.unsigned)
  37197. }
  37198. ,
  37199. t.shl = t.shiftLeft,
  37200. t.shiftRight = function(e) {
  37201. return p(e) && (e = e.toInt()),
  37202. 0 == (e &= 63) ? this : e < 32 ? g(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : g(this.high >> e - 32, 0 <= this.high ? 0 : -1, this.unsigned)
  37203. }
  37204. ,
  37205. t.shr = t.shiftRight,
  37206. t.shiftRightUnsigned = function(e) {
  37207. if (p(e) && (e = e.toInt()),
  37208. 0 === (e &= 63))
  37209. return this;
  37210. var t = this.high;
  37211. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  37212. }
  37213. ,
  37214. t.shru = t.shiftRightUnsigned,
  37215. t.toSigned = function() {
  37216. return this.unsigned ? g(this.low, this.high, !1) : this
  37217. }
  37218. ,
  37219. t.toUnsigned = function() {
  37220. return this.unsigned ? this : g(this.low, this.high, !0)
  37221. }
  37222. ,
  37223. t.toBytes = function(e) {
  37224. return e ? this.toBytesLE() : this.toBytesBE()
  37225. }
  37226. ,
  37227. t.toBytesLE = function() {
  37228. var e = this.high
  37229. , t = this.low;
  37230. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  37231. }
  37232. ,
  37233. t.toBytesBE = function() {
  37234. var e = this.high
  37235. , t = this.low;
  37236. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  37237. }
  37238. ,
  37239. n
  37240. }
  37241. ,
  37242. "function" == typeof define && define.amd ? define([], r) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = r() : (n.dcodeIO = n.dcodeIO || {}).Long = r()
  37243. }
  37244. , {}],
  37245. 217: [function(e, t, i) {
  37246. var n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J, $, ee, te, ie, ne, re, oe, ae, se, le, ce, he, ue, de, pe, fe, ge, me, ve, ye, Ae, Ce, Ie, Ee, _e, be, we, Te, xe, Se, Me, Re, Pe, Oe, Le, De, Ne, Fe, Be, Ve, ke, Ue, He, ze, Ge, We, je, Ye, qe, Xe, Ze, Ke, Qe, Je, $e, et, tt, it, nt, rt, ot, at, st, lt, ct, ht, ut, dt, pt, ft, gt, mt, vt, yt, At, Ct, It, Et, _t, bt, wt, Tt, xt, St, Mt, Rt, Pt, Ot, Lt, Dt, Nt, Ft, Bt, Vt, kt, Ut, Ht, zt, Gt, Wt, jt, Yt, qt, Xt, Zt, Kt, Qt, Jt, $t, ei, ti, ii, ni, ri, oi, ai, si, li, ci, hi, ui, di, pi, fi, gi, mi, vi, yi, Ai, Ci = {
  37247. REVISION: "75"
  37248. };
  37249. function Ii(e, t) {
  37250. return e.distance - t.distance
  37251. }
  37252. function Ei(e, t, i, n) {
  37253. if (!1 !== e.visible && (e.raycast(t, i),
  37254. !0 === n))
  37255. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  37256. Ei(r[o], t, i, !0)
  37257. }
  37258. function _i(e, t, i) {
  37259. return i < 0 && (i += 1),
  37260. 1 < i && (i -= 1),
  37261. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  37262. }
  37263. function bi(e, t, i, n, r, o, a) {
  37264. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  37265. r.multiplyScalar(Vt.x),
  37266. o.multiplyScalar(Vt.y),
  37267. a.multiplyScalar(Vt.z),
  37268. r.add(o).add(a),
  37269. r.clone()
  37270. }
  37271. function wi(e, t, i, n, r, o, a) {
  37272. var s = e.material;
  37273. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  37274. return null;
  37275. Ut.copy(a),
  37276. Ut.applyMatrix4(e.matrixWorld);
  37277. var l = t.ray.origin.distanceTo(Ut);
  37278. return l < t.near || l > t.far ? null : {
  37279. distance: l,
  37280. point: Ut.clone(),
  37281. object: e
  37282. }
  37283. }
  37284. function Ti(e, t, i, n, r, o, a, s) {
  37285. Mt.fromArray(n, 3 * o),
  37286. Rt.fromArray(n, 3 * a),
  37287. Pt.fromArray(n, 3 * s);
  37288. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  37289. return l && (r && (Nt.fromArray(r, 2 * o),
  37290. Ft.fromArray(r, 2 * a),
  37291. Bt.fromArray(r, 2 * s),
  37292. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  37293. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  37294. l.faceIndex = o),
  37295. l
  37296. }
  37297. function xi() {}
  37298. function Si(e, t, i, n, r, o) {
  37299. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  37300. if (s = e[o[t]].x,
  37301. l = e[o[t]].y,
  37302. c = e[o[i]].x,
  37303. h = e[o[i]].y,
  37304. u = e[o[n]].x,
  37305. d = e[o[n]].y,
  37306. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  37307. return !1;
  37308. for (g = u - c,
  37309. m = d - h,
  37310. v = s - u,
  37311. y = l - d,
  37312. A = c - s,
  37313. C = h - l,
  37314. a = 0; a < r; a++)
  37315. if (p = e[o[a]].x,
  37316. f = e[o[a]].y,
  37317. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  37318. E = v * (f - d) - y * (p - u),
  37319. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  37320. return !1;
  37321. return !0
  37322. }
  37323. function Mi(e) {
  37324. switch (e) {
  37325. case Ci.LinearEncoding:
  37326. return ["Linear", "( value )"];
  37327. case Ci.sRGBEncoding:
  37328. return ["sRGB", "( value )"];
  37329. case Ci.RGBEEncoding:
  37330. return ["RGBE", "( value )"];
  37331. case Ci.RGBM7Encoding:
  37332. return ["RGBM", "( value, 7.0 )"];
  37333. case Ci.RGBM16Encoding:
  37334. return ["RGBM", "( value, 16.0 )"];
  37335. case Ci.RGBDEncoding:
  37336. return ["RGBD", "( value, 256.0 )"];
  37337. case Ci.GammaEncoding:
  37338. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  37339. default:
  37340. throw new Error("unsupported encoding: " + e)
  37341. }
  37342. }
  37343. function Ri(e, t) {
  37344. var i = Mi(t);
  37345. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  37346. }
  37347. function Pi(e) {
  37348. return "" !== e
  37349. }
  37350. function Oi(e, t) {
  37351. 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)
  37352. }
  37353. function Li(e) {
  37354. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  37355. var i = Ci.ShaderChunk[t];
  37356. if (void 0 === i)
  37357. throw new Error("Can not resolve #include <" + t + ">");
  37358. return Li(i)
  37359. })
  37360. }
  37361. function Di(e) {
  37362. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  37363. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  37364. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  37365. return r
  37366. })
  37367. }
  37368. function Ni(e, t, i, n) {
  37369. gi.set(t, i, n).unproject(mi);
  37370. var r = fi[e];
  37371. if (void 0 !== r)
  37372. for (var o = 0, a = r.length; o < a; o++)
  37373. pi.vertices[r[o]].copy(gi)
  37374. }
  37375. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  37376. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  37377. void 0 === Math.sign && (Math.sign = function(e) {
  37378. return e < 0 ? -1 : 0 < e ? 1 : +e
  37379. }
  37380. ),
  37381. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  37382. get: function() {
  37383. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  37384. }
  37385. }),
  37386. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  37387. writable: !0,
  37388. configurable: !0,
  37389. value: function(e) {
  37390. "use strict";
  37391. if (null == e)
  37392. throw new TypeError("Cannot convert first argument to object");
  37393. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  37394. var r = arguments[i];
  37395. if (null != r) {
  37396. r = Object(r);
  37397. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  37398. var l = o[a]
  37399. , c = Object.getOwnPropertyDescriptor(r, l);
  37400. void 0 !== c && c.enumerable && (t[l] = r[l])
  37401. }
  37402. }
  37403. }
  37404. return t
  37405. }
  37406. }),
  37407. Ci.MOUSE = {
  37408. LEFT: 0,
  37409. MIDDLE: 1,
  37410. RIGHT: 2
  37411. },
  37412. Ci.CullFaceNone = 0,
  37413. Ci.CullFaceBack = 1,
  37414. Ci.CullFaceFront = 2,
  37415. Ci.CullFaceFrontBack = 3,
  37416. Ci.FrontFaceDirectionCW = 0,
  37417. Ci.FrontFaceDirectionCCW = 1,
  37418. Ci.BasicShadowMap = 0,
  37419. Ci.PCFShadowMap = 1,
  37420. Ci.PCFSoftShadowMap = 2,
  37421. Ci.FrontSide = 0,
  37422. Ci.BackSide = 1,
  37423. Ci.DoubleSide = 2,
  37424. Ci.FlatShading = 1,
  37425. Ci.SmoothShading = 2,
  37426. Ci.NoColors = 0,
  37427. Ci.FaceColors = 1,
  37428. Ci.VertexColors = 2,
  37429. Ci.NoBlending = 0,
  37430. Ci.NormalBlending = 1,
  37431. Ci.AdditiveBlending = 2,
  37432. Ci.SubtractiveBlending = 3,
  37433. Ci.MultiplyBlending = 4,
  37434. Ci.CustomBlending = 5,
  37435. Ci.AddEquation = 100,
  37436. Ci.SubtractEquation = 101,
  37437. Ci.ReverseSubtractEquation = 102,
  37438. Ci.MinEquation = 103,
  37439. Ci.MaxEquation = 104,
  37440. Ci.ZeroFactor = 200,
  37441. Ci.OneFactor = 201,
  37442. Ci.SrcColorFactor = 202,
  37443. Ci.OneMinusSrcColorFactor = 203,
  37444. Ci.SrcAlphaFactor = 204,
  37445. Ci.OneMinusSrcAlphaFactor = 205,
  37446. Ci.DstAlphaFactor = 206,
  37447. Ci.OneMinusDstAlphaFactor = 207,
  37448. Ci.DstColorFactor = 208,
  37449. Ci.OneMinusDstColorFactor = 209,
  37450. Ci.SrcAlphaSaturateFactor = 210,
  37451. Ci.NeverDepth = 0,
  37452. Ci.AlwaysDepth = 1,
  37453. Ci.LessDepth = 2,
  37454. Ci.LessEqualDepth = 3,
  37455. Ci.EqualDepth = 4,
  37456. Ci.GreaterEqualDepth = 5,
  37457. Ci.GreaterDepth = 6,
  37458. Ci.NotEqualDepth = 7,
  37459. Ci.MultiplyOperation = 0,
  37460. Ci.MixOperation = 1,
  37461. Ci.AddOperation = 2,
  37462. Ci.NoToneMapping = 0,
  37463. Ci.LinearToneMapping = 1,
  37464. Ci.ReinhardToneMapping = 2,
  37465. Ci.Uncharted2ToneMapping = 3,
  37466. Ci.CineonToneMapping = 4,
  37467. Ci.UVMapping = 300,
  37468. Ci.CubeReflectionMapping = 301,
  37469. Ci.CubeRefractionMapping = 302,
  37470. Ci.EquirectangularReflectionMapping = 303,
  37471. Ci.EquirectangularRefractionMapping = 304,
  37472. Ci.SphericalReflectionMapping = 305,
  37473. Ci.CubeUVReflectionMapping = 306,
  37474. Ci.CubeUVRefractionMapping = 307,
  37475. Ci.RepeatWrapping = 1e3,
  37476. Ci.ClampToEdgeWrapping = 1001,
  37477. Ci.MirroredRepeatWrapping = 1002,
  37478. Ci.NearestFilter = 1003,
  37479. Ci.NearestMipMapNearestFilter = 1004,
  37480. Ci.NearestMipMapLinearFilter = 1005,
  37481. Ci.LinearFilter = 1006,
  37482. Ci.LinearMipMapNearestFilter = 1007,
  37483. Ci.LinearMipMapLinearFilter = 1008,
  37484. Ci.UnsignedByteType = 1009,
  37485. Ci.ByteType = 1010,
  37486. Ci.ShortType = 1011,
  37487. Ci.UnsignedShortType = 1012,
  37488. Ci.IntType = 1013,
  37489. Ci.UnsignedIntType = 1014,
  37490. Ci.FloatType = 1015,
  37491. Ci.HalfFloatType = 1025,
  37492. Ci.UnsignedShort4444Type = 1016,
  37493. Ci.UnsignedShort5551Type = 1017,
  37494. Ci.UnsignedShort565Type = 1018,
  37495. Ci.AlphaFormat = 1019,
  37496. Ci.RGBFormat = 1020,
  37497. Ci.RGBAFormat = 1021,
  37498. Ci.LuminanceFormat = 1022,
  37499. Ci.LuminanceAlphaFormat = 1023,
  37500. Ci.RGBEFormat = Ci.RGBAFormat,
  37501. Ci.RGB_S3TC_DXT1_Format = 2001,
  37502. Ci.RGBA_S3TC_DXT1_Format = 2002,
  37503. Ci.RGBA_S3TC_DXT3_Format = 2003,
  37504. Ci.RGBA_S3TC_DXT5_Format = 2004,
  37505. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  37506. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  37507. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  37508. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  37509. Ci.RGB_ETC1_Format = 2151,
  37510. Ci.LoopOnce = 2200,
  37511. Ci.LoopRepeat = 2201,
  37512. Ci.LoopPingPong = 2202,
  37513. Ci.InterpolateDiscrete = 2300,
  37514. Ci.InterpolateLinear = 2301,
  37515. Ci.InterpolateSmooth = 2302,
  37516. Ci.ZeroCurvatureEnding = 2400,
  37517. Ci.ZeroSlopeEnding = 2401,
  37518. Ci.WrapAroundEnding = 2402,
  37519. Ci.TrianglesDrawMode = 0,
  37520. Ci.TriangleStripDrawMode = 1,
  37521. Ci.TriangleFanDrawMode = 2,
  37522. Ci.LinearEncoding = 3e3,
  37523. Ci.sRGBEncoding = 3001,
  37524. Ci.GammaEncoding = 3007,
  37525. Ci.RGBEEncoding = 3002,
  37526. Ci.LogLuvEncoding = 3003,
  37527. Ci.RGBM7Encoding = 3004,
  37528. Ci.RGBM16Encoding = 3005,
  37529. Ci.RGBDEncoding = 3006,
  37530. Ci.Color = function(e) {
  37531. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37532. }
  37533. ,
  37534. Ci.Color.prototype = {
  37535. constructor: Ci.Color,
  37536. r: 1,
  37537. g: 1,
  37538. b: 1,
  37539. set: function(e) {
  37540. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  37541. this
  37542. },
  37543. setScalar: function(e) {
  37544. this.r = e,
  37545. this.g = e,
  37546. this.b = e
  37547. },
  37548. setHex: function(e) {
  37549. return e = Math.floor(e),
  37550. this.r = (e >> 16 & 255) / 255,
  37551. this.g = (e >> 8 & 255) / 255,
  37552. this.b = (255 & e) / 255,
  37553. this
  37554. },
  37555. setRGB: function(e, t, i) {
  37556. return this.r = e,
  37557. this.g = t,
  37558. this.b = i,
  37559. this
  37560. },
  37561. setHSL: function(e, t, i) {
  37562. if (e = Ci.Math.euclideanModulo(e, 1),
  37563. t = Ci.Math.clamp(t, 0, 1),
  37564. i = Ci.Math.clamp(i, 0, 1),
  37565. 0 === t)
  37566. this.r = this.g = this.b = i;
  37567. else {
  37568. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  37569. , r = 2 * i - n;
  37570. this.r = _i(r, n, e + 1 / 3),
  37571. this.g = _i(r, n, e),
  37572. this.b = _i(r, n, e - 1 / 3)
  37573. }
  37574. return this
  37575. },
  37576. setStyle: function(t) {
  37577. function e(e) {
  37578. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  37579. }
  37580. var i;
  37581. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  37582. var n, r = i[1], o = i[2];
  37583. switch (r) {
  37584. case "rgb":
  37585. case "rgba":
  37586. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37587. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  37588. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  37589. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  37590. e(n[5]),
  37591. this;
  37592. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37593. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  37594. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  37595. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  37596. e(n[5]),
  37597. this;
  37598. break;
  37599. case "hsl":
  37600. case "hsla":
  37601. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  37602. var a = parseFloat(n[1]) / 360
  37603. , s = parseInt(n[2], 10) / 100
  37604. , l = parseInt(n[3], 10) / 100;
  37605. return e(n[5]),
  37606. this.setHSL(a, s, l)
  37607. }
  37608. }
  37609. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  37610. var c, h = (c = i[1]).length;
  37611. if (3 === h)
  37612. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  37613. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  37614. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  37615. this;
  37616. if (6 === h)
  37617. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  37618. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  37619. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  37620. this
  37621. }
  37622. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  37623. return this
  37624. },
  37625. clone: function() {
  37626. return new this.constructor(this.r,this.g,this.b)
  37627. },
  37628. copy: function(e) {
  37629. return this.r = e.r,
  37630. this.g = e.g,
  37631. this.b = e.b,
  37632. this
  37633. },
  37634. copyGammaToLinear: function(e, t) {
  37635. return void 0 === t && (t = 2),
  37636. this.r = Math.pow(e.r, t),
  37637. this.g = Math.pow(e.g, t),
  37638. this.b = Math.pow(e.b, t),
  37639. this
  37640. },
  37641. copyLinearToGamma: function(e, t) {
  37642. void 0 === t && (t = 2);
  37643. var i = 0 < t ? 1 / t : 1;
  37644. return this.r = Math.pow(e.r, i),
  37645. this.g = Math.pow(e.g, i),
  37646. this.b = Math.pow(e.b, i),
  37647. this
  37648. },
  37649. convertGammaToLinear: function() {
  37650. var e = this.r
  37651. , t = this.g
  37652. , i = this.b;
  37653. return this.r = e * e,
  37654. this.g = t * t,
  37655. this.b = i * i,
  37656. this
  37657. },
  37658. convertLinearToGamma: function() {
  37659. return this.r = Math.sqrt(this.r),
  37660. this.g = Math.sqrt(this.g),
  37661. this.b = Math.sqrt(this.b),
  37662. this
  37663. },
  37664. getHex: function() {
  37665. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37666. },
  37667. getHexString: function() {
  37668. return ("000000" + this.getHex().toString(16)).slice(-6)
  37669. },
  37670. getHSL: function(e) {
  37671. var t, i, n = e || {
  37672. h: 0,
  37673. s: 0,
  37674. l: 0
  37675. }, 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;
  37676. if (l === s)
  37677. i = t = 0;
  37678. else {
  37679. var h = s - l;
  37680. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37681. s) {
  37682. case r:
  37683. t = (o - a) / h + (o < a ? 6 : 0);
  37684. break;
  37685. case o:
  37686. t = (a - r) / h + 2;
  37687. break;
  37688. case a:
  37689. t = (r - o) / h + 4
  37690. }
  37691. t /= 6
  37692. }
  37693. return n.h = t,
  37694. n.s = i,
  37695. n.l = c,
  37696. n
  37697. },
  37698. getStyle: function() {
  37699. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37700. },
  37701. offsetHSL: function(e, t, i) {
  37702. var n = this.getHSL();
  37703. return n.h += e,
  37704. n.s += t,
  37705. n.l += i,
  37706. this.setHSL(n.h, n.s, n.l),
  37707. this
  37708. },
  37709. add: function(e) {
  37710. return this.r += e.r,
  37711. this.g += e.g,
  37712. this.b += e.b,
  37713. this
  37714. },
  37715. addColors: function(e, t) {
  37716. return this.r = e.r + t.r,
  37717. this.g = e.g + t.g,
  37718. this.b = e.b + t.b,
  37719. this
  37720. },
  37721. addScalar: function(e) {
  37722. return this.r += e,
  37723. this.g += e,
  37724. this.b += e,
  37725. this
  37726. },
  37727. multiply: function(e) {
  37728. return this.r *= e.r,
  37729. this.g *= e.g,
  37730. this.b *= e.b,
  37731. this
  37732. },
  37733. multiplyScalar: function(e) {
  37734. return this.r *= e,
  37735. this.g *= e,
  37736. this.b *= e,
  37737. this
  37738. },
  37739. lerp: function(e, t) {
  37740. return this.r += (e.r - this.r) * t,
  37741. this.g += (e.g - this.g) * t,
  37742. this.b += (e.b - this.b) * t,
  37743. this
  37744. },
  37745. equals: function(e) {
  37746. return e.r === this.r && e.g === this.g && e.b === this.b
  37747. },
  37748. fromArray: function(e, t) {
  37749. return void 0 === t && (t = 0),
  37750. this.r = e[t],
  37751. this.g = e[t + 1],
  37752. this.b = e[t + 2],
  37753. this
  37754. },
  37755. toArray: function(e, t) {
  37756. return void 0 === e && (e = []),
  37757. void 0 === t && (t = 0),
  37758. e[t] = this.r,
  37759. e[t + 1] = this.g,
  37760. e[t + 2] = this.b,
  37761. e
  37762. }
  37763. },
  37764. Ci.ColorKeywords = {
  37765. aliceblue: 15792383,
  37766. antiquewhite: 16444375,
  37767. aqua: 65535,
  37768. aquamarine: 8388564,
  37769. azure: 15794175,
  37770. beige: 16119260,
  37771. bisque: 16770244,
  37772. black: 0,
  37773. blanchedalmond: 16772045,
  37774. blue: 255,
  37775. blueviolet: 9055202,
  37776. brown: 10824234,
  37777. burlywood: 14596231,
  37778. cadetblue: 6266528,
  37779. chartreuse: 8388352,
  37780. chocolate: 13789470,
  37781. coral: 16744272,
  37782. cornflowerblue: 6591981,
  37783. cornsilk: 16775388,
  37784. crimson: 14423100,
  37785. cyan: 65535,
  37786. darkblue: 139,
  37787. darkcyan: 35723,
  37788. darkgoldenrod: 12092939,
  37789. darkgray: 11119017,
  37790. darkgreen: 25600,
  37791. darkgrey: 11119017,
  37792. darkkhaki: 12433259,
  37793. darkmagenta: 9109643,
  37794. darkolivegreen: 5597999,
  37795. darkorange: 16747520,
  37796. darkorchid: 10040012,
  37797. darkred: 9109504,
  37798. darksalmon: 15308410,
  37799. darkseagreen: 9419919,
  37800. darkslateblue: 4734347,
  37801. darkslategray: 3100495,
  37802. darkslategrey: 3100495,
  37803. darkturquoise: 52945,
  37804. darkviolet: 9699539,
  37805. deeppink: 16716947,
  37806. deepskyblue: 49151,
  37807. dimgray: 6908265,
  37808. dimgrey: 6908265,
  37809. dodgerblue: 2003199,
  37810. firebrick: 11674146,
  37811. floralwhite: 16775920,
  37812. forestgreen: 2263842,
  37813. fuchsia: 16711935,
  37814. gainsboro: 14474460,
  37815. ghostwhite: 16316671,
  37816. gold: 16766720,
  37817. goldenrod: 14329120,
  37818. gray: 8421504,
  37819. green: 32768,
  37820. greenyellow: 11403055,
  37821. grey: 8421504,
  37822. honeydew: 15794160,
  37823. hotpink: 16738740,
  37824. indianred: 13458524,
  37825. indigo: 4915330,
  37826. ivory: 16777200,
  37827. khaki: 15787660,
  37828. lavender: 15132410,
  37829. lavenderblush: 16773365,
  37830. lawngreen: 8190976,
  37831. lemonchiffon: 16775885,
  37832. lightblue: 11393254,
  37833. lightcoral: 15761536,
  37834. lightcyan: 14745599,
  37835. lightgoldenrodyellow: 16448210,
  37836. lightgray: 13882323,
  37837. lightgreen: 9498256,
  37838. lightgrey: 13882323,
  37839. lightpink: 16758465,
  37840. lightsalmon: 16752762,
  37841. lightseagreen: 2142890,
  37842. lightskyblue: 8900346,
  37843. lightslategray: 7833753,
  37844. lightslategrey: 7833753,
  37845. lightsteelblue: 11584734,
  37846. lightyellow: 16777184,
  37847. lime: 65280,
  37848. limegreen: 3329330,
  37849. linen: 16445670,
  37850. magenta: 16711935,
  37851. maroon: 8388608,
  37852. mediumaquamarine: 6737322,
  37853. mediumblue: 205,
  37854. mediumorchid: 12211667,
  37855. mediumpurple: 9662683,
  37856. mediumseagreen: 3978097,
  37857. mediumslateblue: 8087790,
  37858. mediumspringgreen: 64154,
  37859. mediumturquoise: 4772300,
  37860. mediumvioletred: 13047173,
  37861. midnightblue: 1644912,
  37862. mintcream: 16121850,
  37863. mistyrose: 16770273,
  37864. moccasin: 16770229,
  37865. navajowhite: 16768685,
  37866. navy: 128,
  37867. oldlace: 16643558,
  37868. olive: 8421376,
  37869. olivedrab: 7048739,
  37870. orange: 16753920,
  37871. orangered: 16729344,
  37872. orchid: 14315734,
  37873. palegoldenrod: 15657130,
  37874. palegreen: 10025880,
  37875. paleturquoise: 11529966,
  37876. palevioletred: 14381203,
  37877. papayawhip: 16773077,
  37878. peachpuff: 16767673,
  37879. peru: 13468991,
  37880. pink: 16761035,
  37881. plum: 14524637,
  37882. powderblue: 11591910,
  37883. purple: 8388736,
  37884. red: 16711680,
  37885. rosybrown: 12357519,
  37886. royalblue: 4286945,
  37887. saddlebrown: 9127187,
  37888. salmon: 16416882,
  37889. sandybrown: 16032864,
  37890. seagreen: 3050327,
  37891. seashell: 16774638,
  37892. sienna: 10506797,
  37893. silver: 12632256,
  37894. skyblue: 8900331,
  37895. slateblue: 6970061,
  37896. slategray: 7372944,
  37897. slategrey: 7372944,
  37898. snow: 16775930,
  37899. springgreen: 65407,
  37900. steelblue: 4620980,
  37901. tan: 13808780,
  37902. teal: 32896,
  37903. thistle: 14204888,
  37904. tomato: 16737095,
  37905. turquoise: 4251856,
  37906. violet: 15631086,
  37907. wheat: 16113331,
  37908. white: 16777215,
  37909. whitesmoke: 16119285,
  37910. yellow: 16776960,
  37911. yellowgreen: 10145074
  37912. },
  37913. Ci.Quaternion = function(e, t, i, n) {
  37914. this._x = e || 0,
  37915. this._y = t || 0,
  37916. this._z = i || 0,
  37917. this._w = void 0 !== n ? n : 1
  37918. }
  37919. ,
  37920. Ci.Quaternion.prototype = {
  37921. constructor: Ci.Quaternion,
  37922. get x() {
  37923. return this._x
  37924. },
  37925. set x(e) {
  37926. this._x = e,
  37927. this.onChangeCallback()
  37928. },
  37929. get y() {
  37930. return this._y
  37931. },
  37932. set y(e) {
  37933. this._y = e,
  37934. this.onChangeCallback()
  37935. },
  37936. get z() {
  37937. return this._z
  37938. },
  37939. set z(e) {
  37940. this._z = e,
  37941. this.onChangeCallback()
  37942. },
  37943. get w() {
  37944. return this._w
  37945. },
  37946. set w(e) {
  37947. this._w = e,
  37948. this.onChangeCallback()
  37949. },
  37950. set: function(e, t, i, n) {
  37951. return this._x = e,
  37952. this._y = t,
  37953. this._z = i,
  37954. this._w = n,
  37955. this.onChangeCallback(),
  37956. this
  37957. },
  37958. clone: function() {
  37959. return new this.constructor(this._x,this._y,this._z,this._w)
  37960. },
  37961. toObject:function(){//add
  37962. return {x:this.x, y:this.y,z:this.z, w:this.w};
  37963. },
  37964. copy: function(e) {
  37965. return this._x = e.x,
  37966. this._y = e.y,
  37967. this._z = e.z,
  37968. this._w = e.w,
  37969. this.onChangeCallback(),
  37970. this
  37971. },
  37972. setFromEuler: function(e, t) {
  37973. if (e instanceof Ci.Euler == 0)
  37974. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37975. var i = Math.cos(e._x / 2)
  37976. , n = Math.cos(e._y / 2)
  37977. , r = Math.cos(e._z / 2)
  37978. , o = Math.sin(e._x / 2)
  37979. , a = Math.sin(e._y / 2)
  37980. , s = Math.sin(e._z / 2)
  37981. , l = e.order;
  37982. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  37983. this._y = i * a * r - o * n * s,
  37984. this._z = i * n * s + o * a * r,
  37985. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  37986. this._y = i * a * r - o * n * s,
  37987. this._z = i * n * s - o * a * r,
  37988. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  37989. this._y = i * a * r + o * n * s,
  37990. this._z = i * n * s + o * a * r,
  37991. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  37992. this._y = i * a * r + o * n * s,
  37993. this._z = i * n * s - o * a * r,
  37994. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  37995. this._y = i * a * r + o * n * s,
  37996. this._z = i * n * s - o * a * r,
  37997. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  37998. this._y = i * a * r - o * n * s,
  37999. this._z = i * n * s + o * a * r,
  38000. this._w = i * n * r + o * a * s),
  38001. !1 !== t && this.onChangeCallback(),
  38002. this
  38003. },
  38004. setFromAxisAngle: function(e, t) {
  38005. var i = t / 2
  38006. , n = Math.sin(i);
  38007. return this._x = e.x * n,
  38008. this._y = e.y * n,
  38009. this._z = e.z * n,
  38010. this._w = Math.cos(i),
  38011. this.onChangeCallback(),
  38012. this
  38013. },
  38014. setFromRotationMatrix: function(e) {
  38015. 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;
  38016. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  38017. this._w = .25 / t,
  38018. this._x = (h - l) * t,
  38019. this._y = (o - c) * t,
  38020. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  38021. this._w = (h - l) / t,
  38022. this._x = .25 * t,
  38023. this._y = (r + a) / t,
  38024. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  38025. this._w = (o - c) / t,
  38026. this._x = (r + a) / t,
  38027. this._y = .25 * t,
  38028. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  38029. this._w = (a - r) / t,
  38030. this._x = (o + c) / t,
  38031. this._y = (l + h) / t,
  38032. this._z = .25 * t),
  38033. this.onChangeCallback(),
  38034. this
  38035. },
  38036. setFromUnitVectors: function(e, t) {
  38037. return void 0 === Be && (Be = new Ci.Vector3),
  38038. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  38039. Math.abs(e.x) > Math.abs(e.z) ? Be.set(-e.y, e.x, 0) : Be.set(0, -e.z, e.y)) : Be.crossVectors(e, t),
  38040. this._x = Be.x,
  38041. this._y = Be.y,
  38042. this._z = Be.z,
  38043. this._w = Ve,
  38044. this.normalize(),
  38045. this
  38046. },
  38047. inverse: function() {
  38048. return this.conjugate().normalize(),
  38049. this
  38050. },
  38051. conjugate: function() {
  38052. return this._x *= -1,
  38053. this._y *= -1,
  38054. this._z *= -1,
  38055. this.onChangeCallback(),
  38056. this
  38057. },
  38058. dot: function(e) {
  38059. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  38060. },
  38061. lengthSq: function() {
  38062. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  38063. },
  38064. length: function() {
  38065. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  38066. },
  38067. normalize: function() {
  38068. var e = this.length();
  38069. return 0 === e ? (this._x = 0,
  38070. this._y = 0,
  38071. this._z = 0,
  38072. this._w = 1) : (e = 1 / e,
  38073. this._x = this._x * e,
  38074. this._y = this._y * e,
  38075. this._z = this._z * e,
  38076. this._w = this._w * e),
  38077. this.onChangeCallback(),
  38078. this
  38079. },
  38080. multiply: function(e, t) {
  38081. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  38082. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  38083. },
  38084. multiplyQuaternions: function(e, t) {
  38085. var i = e._x
  38086. , n = e._y
  38087. , r = e._z
  38088. , o = e._w
  38089. , a = t._x
  38090. , s = t._y
  38091. , l = t._z
  38092. , c = t._w;
  38093. return this._x = i * c + o * a + n * l - r * s,
  38094. this._y = n * c + o * s + r * a - i * l,
  38095. this._z = r * c + o * l + i * s - n * a,
  38096. this._w = o * c - i * a - n * s - r * l,
  38097. this.onChangeCallback(),
  38098. this
  38099. },
  38100. slerp: function(e, t) {
  38101. if (0 === t)
  38102. return this;
  38103. if (1 === t)
  38104. return this.copy(e);
  38105. var i = this._x
  38106. , n = this._y
  38107. , r = this._z
  38108. , o = this._w
  38109. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  38110. if (a < 0 ? (this._w = -e._w,
  38111. this._x = -e._x,
  38112. this._y = -e._y,
  38113. this._z = -e._z,
  38114. a = -a) : this.copy(e),
  38115. 1 <= a)
  38116. return this._w = o,
  38117. this._x = i,
  38118. this._y = n,
  38119. this._z = r,
  38120. this;
  38121. var s = Math.sqrt(1 - a * a);
  38122. if (Math.abs(s) < .001)
  38123. return this._w = .5 * (o + this._w),
  38124. this._x = .5 * (i + this._x),
  38125. this._y = .5 * (n + this._y),
  38126. this._z = .5 * (r + this._z),
  38127. this;
  38128. var l = Math.atan2(s, a)
  38129. , c = Math.sin((1 - t) * l) / s
  38130. , h = Math.sin(t * l) / s;
  38131. return this._w = o * c + this._w * h,
  38132. this._x = i * c + this._x * h,
  38133. this._y = n * c + this._y * h,
  38134. this._z = r * c + this._z * h,
  38135. this.onChangeCallback(),
  38136. this
  38137. },
  38138. equals: function(e) {
  38139. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  38140. },
  38141. fromArray: function(e, t) {
  38142. return void 0 === t && (t = 0),
  38143. this._x = e[t],
  38144. this._y = e[t + 1],
  38145. this._z = e[t + 2],
  38146. this._w = e[t + 3],
  38147. this.onChangeCallback(),
  38148. this
  38149. },
  38150. toArray: function(e, t) {
  38151. return void 0 === e && (e = []),
  38152. void 0 === t && (t = 0),
  38153. e[t] = this._x,
  38154. e[t + 1] = this._y,
  38155. e[t + 2] = this._z,
  38156. e[t + 3] = this._w,
  38157. e
  38158. },
  38159. onChange: function(e) {
  38160. return this.onChangeCallback = e,
  38161. this
  38162. },
  38163. onChangeCallback: function() {}
  38164. },
  38165. Object.assign(Ci.Quaternion, {
  38166. slerp: function(e, t, i, n) {
  38167. return i.copy(e).slerp(t, n)
  38168. },
  38169. slerpFlat: function(e, t, i, n, r, o, a) {
  38170. var s = i[n + 0]
  38171. , l = i[n + 1]
  38172. , c = i[n + 2]
  38173. , h = i[n + 3]
  38174. , u = r[o + 0]
  38175. , d = r[o + 1]
  38176. , p = r[o + 2]
  38177. , f = r[o + 3];
  38178. if (h !== f || s !== u || l !== d || c !== p) {
  38179. var g = 1 - a
  38180. , m = s * u + l * d + c * p + h * f
  38181. , v = 0 <= m ? 1 : -1
  38182. , y = 1 - m * m;
  38183. if (y > Number.EPSILON) {
  38184. var A = Math.sqrt(y)
  38185. , C = Math.atan2(A, m * v);
  38186. g = Math.sin(g * C) / A,
  38187. a = Math.sin(a * C) / A
  38188. }
  38189. var I = a * v;
  38190. if (s = s * g + u * I,
  38191. l = l * g + d * I,
  38192. c = c * g + p * I,
  38193. h = h * g + f * I,
  38194. g === 1 - a) {
  38195. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  38196. s *= E,
  38197. l *= E,
  38198. c *= E,
  38199. h *= E
  38200. }
  38201. }
  38202. e[t] = s,
  38203. e[t + 1] = l,
  38204. e[t + 2] = c,
  38205. e[t + 3] = h
  38206. }
  38207. }),
  38208. Ci.Vector2 = function(e, t) {
  38209. this.x = e || 0,
  38210. this.y = t || 0
  38211. }
  38212. ,
  38213. Ci.Vector2.prototype = {
  38214. constructor: Ci.Vector2,
  38215. get width() {
  38216. return this.x
  38217. },
  38218. set width(e) {
  38219. this.x = e
  38220. },
  38221. get height() {
  38222. return this.y
  38223. },
  38224. set height(e) {
  38225. this.y = e
  38226. },
  38227. set: function(e, t) {
  38228. return this.x = e,
  38229. this.y = t,
  38230. this
  38231. },
  38232. setScalar: function(e) {
  38233. return this.x = e,
  38234. this.y = e,
  38235. this
  38236. },
  38237. setX: function(e) {
  38238. return this.x = e,
  38239. this
  38240. },
  38241. setY: function(e) {
  38242. return this.y = e,
  38243. this
  38244. },
  38245. setComponent: function(e, t) {
  38246. switch (e) {
  38247. case 0:
  38248. this.x = t;
  38249. break;
  38250. case 1:
  38251. this.y = t;
  38252. break;
  38253. default:
  38254. throw new Error("index is out of range: " + e)
  38255. }
  38256. },
  38257. getComponent: function(e) {
  38258. switch (e) {
  38259. case 0:
  38260. return this.x;
  38261. case 1:
  38262. return this.y;
  38263. default:
  38264. throw new Error("index is out of range: " + e)
  38265. }
  38266. },
  38267. clone: function() {
  38268. return new this.constructor(this.x,this.y)
  38269. },
  38270. copy: function(e) {
  38271. return this.x = e.x,
  38272. this.y = e.y,
  38273. this
  38274. },
  38275. add: function(e, t) {
  38276. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38277. this.addVectors(e, t)) : (this.x += e.x,
  38278. this.y += e.y,
  38279. this)
  38280. },
  38281. addScalar: function(e) {
  38282. return this.x += e,
  38283. this.y += e,
  38284. this
  38285. },
  38286. addVectors: function(e, t) {
  38287. return this.x = e.x + t.x,
  38288. this.y = e.y + t.y,
  38289. this
  38290. },
  38291. addScaledVector: function(e, t) {
  38292. return this.x += e.x * t,
  38293. this.y += e.y * t,
  38294. this
  38295. },
  38296. sub: function(e, t) {
  38297. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38298. this.subVectors(e, t)) : (this.x -= e.x,
  38299. this.y -= e.y,
  38300. this)
  38301. },
  38302. subScalar: function(e) {
  38303. return this.x -= e,
  38304. this.y -= e,
  38305. this
  38306. },
  38307. subVectors: function(e, t) {
  38308. return this.x = e.x - t.x,
  38309. this.y = e.y - t.y,
  38310. this
  38311. },
  38312. multiply: function(e) {
  38313. return this.x *= e.x,
  38314. this.y *= e.y,
  38315. this
  38316. },
  38317. multiplyScalar: function(e) {
  38318. return isFinite(e) ? (this.x *= e,
  38319. this.y *= e) : (this.x = 0,
  38320. this.y = 0),
  38321. this
  38322. },
  38323. divide: function(e) {
  38324. return this.x /= e.x,
  38325. this.y /= e.y,
  38326. this
  38327. },
  38328. divideScalar: function(e) {
  38329. return this.multiplyScalar(1 / e)
  38330. },
  38331. min: function(e) {
  38332. return this.x = Math.min(this.x, e.x),
  38333. this.y = Math.min(this.y, e.y),
  38334. this
  38335. },
  38336. max: function(e) {
  38337. return this.x = Math.max(this.x, e.x),
  38338. this.y = Math.max(this.y, e.y),
  38339. this
  38340. },
  38341. clamp: function(e, t) {
  38342. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38343. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38344. this
  38345. },
  38346. clampScalar: function(e, t) {
  38347. return void 0 === Ne && (Ne = new Ci.Vector2,
  38348. Fe = new Ci.Vector2),
  38349. Ne.set(e, e),
  38350. Fe.set(t, t),
  38351. this.clamp(Ne, Fe)
  38352. },
  38353. clampLength: function(e, t) {
  38354. var i = this.length();
  38355. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38356. this
  38357. },
  38358. floor: function() {
  38359. return this.x = Math.floor(this.x),
  38360. this.y = Math.floor(this.y),
  38361. this
  38362. },
  38363. ceil: function() {
  38364. return this.x = Math.ceil(this.x),
  38365. this.y = Math.ceil(this.y),
  38366. this
  38367. },
  38368. round: function() {
  38369. return this.x = Math.round(this.x),
  38370. this.y = Math.round(this.y),
  38371. this
  38372. },
  38373. roundToZero: function() {
  38374. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38375. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38376. this
  38377. },
  38378. negate: function() {
  38379. return this.x = -this.x,
  38380. this.y = -this.y,
  38381. this
  38382. },
  38383. dot: function(e) {
  38384. return this.x * e.x + this.y * e.y
  38385. },
  38386. lengthSq: function() {
  38387. return this.x * this.x + this.y * this.y
  38388. },
  38389. length: function() {
  38390. return Math.sqrt(this.x * this.x + this.y * this.y)
  38391. },
  38392. lengthManhattan: function() {
  38393. return Math.abs(this.x) + Math.abs(this.y)
  38394. },
  38395. normalize: function() {
  38396. return this.divideScalar(this.length())
  38397. },
  38398. angle: function() {
  38399. var e = Math.atan2(this.y, this.x);
  38400. return e < 0 && (e += 2 * Math.PI),
  38401. e
  38402. },
  38403. distanceTo: function(e) {
  38404. return Math.sqrt(this.distanceToSquared(e))
  38405. },
  38406. distanceToSquared: function(e) {
  38407. var t = this.x - e.x
  38408. , i = this.y - e.y;
  38409. return t * t + i * i
  38410. },
  38411. setLength: function(e) {
  38412. return this.multiplyScalar(e / this.length())
  38413. },
  38414. lerp: function(e, t) {
  38415. return this.x += (e.x - this.x) * t,
  38416. this.y += (e.y - this.y) * t,
  38417. this
  38418. },
  38419. lerpVectors: function(e, t, i) {
  38420. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38421. this
  38422. },
  38423. equals: function(e) {
  38424. return e.x === this.x && e.y === this.y
  38425. },
  38426. fromArray: function(e, t) {
  38427. return void 0 === t && (t = 0),
  38428. this.x = e[t],
  38429. this.y = e[t + 1],
  38430. this
  38431. },
  38432. toArray: function(e, t) {
  38433. return void 0 === e && (e = []),
  38434. void 0 === t && (t = 0),
  38435. e[t] = this.x,
  38436. e[t + 1] = this.y,
  38437. e
  38438. },
  38439. fromAttribute: function(e, t, i) {
  38440. return void 0 === i && (i = 0),
  38441. t = t * e.itemSize + i,
  38442. this.x = e.array[t],
  38443. this.y = e.array[t + 1],
  38444. this
  38445. },
  38446. rotateAround: function(e, t) {
  38447. var i = Math.cos(t)
  38448. , n = Math.sin(t)
  38449. , r = this.x - e.x
  38450. , o = this.y - e.y;
  38451. return this.x = r * i - o * n + e.x,
  38452. this.y = r * n + o * i + e.y,
  38453. this
  38454. }
  38455. },
  38456. Ci.Vector3 = function(e, t, i) {
  38457. this.x = e || 0,
  38458. this.y = t || 0,
  38459. this.z = i || 0
  38460. }
  38461. ,
  38462. Ci.Vector3.prototype = {
  38463. constructor: Ci.Vector3,
  38464. set: function(e, t, i) {
  38465. return this.x = e,
  38466. this.y = t,
  38467. this.z = i,
  38468. this
  38469. },
  38470. setScalar: function(e) {
  38471. return this.x = e,
  38472. this.y = e,
  38473. this.z = e,
  38474. this
  38475. },
  38476. setX: function(e) {
  38477. return this.x = e,
  38478. this
  38479. },
  38480. setY: function(e) {
  38481. return this.y = e,
  38482. this
  38483. },
  38484. setZ: function(e) {
  38485. return this.z = e,
  38486. this
  38487. },
  38488. setComponent: function(e, t) {
  38489. switch (e) {
  38490. case 0:
  38491. this.x = t;
  38492. break;
  38493. case 1:
  38494. this.y = t;
  38495. break;
  38496. case 2:
  38497. this.z = t;
  38498. break;
  38499. default:
  38500. throw new Error("index is out of range: " + e)
  38501. }
  38502. },
  38503. getComponent: function(e) {
  38504. switch (e) {
  38505. case 0:
  38506. return this.x;
  38507. case 1:
  38508. return this.y;
  38509. case 2:
  38510. return this.z;
  38511. default:
  38512. throw new Error("index is out of range: " + e)
  38513. }
  38514. },
  38515. clone: function() {
  38516. return new this.constructor(this.x,this.y,this.z)
  38517. },
  38518. copy: function(e) {
  38519. return this.x = e.x,
  38520. this.y = e.y,
  38521. this.z = e.z,
  38522. this
  38523. },
  38524. add: function(e, t) {
  38525. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38526. this.addVectors(e, t)) : (this.x += e.x,
  38527. this.y += e.y,
  38528. this.z += e.z,
  38529. this)
  38530. },
  38531. addScalar: function(e) {
  38532. return this.x += e,
  38533. this.y += e,
  38534. this.z += e,
  38535. this
  38536. },
  38537. addVectors: function(e, t) {
  38538. return this.x = e.x + t.x,
  38539. this.y = e.y + t.y,
  38540. this.z = e.z + t.z,
  38541. this
  38542. },
  38543. addScaledVector: function(e, t) {
  38544. return this.x += e.x * t,
  38545. this.y += e.y * t,
  38546. this.z += e.z * t,
  38547. this
  38548. },
  38549. sub: function(e, t) {
  38550. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38551. this.subVectors(e, t)) : (this.x -= e.x,
  38552. this.y -= e.y,
  38553. this.z -= e.z,
  38554. this)
  38555. },
  38556. subScalar: function(e) {
  38557. return this.x -= e,
  38558. this.y -= e,
  38559. this.z -= e,
  38560. this
  38561. },
  38562. subVectors: function(e, t) {
  38563. return this.x = e.x - t.x,
  38564. this.y = e.y - t.y,
  38565. this.z = e.z - t.z,
  38566. this
  38567. },
  38568. multiply: function(e, t) {
  38569. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  38570. this.multiplyVectors(e, t)) : (this.x *= e.x,
  38571. this.y *= e.y,
  38572. this.z *= e.z,
  38573. this)
  38574. },
  38575. multiplyScalar: function(e) {
  38576. return isFinite(e) ? (this.x *= e,
  38577. this.y *= e,
  38578. this.z *= e) : (this.x = 0,
  38579. this.y = 0,
  38580. this.z = 0),
  38581. this
  38582. },
  38583. multiplyVectors: function(e, t) {
  38584. return this.x = e.x * t.x,
  38585. this.y = e.y * t.y,
  38586. this.z = e.z * t.z,
  38587. this
  38588. },
  38589. applyEuler: function(e) {
  38590. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38591. void 0 === De && (De = new Ci.Quaternion),
  38592. this.applyQuaternion(De.setFromEuler(e)),
  38593. this
  38594. },
  38595. applyAxisAngle: function(e, t) {
  38596. return void 0 === Le && (Le = new Ci.Quaternion),
  38597. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  38598. this
  38599. },
  38600. applyMatrix3: function(e) {
  38601. var t = this.x
  38602. , i = this.y
  38603. , n = this.z
  38604. , r = e.elements;
  38605. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38606. this.y = r[1] * t + r[4] * i + r[7] * n,
  38607. this.z = r[2] * t + r[5] * i + r[8] * n,
  38608. this
  38609. },
  38610. applyMatrix4: function(e) {
  38611. var t = this.x
  38612. , i = this.y
  38613. , n = this.z
  38614. , r = e.elements;
  38615. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38616. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38617. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38618. this
  38619. },
  38620. applyProjection: function(e) {
  38621. var t = this.x
  38622. , i = this.y
  38623. , n = this.z
  38624. , r = e.elements
  38625. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38626. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38627. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38628. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38629. this
  38630. },
  38631. applyQuaternion: function(e) {
  38632. var t = this.x
  38633. , i = this.y
  38634. , n = this.z
  38635. , r = e.x
  38636. , o = e.y
  38637. , a = e.z
  38638. , s = e.w
  38639. , l = s * t + o * n - a * i
  38640. , c = s * i + a * t - r * n
  38641. , h = s * n + r * i - o * t
  38642. , u = -r * t - o * i - a * n;
  38643. return this.x = l * s + u * -r + c * -a - h * -o,
  38644. this.y = c * s + u * -o + h * -r - l * -a,
  38645. this.z = h * s + u * -a + l * -o - c * -r,
  38646. this
  38647. },
  38648. project: function(e) {
  38649. return void 0 === Oe && (Oe = new Ci.Matrix4),
  38650. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  38651. this.applyProjection(Oe)
  38652. },
  38653. unproject: function(e) {
  38654. return void 0 === Pe && (Pe = new Ci.Matrix4),
  38655. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  38656. this.applyProjection(Pe)
  38657. },
  38658. transformDirection: function(e) {
  38659. var t = this.x
  38660. , i = this.y
  38661. , n = this.z
  38662. , r = e.elements;
  38663. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38664. this.y = r[1] * t + r[5] * i + r[9] * n,
  38665. this.z = r[2] * t + r[6] * i + r[10] * n,
  38666. this.normalize(),
  38667. this
  38668. },
  38669. divide: function(e) {
  38670. return this.x /= e.x,
  38671. this.y /= e.y,
  38672. this.z /= e.z,
  38673. this
  38674. },
  38675. divideScalar: function(e) {
  38676. return this.multiplyScalar(1 / e)
  38677. },
  38678. min: function(e) {
  38679. return this.x = Math.min(this.x, e.x),
  38680. this.y = Math.min(this.y, e.y),
  38681. this.z = Math.min(this.z, e.z),
  38682. this
  38683. },
  38684. max: function(e) {
  38685. return this.x = Math.max(this.x, e.x),
  38686. this.y = Math.max(this.y, e.y),
  38687. this.z = Math.max(this.z, e.z),
  38688. this
  38689. },
  38690. clamp: function(e, t) {
  38691. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38692. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38693. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38694. this
  38695. },
  38696. clampScalar: function(e, t) {
  38697. return void 0 === Me && (Me = new Ci.Vector3,
  38698. Re = new Ci.Vector3),
  38699. Me.set(e, e, e),
  38700. Re.set(t, t, t),
  38701. this.clamp(Me, Re)
  38702. },
  38703. clampLength: function(e, t) {
  38704. var i = this.length();
  38705. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38706. this
  38707. },
  38708. floor: function() {
  38709. return this.x = Math.floor(this.x),
  38710. this.y = Math.floor(this.y),
  38711. this.z = Math.floor(this.z),
  38712. this
  38713. },
  38714. ceil: function() {
  38715. return this.x = Math.ceil(this.x),
  38716. this.y = Math.ceil(this.y),
  38717. this.z = Math.ceil(this.z),
  38718. this
  38719. },
  38720. round: function() {
  38721. return this.x = Math.round(this.x),
  38722. this.y = Math.round(this.y),
  38723. this.z = Math.round(this.z),
  38724. this
  38725. },
  38726. roundToZero: function() {
  38727. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38728. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38729. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38730. this
  38731. },
  38732. negate: function() {
  38733. return this.x = -this.x,
  38734. this.y = -this.y,
  38735. this.z = -this.z,
  38736. this
  38737. },
  38738. dot: function(e) {
  38739. return this.x * e.x + this.y * e.y + this.z * e.z
  38740. },
  38741. lengthSq: function() {
  38742. return this.x * this.x + this.y * this.y + this.z * this.z
  38743. },
  38744. length: function() {
  38745. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38746. },
  38747. lengthManhattan: function() {
  38748. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38749. },
  38750. normalize: function() {
  38751. return this.divideScalar(this.length())
  38752. },
  38753. setLength: function(e) {
  38754. return this.multiplyScalar(e / this.length())
  38755. },
  38756. lerp: function(e, t) {
  38757. return this.x += (e.x - this.x) * t,
  38758. this.y += (e.y - this.y) * t,
  38759. this.z += (e.z - this.z) * t,
  38760. this
  38761. },
  38762. lerpVectors: function(e, t, i) {
  38763. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38764. this
  38765. },
  38766. cross: function(e, t) {
  38767. if (void 0 !== t)
  38768. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38769. this.crossVectors(e, t);
  38770. var i = this.x
  38771. , n = this.y
  38772. , r = this.z;
  38773. return this.x = n * e.z - r * e.y,
  38774. this.y = r * e.x - i * e.z,
  38775. this.z = i * e.y - n * e.x,
  38776. this
  38777. },
  38778. crossVectors: function(e, t) {
  38779. var i = e.x
  38780. , n = e.y
  38781. , r = e.z
  38782. , o = t.x
  38783. , a = t.y
  38784. , s = t.z;
  38785. return this.x = n * s - r * a,
  38786. this.y = r * o - i * s,
  38787. this.z = i * a - n * o,
  38788. this
  38789. },
  38790. projectOnVector: function(e) {
  38791. return void 0 === xe && (xe = new Ci.Vector3),
  38792. xe.copy(e).normalize(),
  38793. Se = this.dot(xe),
  38794. this.copy(xe).multiplyScalar(Se)
  38795. },
  38796. projectOnPlane: function(e) {
  38797. return void 0 === Te && (Te = new Ci.Vector3),
  38798. Te.copy(this).projectOnVector(e),
  38799. this.sub(Te)
  38800. },
  38801. reflect: function(e) {
  38802. return void 0 === we && (we = new Ci.Vector3),
  38803. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38804. },
  38805. angleTo: function(e) {
  38806. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38807. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38808. },
  38809. distanceTo: function(e) {
  38810. return Math.sqrt(this.distanceToSquared(e))
  38811. },
  38812. distanceToSquared: function(e) {
  38813. var t = this.x - e.x
  38814. , i = this.y - e.y
  38815. , n = this.z - e.z;
  38816. return t * t + i * i + n * n
  38817. },
  38818. setFromSpherical: function(e) {
  38819. var t = Math.sin(e.phi) * e.radius;
  38820. return this.x = t * Math.sin(e.theta),
  38821. this.y = Math.cos(e.phi) * e.radius,
  38822. this.z = t * Math.cos(e.theta),
  38823. this
  38824. },
  38825. setFromMatrixPosition: function(e) {
  38826. return this.setFromMatrixColumn(e, 3)
  38827. },
  38828. setFromMatrixScale: function(e) {
  38829. var t = this.setFromMatrixColumn(e, 0).length()
  38830. , i = this.setFromMatrixColumn(e, 1).length()
  38831. , n = this.setFromMatrixColumn(e, 2).length();
  38832. return this.x = t,
  38833. this.y = i,
  38834. this.z = n,
  38835. this
  38836. },
  38837. setFromMatrixColumn: function(e, t) {
  38838. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38839. t = e = t),
  38840. this.fromArray(e.elements, 4 * t)
  38841. },
  38842. equals: function(e) {
  38843. return e.x === this.x && e.y === this.y && e.z === this.z
  38844. },
  38845. fromArray: function(e, t) {
  38846. return void 0 === t && (t = 0),
  38847. this.x = e[t],
  38848. this.y = e[t + 1],
  38849. this.z = e[t + 2],
  38850. this
  38851. },
  38852. toArray: function(e, t) {
  38853. return void 0 === e && (e = []),
  38854. void 0 === t && (t = 0),
  38855. e[t] = this.x,
  38856. e[t + 1] = this.y,
  38857. e[t + 2] = this.z,
  38858. e
  38859. },
  38860. fromAttribute: function(e, t, i) {
  38861. return void 0 === i && (i = 0),
  38862. t = t * e.itemSize + i,
  38863. this.x = e.array[t],
  38864. this.y = e.array[t + 1],
  38865. this.z = e.array[t + 2],
  38866. this
  38867. }
  38868. },
  38869. Ci.Vector4 = function(e, t, i, n) {
  38870. this.x = e || 0,
  38871. this.y = t || 0,
  38872. this.z = i || 0,
  38873. this.w = void 0 !== n ? n : 1
  38874. }
  38875. ,
  38876. Ci.Vector4.prototype = {
  38877. constructor: Ci.Vector4,
  38878. set: function(e, t, i, n) {
  38879. return this.x = e,
  38880. this.y = t,
  38881. this.z = i,
  38882. this.w = n,
  38883. this
  38884. },
  38885. setScalar: function(e) {
  38886. return this.x = e,
  38887. this.y = e,
  38888. this.z = e,
  38889. this.w = e,
  38890. this
  38891. },
  38892. setX: function(e) {
  38893. return this.x = e,
  38894. this
  38895. },
  38896. setY: function(e) {
  38897. return this.y = e,
  38898. this
  38899. },
  38900. setZ: function(e) {
  38901. return this.z = e,
  38902. this
  38903. },
  38904. setW: function(e) {
  38905. return this.w = e,
  38906. this
  38907. },
  38908. setComponent: function(e, t) {
  38909. switch (e) {
  38910. case 0:
  38911. this.x = t;
  38912. break;
  38913. case 1:
  38914. this.y = t;
  38915. break;
  38916. case 2:
  38917. this.z = t;
  38918. break;
  38919. case 3:
  38920. this.w = t;
  38921. break;
  38922. default:
  38923. throw new Error("index is out of range: " + e)
  38924. }
  38925. },
  38926. getComponent: function(e) {
  38927. switch (e) {
  38928. case 0:
  38929. return this.x;
  38930. case 1:
  38931. return this.y;
  38932. case 2:
  38933. return this.z;
  38934. case 3:
  38935. return this.w;
  38936. default:
  38937. throw new Error("index is out of range: " + e)
  38938. }
  38939. },
  38940. clone: function() {
  38941. return new this.constructor(this.x,this.y,this.z,this.w)
  38942. },
  38943. copy: function(e) {
  38944. return this.x = e.x,
  38945. this.y = e.y,
  38946. this.z = e.z,
  38947. this.w = void 0 !== e.w ? e.w : 1,
  38948. this
  38949. },
  38950. add: function(e, t) {
  38951. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38952. this.addVectors(e, t)) : (this.x += e.x,
  38953. this.y += e.y,
  38954. this.z += e.z,
  38955. this.w += e.w,
  38956. this)
  38957. },
  38958. addScalar: function(e) {
  38959. return this.x += e,
  38960. this.y += e,
  38961. this.z += e,
  38962. this.w += e,
  38963. this
  38964. },
  38965. addVectors: function(e, t) {
  38966. return this.x = e.x + t.x,
  38967. this.y = e.y + t.y,
  38968. this.z = e.z + t.z,
  38969. this.w = e.w + t.w,
  38970. this
  38971. },
  38972. addScaledVector: function(e, t) {
  38973. return this.x += e.x * t,
  38974. this.y += e.y * t,
  38975. this.z += e.z * t,
  38976. this.w += e.w * t,
  38977. this
  38978. },
  38979. sub: function(e, t) {
  38980. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38981. this.subVectors(e, t)) : (this.x -= e.x,
  38982. this.y -= e.y,
  38983. this.z -= e.z,
  38984. this.w -= e.w,
  38985. this)
  38986. },
  38987. subScalar: function(e) {
  38988. return this.x -= e,
  38989. this.y -= e,
  38990. this.z -= e,
  38991. this.w -= e,
  38992. this
  38993. },
  38994. subVectors: function(e, t) {
  38995. return this.x = e.x - t.x,
  38996. this.y = e.y - t.y,
  38997. this.z = e.z - t.z,
  38998. this.w = e.w - t.w,
  38999. this
  39000. },
  39001. multiplyScalar: function(e) {
  39002. return isFinite(e) ? (this.x *= e,
  39003. this.y *= e,
  39004. this.z *= e,
  39005. this.w *= e) : (this.x = 0,
  39006. this.y = 0,
  39007. this.z = 0,
  39008. this.w = 0),
  39009. this
  39010. },
  39011. applyMatrix4: function(e) {
  39012. var t = this.x
  39013. , i = this.y
  39014. , n = this.z
  39015. , r = this.w
  39016. , o = e.elements;
  39017. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  39018. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  39019. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  39020. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  39021. this
  39022. },
  39023. divideScalar: function(e) {
  39024. return this.multiplyScalar(1 / e)
  39025. },
  39026. setAxisAngleFromQuaternion: function(e) {
  39027. this.w = 2 * Math.acos(e.w);
  39028. var t = Math.sqrt(1 - e.w * e.w);
  39029. return t < 1e-4 ? (this.x = 1,
  39030. this.y = 0,
  39031. this.z = 0) : (this.x = e.x / t,
  39032. this.y = e.y / t,
  39033. this.z = e.z / t),
  39034. this
  39035. },
  39036. setAxisAngleFromRotationMatrix: function(e) {
  39037. var t, i, n, r, o = e.elements, a = o[0], s = o[4], l = o[8], c = o[1], h = o[5], u = o[9], d = o[2], p = o[6], f = o[10];
  39038. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  39039. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  39040. return this.set(1, 0, 0, 0),
  39041. this;
  39042. t = Math.PI;
  39043. var g = (a + 1) / 2
  39044. , m = (h + 1) / 2
  39045. , v = (f + 1) / 2
  39046. , y = (s + c) / 4
  39047. , A = (l + d) / 4
  39048. , C = (u + p) / 4;
  39049. return m < g && v < g ? r = g < .01 ? (i = 0,
  39050. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  39051. A / i) : v < m ? r = m < .01 ? (n = 0,
  39052. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  39053. C / n) : v < .01 ? (n = i = .707106781,
  39054. r = 0) : (i = A / (r = Math.sqrt(v)),
  39055. n = C / r),
  39056. this.set(i, n, r, t),
  39057. this
  39058. }
  39059. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  39060. return Math.abs(I) < .001 && (I = 1),
  39061. this.x = (p - u) / I,
  39062. this.y = (l - d) / I,
  39063. this.z = (c - s) / I,
  39064. this.w = Math.acos((a + h + f - 1) / 2),
  39065. this
  39066. },
  39067. min: function(e) {
  39068. return this.x = Math.min(this.x, e.x),
  39069. this.y = Math.min(this.y, e.y),
  39070. this.z = Math.min(this.z, e.z),
  39071. this.w = Math.min(this.w, e.w),
  39072. this
  39073. },
  39074. max: function(e) {
  39075. return this.x = Math.max(this.x, e.x),
  39076. this.y = Math.max(this.y, e.y),
  39077. this.z = Math.max(this.z, e.z),
  39078. this.w = Math.max(this.w, e.w),
  39079. this
  39080. },
  39081. clamp: function(e, t) {
  39082. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  39083. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  39084. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  39085. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  39086. this
  39087. },
  39088. clampScalar: function(e, t) {
  39089. return void 0 === _e && (_e = new Ci.Vector4,
  39090. be = new Ci.Vector4),
  39091. _e.set(e, e, e, e),
  39092. be.set(t, t, t, t),
  39093. this.clamp(_e, be)
  39094. },
  39095. floor: function() {
  39096. return this.x = Math.floor(this.x),
  39097. this.y = Math.floor(this.y),
  39098. this.z = Math.floor(this.z),
  39099. this.w = Math.floor(this.w),
  39100. this
  39101. },
  39102. ceil: function() {
  39103. return this.x = Math.ceil(this.x),
  39104. this.y = Math.ceil(this.y),
  39105. this.z = Math.ceil(this.z),
  39106. this.w = Math.ceil(this.w),
  39107. this
  39108. },
  39109. round: function() {
  39110. return this.x = Math.round(this.x),
  39111. this.y = Math.round(this.y),
  39112. this.z = Math.round(this.z),
  39113. this.w = Math.round(this.w),
  39114. this
  39115. },
  39116. roundToZero: function() {
  39117. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  39118. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  39119. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  39120. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  39121. this
  39122. },
  39123. negate: function() {
  39124. return this.x = -this.x,
  39125. this.y = -this.y,
  39126. this.z = -this.z,
  39127. this.w = -this.w,
  39128. this
  39129. },
  39130. dot: function(e) {
  39131. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  39132. },
  39133. lengthSq: function() {
  39134. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  39135. },
  39136. length: function() {
  39137. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  39138. },
  39139. lengthManhattan: function() {
  39140. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  39141. },
  39142. normalize: function() {
  39143. return this.divideScalar(this.length())
  39144. },
  39145. setLength: function(e) {
  39146. return this.multiplyScalar(e / this.length())
  39147. },
  39148. lerp: function(e, t) {
  39149. return this.x += (e.x - this.x) * t,
  39150. this.y += (e.y - this.y) * t,
  39151. this.z += (e.z - this.z) * t,
  39152. this.w += (e.w - this.w) * t,
  39153. this
  39154. },
  39155. lerpVectors: function(e, t, i) {
  39156. return this.subVectors(t, e).multiplyScalar(i).add(e),
  39157. this
  39158. },
  39159. equals: function(e) {
  39160. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  39161. },
  39162. fromArray: function(e, t) {
  39163. return void 0 === t && (t = 0),
  39164. this.x = e[t],
  39165. this.y = e[t + 1],
  39166. this.z = e[t + 2],
  39167. this.w = e[t + 3],
  39168. this
  39169. },
  39170. toArray: function(e, t) {
  39171. return void 0 === e && (e = []),
  39172. void 0 === t && (t = 0),
  39173. e[t] = this.x,
  39174. e[t + 1] = this.y,
  39175. e[t + 2] = this.z,
  39176. e[t + 3] = this.w,
  39177. e
  39178. },
  39179. fromAttribute: function(e, t, i) {
  39180. return void 0 === i && (i = 0),
  39181. t = t * e.itemSize + i,
  39182. this.x = e.array[t],
  39183. this.y = e.array[t + 1],
  39184. this.z = e.array[t + 2],
  39185. this.w = e.array[t + 3],
  39186. this
  39187. }
  39188. },
  39189. Ci.Euler = function(e, t, i, n) {
  39190. this._x = e || 0,
  39191. this._y = t || 0,
  39192. this._z = i || 0,
  39193. this._order = n || Ci.Euler.DefaultOrder
  39194. }
  39195. ,
  39196. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  39197. Ci.Euler.DefaultOrder = "XYZ",
  39198. Ci.Euler.prototype = {
  39199. constructor: Ci.Euler,
  39200. get x() {
  39201. return this._x
  39202. },
  39203. set x(e) {
  39204. this._x = e,
  39205. this.onChangeCallback()
  39206. },
  39207. get y() {
  39208. return this._y
  39209. },
  39210. set y(e) {
  39211. this._y = e,
  39212. this.onChangeCallback()
  39213. },
  39214. get z() {
  39215. return this._z
  39216. },
  39217. set z(e) {
  39218. this._z = e,
  39219. this.onChangeCallback()
  39220. },
  39221. get order() {
  39222. return this._order
  39223. },
  39224. set order(e) {
  39225. this._order = e,
  39226. this.onChangeCallback()
  39227. },
  39228. set: function(e, t, i, n) {
  39229. return this._x = e,
  39230. this._y = t,
  39231. this._z = i,
  39232. this._order = n || this._order,
  39233. this.onChangeCallback(),
  39234. this
  39235. },
  39236. clone: function() {
  39237. return new this.constructor(this._x,this._y,this._z,this._order)
  39238. },
  39239. copy: function(e) {
  39240. return this._x = e._x,
  39241. this._y = e._y,
  39242. this._z = e._z,
  39243. this._order = e._order,
  39244. this.onChangeCallback(),
  39245. this
  39246. },
  39247. toObject: function() {//xzw
  39248. return {x:this.x,y:this.y,z:this.z}
  39249. },
  39250. setFromRotationMatrix: function(e, t, i) {
  39251. var n = Ci.Math.clamp
  39252. , r = e.elements
  39253. , o = r[0]
  39254. , a = r[4]
  39255. , s = r[8]
  39256. , l = r[1]
  39257. , c = r[5]
  39258. , h = r[9]
  39259. , u = r[2]
  39260. , d = r[6]
  39261. , p = r[10];
  39262. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  39263. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  39264. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  39265. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  39266. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  39267. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  39268. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  39269. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  39270. this._z = Math.atan2(-a, c)) : (this._y = 0,
  39271. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  39272. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  39273. this._z = Math.atan2(l, o)) : (this._x = 0,
  39274. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  39275. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  39276. this._y = Math.atan2(-u, o)) : (this._x = 0,
  39277. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  39278. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  39279. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  39280. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  39281. this._order = t,
  39282. !1 !== i && this.onChangeCallback(),
  39283. this
  39284. },
  39285. setFromQuaternion: function(e, t, i) {
  39286. return void 0 === Ee && (Ee = new Ci.Matrix4),
  39287. Ee.makeRotationFromQuaternion(e),
  39288. this.setFromRotationMatrix(Ee, t, i),
  39289. this
  39290. },
  39291. setFromVector3: function(e, t) {
  39292. return this.set(e.x, e.y, e.z, t || this._order)
  39293. },
  39294. reorder: (Ie = new Ci.Quaternion,
  39295. function(e) {
  39296. Ie.setFromEuler(this),
  39297. this.setFromQuaternion(Ie, e)
  39298. }
  39299. ),
  39300. equals: function(e) {
  39301. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  39302. },
  39303. fromArray: function(e) {
  39304. return this._x = e[0],
  39305. this._y = e[1],
  39306. this._z = e[2],
  39307. void 0 !== e[3] && (this._order = e[3]),
  39308. this.onChangeCallback(),
  39309. this
  39310. },
  39311. toArray: function(e, t) {
  39312. return void 0 === e && (e = []),
  39313. void 0 === t && (t = 0),
  39314. e[t] = this._x,
  39315. e[t + 1] = this._y,
  39316. e[t + 2] = this._z,
  39317. e[t + 3] = this._order,
  39318. e
  39319. },
  39320. toVector3: function(e) {
  39321. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  39322. },
  39323. onChange: function(e) {
  39324. return this.onChangeCallback = e,
  39325. this
  39326. },
  39327. onChangeCallback: function() {}
  39328. },
  39329. Ci.Line3 = function(e, t) {
  39330. this.start = void 0 !== e ? e : new Ci.Vector3,
  39331. this.end = void 0 !== t ? t : new Ci.Vector3
  39332. }
  39333. ,
  39334. Ci.Line3.prototype = {
  39335. constructor: Ci.Line3,
  39336. set: function(e, t) {
  39337. return this.start.copy(e),
  39338. this.end.copy(t),
  39339. this
  39340. },
  39341. clone: function() {
  39342. return (new this.constructor).copy(this)
  39343. },
  39344. copy: function(e) {
  39345. return this.start.copy(e.start),
  39346. this.end.copy(e.end),
  39347. this
  39348. },
  39349. center: function(e) {
  39350. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  39351. },
  39352. delta: function(e) {
  39353. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  39354. },
  39355. distanceSq: function() {
  39356. return this.start.distanceToSquared(this.end)
  39357. },
  39358. distance: function() {
  39359. return this.start.distanceTo(this.end)
  39360. },
  39361. at: function(e, t) {
  39362. var i = t || new Ci.Vector3;
  39363. return this.delta(i).multiplyScalar(e).add(this.start)
  39364. },
  39365. closestPointToPointParameter: (Ae = new Ci.Vector3,
  39366. Ce = new Ci.Vector3,
  39367. function(e, t) {
  39368. Ae.subVectors(e, this.start),
  39369. Ce.subVectors(this.end, this.start);
  39370. var i = Ce.dot(Ce)
  39371. , n = Ce.dot(Ae) / i;
  39372. return t && (n = Ci.Math.clamp(n, 0, 1)),
  39373. n
  39374. }
  39375. ),
  39376. closestPointToPoint: function(e, t, i) {
  39377. var n = this.closestPointToPointParameter(e, t)
  39378. , r = i || new Ci.Vector3;
  39379. return this.delta(r).multiplyScalar(n).add(this.start)
  39380. },
  39381. applyMatrix4: function(e) {
  39382. return this.start.applyMatrix4(e),
  39383. this.end.applyMatrix4(e),
  39384. this
  39385. },
  39386. equals: function(e) {
  39387. return e.start.equals(this.start) && e.end.equals(this.end)
  39388. }
  39389. },
  39390. Ci.Box2 = function(e, t) {
  39391. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  39392. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  39393. }
  39394. ,
  39395. Ci.Box2.prototype = {
  39396. constructor: Ci.Box2,
  39397. set: function(e, t) {
  39398. return this.min.copy(e),
  39399. this.max.copy(t),
  39400. this
  39401. },
  39402. setFromPoints: function(e) {
  39403. this.makeEmpty();
  39404. for (var t = 0, i = e.length; t < i; t++)
  39405. this.expandByPoint(e[t]);
  39406. return this
  39407. },
  39408. setFromCenterAndSize: (ye = new Ci.Vector2,
  39409. function(e, t) {
  39410. var i = ye.copy(t).multiplyScalar(.5);
  39411. return this.min.copy(e).sub(i),
  39412. this.max.copy(e).add(i),
  39413. this
  39414. }
  39415. ),
  39416. clone: function() {
  39417. return (new this.constructor).copy(this)
  39418. },
  39419. copy: function(e) {
  39420. return this.min.copy(e.min),
  39421. this.max.copy(e.max),
  39422. this
  39423. },
  39424. makeEmpty: function() {
  39425. return this.min.x = this.min.y = 1 / 0,
  39426. this.max.x = this.max.y = -1 / 0,
  39427. this
  39428. },
  39429. isEmpty: function() {
  39430. return this.max.x < this.min.x || this.max.y < this.min.y
  39431. },
  39432. center: function(e) {
  39433. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  39434. },
  39435. size: function(e) {
  39436. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  39437. },
  39438. expandByPoint: function(e) {
  39439. return this.min.min(e),
  39440. this.max.max(e),
  39441. this
  39442. },
  39443. expandByVector: function(e) {
  39444. return this.min.sub(e),
  39445. this.max.add(e),
  39446. this
  39447. },
  39448. expandByScalar: function(e) {
  39449. return this.min.addScalar(-e),
  39450. this.max.addScalar(e),
  39451. this
  39452. },
  39453. containsPoint: function(e) {
  39454. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39455. },
  39456. containsBox: function(e) {
  39457. 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
  39458. },
  39459. getParameter: function(e, t) {
  39460. return (t || new Ci.Vector2).set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
  39461. },
  39462. intersectsBox: function(e) {
  39463. 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)
  39464. },
  39465. clampPoint: function(e, t) {
  39466. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  39467. },
  39468. distanceToPoint: (ve = new Ci.Vector2,
  39469. function(e) {
  39470. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  39471. }
  39472. ),
  39473. intersect: function(e) {
  39474. return this.min.max(e.min),
  39475. this.max.min(e.max),
  39476. this
  39477. },
  39478. union: function(e) {
  39479. return this.min.min(e.min),
  39480. this.max.max(e.max),
  39481. this
  39482. },
  39483. translate: function(e) {
  39484. return this.min.add(e),
  39485. this.max.add(e),
  39486. this
  39487. },
  39488. equals: function(e) {
  39489. return e.min.equals(this.min) && e.max.equals(this.max)
  39490. }
  39491. },
  39492. Ci.Box3 = function(e, t) {
  39493. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  39494. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  39495. }
  39496. ,
  39497. Ci.Box3.prototype = {
  39498. constructor: Ci.Box3,
  39499. set: function(e, t) {
  39500. return this.min.copy(e),
  39501. this.max.copy(t),
  39502. this
  39503. },
  39504. setFromArray: function(e) {
  39505. this.makeEmpty();
  39506. 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) {
  39507. var c = e[s]
  39508. , h = e[s + 1]
  39509. , u = e[s + 2];
  39510. c < t && (t = c),
  39511. h < i && (i = h),
  39512. u < n && (n = u),
  39513. r < c && (r = c),
  39514. o < h && (o = h),
  39515. a < u && (a = u)
  39516. }
  39517. this.min.set(t, i, n),
  39518. this.max.set(r, o, a)
  39519. },
  39520. setFromPoints: function(e) {
  39521. this.makeEmpty();
  39522. for (var t = 0, i = e.length; t < i; t++)
  39523. this.expandByPoint(e[t]);
  39524. return this
  39525. },
  39526. setFromCenterAndSize: (me = new Ci.Vector3,
  39527. function(e, t) {
  39528. var i = me.copy(t).multiplyScalar(.5);
  39529. return this.min.copy(e).sub(i),
  39530. this.max.copy(e).add(i),
  39531. this
  39532. }
  39533. ),
  39534. setFromObject: function(e) {
  39535. void 0 === ge && (ge = new Ci.Box3);
  39536. var i = this;
  39537. return this.makeEmpty(),
  39538. e.updateMatrixWorld(!0),
  39539. e.traverse(function(e) {
  39540. var t = e.geometry;
  39541. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  39542. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  39543. ge.applyMatrix4(e.matrixWorld),
  39544. i.union(ge)))
  39545. }),
  39546. this
  39547. },
  39548. clone: function() {
  39549. return (new this.constructor).copy(this)
  39550. },
  39551. copy: function(e) {
  39552. return this.min.copy(e.min),
  39553. this.max.copy(e.max),
  39554. this
  39555. },
  39556. makeEmpty: function() {
  39557. return this.min.x = this.min.y = this.min.z = 1 / 0,
  39558. this.max.x = this.max.y = this.max.z = -1 / 0,
  39559. this
  39560. },
  39561. isEmpty: function() {
  39562. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39563. },
  39564. center: function(e) {
  39565. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  39566. },
  39567. size: function(e) {
  39568. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  39569. },
  39570. expandByPoint: function(e) {
  39571. return this.min.min(e),
  39572. this.max.max(e),
  39573. this
  39574. },
  39575. expandByVector: function(e) {
  39576. return this.min.sub(e),
  39577. this.max.add(e),
  39578. this
  39579. },
  39580. expandByScalar: function(e) {
  39581. return this.min.addScalar(-e),
  39582. this.max.addScalar(e),
  39583. this
  39584. },
  39585. containsPoint: function(e) {
  39586. 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)
  39587. },
  39588. containsBox: function(e) {
  39589. 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
  39590. },
  39591. getParameter: function(e, t) {
  39592. return (t || new Ci.Vector3).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))
  39593. },
  39594. intersectsBox: function(e) {
  39595. 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)
  39596. },
  39597. intersectsSphere: function(e) {
  39598. return void 0 === fe && (fe = new Ci.Vector3),
  39599. this.clampPoint(e.center, fe),
  39600. fe.distanceToSquared(e.center) <= e.radius * e.radius
  39601. },
  39602. intersectsPlane: function(e) {
  39603. var t, i;
  39604. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  39605. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39606. e.normal.x * this.min.x),
  39607. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  39608. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39609. i += e.normal.y * this.min.y),
  39610. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  39611. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39612. i += e.normal.z * this.min.z),
  39613. t <= e.constant && i >= e.constant
  39614. },
  39615. clampPoint: function(e, t) {
  39616. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  39617. },
  39618. distanceToPoint: (pe = new Ci.Vector3,
  39619. function(e) {
  39620. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  39621. }
  39622. ),
  39623. getBoundingSphere: (de = new Ci.Vector3,
  39624. function(e) {
  39625. var t = e || new Ci.Sphere;
  39626. return t.center = this.center(),
  39627. t.radius = .5 * this.size(de).length(),
  39628. t
  39629. }
  39630. ),
  39631. intersect: function(e) {
  39632. return this.min.max(e.min),
  39633. this.max.min(e.max),
  39634. this
  39635. },
  39636. union: function(e) {
  39637. return this.min.min(e.min),
  39638. this.max.max(e.max),
  39639. this
  39640. },
  39641. applyMatrix4: (ue = [new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3],
  39642. function(e) {
  39643. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  39644. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  39645. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  39646. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  39647. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  39648. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  39649. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  39650. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  39651. this.makeEmpty(),
  39652. this.setFromPoints(ue),
  39653. this
  39654. }
  39655. ),
  39656. translate: function(e) {
  39657. return this.min.add(e),
  39658. this.max.add(e),
  39659. this
  39660. },
  39661. equals: function(e) {
  39662. return e.min.equals(this.min) && e.max.equals(this.max)
  39663. }
  39664. },
  39665. Ci.Matrix3 = function() {
  39666. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39667. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39668. }
  39669. ,
  39670. Ci.Matrix3.prototype = {
  39671. constructor: Ci.Matrix3,
  39672. set: function(e, t, i, n, r, o, a, s, l) {
  39673. var c = this.elements;
  39674. return c[0] = e,
  39675. c[1] = n,
  39676. c[2] = a,
  39677. c[3] = t,
  39678. c[4] = r,
  39679. c[5] = s,
  39680. c[6] = i,
  39681. c[7] = o,
  39682. c[8] = l,
  39683. this
  39684. },
  39685. identity: function() {
  39686. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39687. this
  39688. },
  39689. clone: function() {
  39690. return (new this.constructor).fromArray(this.elements)
  39691. },
  39692. copy: function(e) {
  39693. var t = e.elements;
  39694. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39695. this
  39696. },
  39697. setFromMatrix4: function(e) {
  39698. var t = e.elements;
  39699. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39700. this
  39701. },
  39702. applyToVector3Array: function(e, t, i) {
  39703. void 0 === he && (he = new Ci.Vector3),
  39704. void 0 === t && (t = 0),
  39705. void 0 === i && (i = e.length);
  39706. for (var n = 0, r = t; n < i; n += 3,
  39707. r += 3)
  39708. he.fromArray(e, r),
  39709. he.applyMatrix3(this),
  39710. he.toArray(e, r);
  39711. return e
  39712. },
  39713. applyToBuffer: function(e, t, i) {
  39714. void 0 === ce && (ce = new Ci.Vector3),
  39715. void 0 === t && (t = 0),
  39716. void 0 === i && (i = e.length / e.itemSize);
  39717. for (var n = 0, r = t; n < i; n++,
  39718. r++)
  39719. ce.x = e.getX(r),
  39720. ce.y = e.getY(r),
  39721. ce.z = e.getZ(r),
  39722. ce.applyMatrix3(this),
  39723. e.setXYZ(ce.x, ce.y, ce.z);
  39724. return e
  39725. },
  39726. multiplyScalar: function(e) {
  39727. var t = this.elements;
  39728. return t[0] *= e,
  39729. t[3] *= e,
  39730. t[6] *= e,
  39731. t[1] *= e,
  39732. t[4] *= e,
  39733. t[7] *= e,
  39734. t[2] *= e,
  39735. t[5] *= e,
  39736. t[8] *= e,
  39737. this
  39738. },
  39739. determinant: function() {
  39740. var e = this.elements
  39741. , t = e[0]
  39742. , i = e[1]
  39743. , n = e[2]
  39744. , r = e[3]
  39745. , o = e[4]
  39746. , a = e[5]
  39747. , s = e[6]
  39748. , l = e[7]
  39749. , c = e[8];
  39750. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39751. },
  39752. getInverse: function(e, t) {
  39753. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39754. var i = e.elements
  39755. , n = this.elements
  39756. , r = i[0]
  39757. , o = i[1]
  39758. , a = i[2]
  39759. , s = i[3]
  39760. , l = i[4]
  39761. , c = i[5]
  39762. , h = i[6]
  39763. , u = i[7]
  39764. , d = i[8]
  39765. , p = d * l - c * u
  39766. , f = c * h - d * s
  39767. , g = u * s - l * h
  39768. , m = r * p + o * f + a * g;
  39769. if (0 != m)
  39770. return n[0] = p,
  39771. n[1] = a * u - d * o,
  39772. n[2] = c * o - a * l,
  39773. n[3] = f,
  39774. n[4] = d * r - a * h,
  39775. n[5] = a * s - c * r,
  39776. n[6] = g,
  39777. n[7] = o * h - u * r,
  39778. n[8] = l * r - o * s,
  39779. this.multiplyScalar(1 / m);
  39780. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39781. if (t)
  39782. throw new Error(v);
  39783. return console.warn(v),
  39784. this.identity()
  39785. },
  39786. transpose: function() {
  39787. var e, t = this.elements;
  39788. return e = t[1],
  39789. t[1] = t[3],
  39790. t[3] = e,
  39791. e = t[2],
  39792. t[2] = t[6],
  39793. t[6] = e,
  39794. e = t[5],
  39795. t[5] = t[7],
  39796. t[7] = e,
  39797. this
  39798. },
  39799. flattenToArrayOffset: function(e, t) {
  39800. var i = this.elements;
  39801. return e[t] = i[0],
  39802. e[t + 1] = i[1],
  39803. e[t + 2] = i[2],
  39804. e[t + 3] = i[3],
  39805. e[t + 4] = i[4],
  39806. e[t + 5] = i[5],
  39807. e[t + 6] = i[6],
  39808. e[t + 7] = i[7],
  39809. e[t + 8] = i[8],
  39810. e
  39811. },
  39812. getNormalMatrix: function(e) {
  39813. return this.setFromMatrix4(e).getInverse(this).transpose()
  39814. },
  39815. transposeIntoArray: function(e) {
  39816. var t = this.elements;
  39817. return e[0] = t[0],
  39818. e[1] = t[3],
  39819. e[2] = t[6],
  39820. e[3] = t[1],
  39821. e[4] = t[4],
  39822. e[5] = t[7],
  39823. e[6] = t[2],
  39824. e[7] = t[5],
  39825. e[8] = t[8],
  39826. this
  39827. },
  39828. fromArray: function(e) {
  39829. return this.elements.set(e),
  39830. this
  39831. },
  39832. toArray: function() {
  39833. var e = this.elements;
  39834. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39835. }
  39836. },
  39837. Ci.Matrix4 = function() {
  39838. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39839. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39840. }
  39841. ,
  39842. Ci.Matrix4.prototype = {
  39843. constructor: Ci.Matrix4,
  39844. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39845. var m = this.elements;
  39846. return m[0] = e,
  39847. m[4] = t,
  39848. m[8] = i,
  39849. m[12] = n,
  39850. m[1] = r,
  39851. m[5] = o,
  39852. m[9] = a,
  39853. m[13] = s,
  39854. m[2] = l,
  39855. m[6] = c,
  39856. m[10] = h,
  39857. m[14] = u,
  39858. m[3] = d,
  39859. m[7] = p,
  39860. m[11] = f,
  39861. m[15] = g,
  39862. this
  39863. },
  39864. identity: function() {
  39865. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39866. this
  39867. },
  39868. clone: function() {
  39869. return (new Ci.Matrix4).fromArray(this.elements)
  39870. },
  39871. copy: function(e) {
  39872. return this.elements.set(e.elements),
  39873. this
  39874. },
  39875. copyPosition: function(e) {
  39876. var t = this.elements
  39877. , i = e.elements;
  39878. return t[12] = i[12],
  39879. t[13] = i[13],
  39880. t[14] = i[14],
  39881. this
  39882. },
  39883. extractBasis: function(e, t, i) {
  39884. return e.setFromMatrixColumn(this, 0),
  39885. t.setFromMatrixColumn(this, 1),
  39886. i.setFromMatrixColumn(this, 2),
  39887. this
  39888. },
  39889. makeBasis: function(e, t, i) {
  39890. 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),
  39891. this
  39892. },
  39893. extractRotation: function(e) {
  39894. void 0 === le && (le = new Ci.Vector3);
  39895. var t = this.elements
  39896. , i = e.elements
  39897. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39898. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39899. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39900. return t[0] = i[0] * n,
  39901. t[1] = i[1] * n,
  39902. t[2] = i[2] * n,
  39903. t[4] = i[4] * r,
  39904. t[5] = i[5] * r,
  39905. t[6] = i[6] * r,
  39906. t[8] = i[8] * o,
  39907. t[9] = i[9] * o,
  39908. t[10] = i[10] * o,
  39909. this
  39910. },
  39911. makeRotationFromEuler: function(e) {
  39912. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39913. var t = this.elements
  39914. , i = e.x
  39915. , n = e.y
  39916. , r = e.z
  39917. , o = Math.cos(i)
  39918. , a = Math.sin(i)
  39919. , s = Math.cos(n)
  39920. , l = Math.sin(n)
  39921. , c = Math.cos(r)
  39922. , h = Math.sin(r);
  39923. if ("XYZ" === e.order) {
  39924. var u = o * c
  39925. , d = o * h
  39926. , p = a * c
  39927. , f = a * h;
  39928. t[0] = s * c,
  39929. t[4] = -s * h,
  39930. t[8] = l,
  39931. t[1] = d + p * l,
  39932. t[5] = u - f * l,
  39933. t[9] = -a * s,
  39934. t[2] = f - u * l,
  39935. t[6] = p + d * l,
  39936. t[10] = o * s
  39937. } else if ("YXZ" === e.order) {
  39938. var g = s * c
  39939. , m = s * h
  39940. , v = l * c
  39941. , y = l * h;
  39942. t[0] = g + y * a,
  39943. t[4] = v * a - m,
  39944. t[8] = o * l,
  39945. t[1] = o * h,
  39946. t[5] = o * c,
  39947. t[9] = -a,
  39948. t[2] = m * a - v,
  39949. t[6] = y + g * a,
  39950. t[10] = o * s
  39951. } else if ("ZXY" === e.order) {
  39952. g = s * c,
  39953. m = s * h,
  39954. v = l * c,
  39955. y = l * h;
  39956. t[0] = g - y * a,
  39957. t[4] = -o * h,
  39958. t[8] = v + m * a,
  39959. t[1] = m + v * a,
  39960. t[5] = o * c,
  39961. t[9] = y - g * a,
  39962. t[2] = -o * l,
  39963. t[6] = a,
  39964. t[10] = o * s
  39965. } else if ("ZYX" === e.order) {
  39966. u = o * c,
  39967. d = o * h,
  39968. p = a * c,
  39969. f = a * h;
  39970. t[0] = s * c,
  39971. t[4] = p * l - d,
  39972. t[8] = u * l + f,
  39973. t[1] = s * h,
  39974. t[5] = f * l + u,
  39975. t[9] = d * l - p,
  39976. t[2] = -l,
  39977. t[6] = a * s,
  39978. t[10] = o * s
  39979. } else if ("YZX" === e.order) {
  39980. var A = o * s
  39981. , C = o * l
  39982. , I = a * s
  39983. , E = a * l;
  39984. t[0] = s * c,
  39985. t[4] = E - A * h,
  39986. t[8] = I * h + C,
  39987. t[1] = h,
  39988. t[5] = o * c,
  39989. t[9] = -a * c,
  39990. t[2] = -l * c,
  39991. t[6] = C * h + I,
  39992. t[10] = A - E * h
  39993. } else if ("XZY" === e.order) {
  39994. A = o * s,
  39995. C = o * l,
  39996. I = a * s,
  39997. E = a * l;
  39998. t[0] = s * c,
  39999. t[4] = -h,
  40000. t[8] = l * c,
  40001. t[1] = A * h + E,
  40002. t[5] = o * c,
  40003. t[9] = C * h - I,
  40004. t[2] = I * h - C,
  40005. t[6] = a * c,
  40006. t[10] = E * h + A
  40007. }
  40008. return t[3] = 0,
  40009. t[7] = 0,
  40010. t[11] = 0,
  40011. t[12] = 0,
  40012. t[13] = 0,
  40013. t[14] = 0,
  40014. t[15] = 1,
  40015. this
  40016. },
  40017. makeRotationFromQuaternion: function(e) {
  40018. var t = this.elements
  40019. , i = e.x
  40020. , n = e.y
  40021. , r = e.z
  40022. , o = e.w
  40023. , a = i + i
  40024. , s = n + n
  40025. , l = r + r
  40026. , c = i * a
  40027. , h = i * s
  40028. , u = i * l
  40029. , d = n * s
  40030. , p = n * l
  40031. , f = r * l
  40032. , g = o * a
  40033. , m = o * s
  40034. , v = o * l;
  40035. return t[0] = 1 - (d + f),
  40036. t[4] = h - v,
  40037. t[8] = u + m,
  40038. t[1] = h + v,
  40039. t[5] = 1 - (c + f),
  40040. t[9] = p - g,
  40041. t[2] = u - m,
  40042. t[6] = p + g,
  40043. t[10] = 1 - (c + d),
  40044. t[3] = 0,
  40045. t[7] = 0,
  40046. t[11] = 0,
  40047. t[12] = 0,
  40048. t[13] = 0,
  40049. t[14] = 0,
  40050. t[15] = 1,
  40051. this
  40052. },
  40053. lookAt: function(e, t, i) {
  40054. void 0 === oe && (oe = new Ci.Vector3),
  40055. void 0 === ae && (ae = new Ci.Vector3),
  40056. void 0 === se && (se = new Ci.Vector3);
  40057. var n = this.elements;
  40058. return se.subVectors(e, t).normalize(),
  40059. 0 === se.lengthSq() && (se.z = 1),
  40060. oe.crossVectors(i, se).normalize(),
  40061. 0 === oe.lengthSq() && (se.x += 1e-4,
  40062. oe.crossVectors(i, se).normalize()),
  40063. ae.crossVectors(se, oe),
  40064. n[0] = oe.x,
  40065. n[4] = ae.x,
  40066. n[8] = se.x,
  40067. n[1] = oe.y,
  40068. n[5] = ae.y,
  40069. n[9] = se.y,
  40070. n[2] = oe.z,
  40071. n[6] = ae.z,
  40072. n[10] = se.z,
  40073. this
  40074. },
  40075. multiply: function(e, t) {
  40076. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  40077. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  40078. },
  40079. multiplyMatrices: function(e, t) {
  40080. var i = e.elements
  40081. , n = t.elements
  40082. , r = this.elements
  40083. , o = i[0]
  40084. , a = i[4]
  40085. , s = i[8]
  40086. , l = i[12]
  40087. , c = i[1]
  40088. , h = i[5]
  40089. , u = i[9]
  40090. , d = i[13]
  40091. , p = i[2]
  40092. , f = i[6]
  40093. , g = i[10]
  40094. , m = i[14]
  40095. , v = i[3]
  40096. , y = i[7]
  40097. , A = i[11]
  40098. , C = i[15]
  40099. , I = n[0]
  40100. , E = n[4]
  40101. , _ = n[8]
  40102. , b = n[12]
  40103. , w = n[1]
  40104. , T = n[5]
  40105. , x = n[9]
  40106. , S = n[13]
  40107. , M = n[2]
  40108. , R = n[6]
  40109. , P = n[10]
  40110. , O = n[14]
  40111. , L = n[3]
  40112. , D = n[7]
  40113. , N = n[11]
  40114. , F = n[15];
  40115. return r[0] = o * I + a * w + s * M + l * L,
  40116. r[4] = o * E + a * T + s * R + l * D,
  40117. r[8] = o * _ + a * x + s * P + l * N,
  40118. r[12] = o * b + a * S + s * O + l * F,
  40119. r[1] = c * I + h * w + u * M + d * L,
  40120. r[5] = c * E + h * T + u * R + d * D,
  40121. r[9] = c * _ + h * x + u * P + d * N,
  40122. r[13] = c * b + h * S + u * O + d * F,
  40123. r[2] = p * I + f * w + g * M + m * L,
  40124. r[6] = p * E + f * T + g * R + m * D,
  40125. r[10] = p * _ + f * x + g * P + m * N,
  40126. r[14] = p * b + f * S + g * O + m * F,
  40127. r[3] = v * I + y * w + A * M + C * L,
  40128. r[7] = v * E + y * T + A * R + C * D,
  40129. r[11] = v * _ + y * x + A * P + C * N,
  40130. r[15] = v * b + y * S + A * O + C * F,
  40131. this
  40132. },
  40133. multiplyToArray: function(e, t, i) {
  40134. var n = this.elements;
  40135. return this.multiplyMatrices(e, t),
  40136. i[0] = n[0],
  40137. i[1] = n[1],
  40138. i[2] = n[2],
  40139. i[3] = n[3],
  40140. i[4] = n[4],
  40141. i[5] = n[5],
  40142. i[6] = n[6],
  40143. i[7] = n[7],
  40144. i[8] = n[8],
  40145. i[9] = n[9],
  40146. i[10] = n[10],
  40147. i[11] = n[11],
  40148. i[12] = n[12],
  40149. i[13] = n[13],
  40150. i[14] = n[14],
  40151. i[15] = n[15],
  40152. this
  40153. },
  40154. multiplyScalar: function(e) {
  40155. var t = this.elements;
  40156. return t[0] *= e,
  40157. t[4] *= e,
  40158. t[8] *= e,
  40159. t[12] *= e,
  40160. t[1] *= e,
  40161. t[5] *= e,
  40162. t[9] *= e,
  40163. t[13] *= e,
  40164. t[2] *= e,
  40165. t[6] *= e,
  40166. t[10] *= e,
  40167. t[14] *= e,
  40168. t[3] *= e,
  40169. t[7] *= e,
  40170. t[11] *= e,
  40171. t[15] *= e,
  40172. this
  40173. },
  40174. applyToVector3Array: function(e, t, i) {
  40175. void 0 === re && (re = new Ci.Vector3),
  40176. void 0 === t && (t = 0),
  40177. void 0 === i && (i = e.length);
  40178. for (var n = 0, r = t; n < i; n += 3,
  40179. r += 3)
  40180. re.fromArray(e, r),
  40181. re.applyMatrix4(this),
  40182. re.toArray(e, r);
  40183. return e
  40184. },
  40185. applyToBuffer: function(e, t, i) {
  40186. void 0 === ne && (ne = new Ci.Vector3),
  40187. void 0 === t && (t = 0),
  40188. void 0 === i && (i = e.length / e.itemSize);
  40189. for (var n = 0, r = t; n < i; n++,
  40190. r++)
  40191. ne.x = e.getX(r),
  40192. ne.y = e.getY(r),
  40193. ne.z = e.getZ(r),
  40194. ne.applyMatrix4(this),
  40195. e.setXYZ(ne.x, ne.y, ne.z);
  40196. return e
  40197. },
  40198. determinant: function() {
  40199. var e = this.elements
  40200. , t = e[0]
  40201. , i = e[4]
  40202. , n = e[8]
  40203. , r = e[12]
  40204. , o = e[1]
  40205. , a = e[5]
  40206. , s = e[9]
  40207. , l = e[13]
  40208. , c = e[2]
  40209. , h = e[6]
  40210. , u = e[10]
  40211. , d = e[14];
  40212. return e[3] * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) + e[7] * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) + e[11] * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) + e[15] * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  40213. },
  40214. transpose: function() {
  40215. var e, t = this.elements;
  40216. return e = t[1],
  40217. t[1] = t[4],
  40218. t[4] = e,
  40219. e = t[2],
  40220. t[2] = t[8],
  40221. t[8] = e,
  40222. e = t[6],
  40223. t[6] = t[9],
  40224. t[9] = e,
  40225. e = t[3],
  40226. t[3] = t[12],
  40227. t[12] = e,
  40228. e = t[7],
  40229. t[7] = t[13],
  40230. t[13] = e,
  40231. e = t[11],
  40232. t[11] = t[14],
  40233. t[14] = e,
  40234. this
  40235. },
  40236. flattenToArrayOffset: function(e, t) {
  40237. var i = this.elements;
  40238. return e[t] = i[0],
  40239. e[t + 1] = i[1],
  40240. e[t + 2] = i[2],
  40241. e[t + 3] = i[3],
  40242. e[t + 4] = i[4],
  40243. e[t + 5] = i[5],
  40244. e[t + 6] = i[6],
  40245. e[t + 7] = i[7],
  40246. e[t + 8] = i[8],
  40247. e[t + 9] = i[9],
  40248. e[t + 10] = i[10],
  40249. e[t + 11] = i[11],
  40250. e[t + 12] = i[12],
  40251. e[t + 13] = i[13],
  40252. e[t + 14] = i[14],
  40253. e[t + 15] = i[15],
  40254. e
  40255. },
  40256. getPosition: function() {
  40257. return void 0 === ie && (ie = new Ci.Vector3),
  40258. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  40259. ie.setFromMatrixColumn(this, 3)
  40260. },
  40261. setPosition: function(e) {
  40262. var t = this.elements;
  40263. return t[12] = e.x,
  40264. t[13] = e.y,
  40265. t[14] = e.z,
  40266. this
  40267. },
  40268. getInverse: function(e, t) {
  40269. var i = this.elements
  40270. , n = e.elements
  40271. , r = n[0]
  40272. , o = n[1]
  40273. , a = n[2]
  40274. , s = n[3]
  40275. , l = n[4]
  40276. , c = n[5]
  40277. , h = n[6]
  40278. , u = n[7]
  40279. , d = n[8]
  40280. , p = n[9]
  40281. , f = n[10]
  40282. , g = n[11]
  40283. , m = n[12]
  40284. , v = n[13]
  40285. , y = n[14]
  40286. , A = n[15]
  40287. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  40288. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  40289. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  40290. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  40291. , b = r * C + o * I + a * E + s * _;
  40292. if (0 != b)
  40293. return i[0] = C,
  40294. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  40295. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  40296. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  40297. i[4] = I,
  40298. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  40299. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  40300. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  40301. i[8] = E,
  40302. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  40303. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  40304. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  40305. i[12] = _,
  40306. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  40307. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  40308. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  40309. this.multiplyScalar(1 / b);
  40310. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  40311. if (t)
  40312. throw new Error(w);
  40313. return console.warn(w),
  40314. this.identity()
  40315. },
  40316. scale: function(e) {
  40317. var t = this.elements
  40318. , i = e.x
  40319. , n = e.y
  40320. , r = e.z;
  40321. return t[0] *= i,
  40322. t[4] *= n,
  40323. t[8] *= r,
  40324. t[1] *= i,
  40325. t[5] *= n,
  40326. t[9] *= r,
  40327. t[2] *= i,
  40328. t[6] *= n,
  40329. t[10] *= r,
  40330. t[3] *= i,
  40331. t[7] *= n,
  40332. t[11] *= r,
  40333. this
  40334. },
  40335. getMaxScaleOnAxis: function() {
  40336. var e = this.elements
  40337. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  40338. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  40339. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  40340. return Math.sqrt(Math.max(t, i, n))
  40341. },
  40342. makeTranslation: function(e, t, i) {
  40343. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  40344. this
  40345. },
  40346. makeRotationX: function(e) {
  40347. var t = Math.cos(e)
  40348. , i = Math.sin(e);
  40349. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  40350. this
  40351. },
  40352. makeRotationY: function(e) {
  40353. var t = Math.cos(e)
  40354. , i = Math.sin(e);
  40355. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  40356. this
  40357. },
  40358. makeRotationZ: function(e) {
  40359. var t = Math.cos(e)
  40360. , i = Math.sin(e);
  40361. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  40362. this
  40363. },
  40364. makeRotationAxis: function(e, t) {
  40365. var i = Math.cos(t)
  40366. , n = Math.sin(t)
  40367. , r = 1 - i
  40368. , o = e.x
  40369. , a = e.y
  40370. , s = e.z
  40371. , l = r * o
  40372. , c = r * a;
  40373. 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),
  40374. this
  40375. },
  40376. makeScale: function(e, t, i) {
  40377. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  40378. this
  40379. },
  40380. compose: function(e, t, i) {
  40381. return this.makeRotationFromQuaternion(t),
  40382. this.scale(i),
  40383. this.setPosition(e),
  40384. this
  40385. },
  40386. decompose: function(e, t, i) {
  40387. void 0 === ee && (ee = new Ci.Vector3),
  40388. void 0 === te && (te = new Ci.Matrix4);
  40389. var n = this.elements
  40390. , r = ee.set(n[0], n[1], n[2]).length()
  40391. , o = ee.set(n[4], n[5], n[6]).length()
  40392. , a = ee.set(n[8], n[9], n[10]).length();
  40393. this.determinant() < 0 && (r = -r),
  40394. e.x = n[12],
  40395. e.y = n[13],
  40396. e.z = n[14],
  40397. te.elements.set(this.elements);
  40398. var s = 1 / r
  40399. , l = 1 / o
  40400. , c = 1 / a;
  40401. return te.elements[0] *= s,
  40402. te.elements[1] *= s,
  40403. te.elements[2] *= s,
  40404. te.elements[4] *= l,
  40405. te.elements[5] *= l,
  40406. te.elements[6] *= l,
  40407. te.elements[8] *= c,
  40408. te.elements[9] *= c,
  40409. te.elements[10] *= c,
  40410. t.setFromRotationMatrix(te),
  40411. i.x = r,
  40412. i.y = o,
  40413. i.z = a,
  40414. this
  40415. },
  40416. makeFrustum: function(e, t, i, n, r, o) {
  40417. var a = this.elements
  40418. , s = 2 * r / (t - e)
  40419. , l = 2 * r / (n - i)
  40420. , c = (t + e) / (t - e)
  40421. , h = (n + i) / (n - i)
  40422. , u = -(o + r) / (o - r)
  40423. , d = -2 * o * r / (o - r);
  40424. return a[0] = s,
  40425. a[4] = 0,
  40426. a[8] = c,
  40427. a[12] = 0,
  40428. a[1] = 0,
  40429. a[5] = l,
  40430. a[9] = h,
  40431. a[13] = 0,
  40432. a[2] = 0,
  40433. a[6] = 0,
  40434. a[10] = u,
  40435. a[14] = d,
  40436. a[3] = 0,
  40437. a[7] = 0,
  40438. a[11] = -1,
  40439. a[15] = 0,
  40440. this
  40441. },
  40442. makePerspective: function(e, t, i, n) {
  40443. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  40444. , o = -r
  40445. , a = o * t
  40446. , s = r * t;
  40447. return this.makeFrustum(a, s, o, r, i, n)
  40448. },
  40449. makeOrthographic: function(e, t, i, n, r, o) {
  40450. var a = this.elements
  40451. , s = 1 / (t - e)
  40452. , l = 1 / (i - n)
  40453. , c = 1 / (o - r)
  40454. , h = (t + e) * s
  40455. , u = (i + n) * l
  40456. , d = (o + r) * c;
  40457. return a[0] = 2 * s,
  40458. a[4] = 0,
  40459. a[8] = 0,
  40460. a[12] = -h,
  40461. a[1] = 0,
  40462. a[5] = 2 * l,
  40463. a[9] = 0,
  40464. a[13] = -u,
  40465. a[2] = 0,
  40466. a[6] = 0,
  40467. a[10] = -2 * c,
  40468. a[14] = -d,
  40469. a[3] = 0,
  40470. a[7] = 0,
  40471. a[11] = 0,
  40472. a[15] = 1,
  40473. this
  40474. },
  40475. equals: function(e) {
  40476. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  40477. if (t[n] !== i[n])
  40478. return !1;
  40479. return !0
  40480. },
  40481. fromArray: function(e) {
  40482. return this.elements.set(e),
  40483. this
  40484. },
  40485. toArray: function() {
  40486. var e = this.elements;
  40487. 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]]
  40488. }
  40489. },
  40490. Ci.Ray = function(e, t) {
  40491. this.origin = void 0 !== e ? e : new Ci.Vector3,
  40492. this.direction = void 0 !== t ? t : new Ci.Vector3
  40493. }
  40494. ,
  40495. Ci.Ray.prototype = {
  40496. constructor: Ci.Ray,
  40497. set: function(e, t) {
  40498. return this.origin.copy(e),
  40499. this.direction.copy(t),
  40500. this
  40501. },
  40502. clone: function() {
  40503. return (new this.constructor).copy(this)
  40504. },
  40505. copy: function(e) {
  40506. return this.origin.copy(e.origin),
  40507. this.direction.copy(e.direction),
  40508. this
  40509. },
  40510. at: function(e, t) {
  40511. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  40512. },
  40513. lookAt: function(e) {
  40514. this.direction.copy(e).sub(this.origin).normalize()
  40515. },
  40516. recast: ($ = new Ci.Vector3,
  40517. function(e) {
  40518. return this.origin.copy(this.at(e, $)),
  40519. this
  40520. }
  40521. ),
  40522. closestPointToPoint: function(e, t) {
  40523. var i = t || new Ci.Vector3;
  40524. i.subVectors(e, this.origin);
  40525. var n = i.dot(this.direction);
  40526. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  40527. },
  40528. distanceToPoint: function(e) {
  40529. return Math.sqrt(this.distanceSqToPoint(e))
  40530. },
  40531. distanceSqToPoint: (J = new Ci.Vector3,
  40532. function(e) {
  40533. var t = J.subVectors(e, this.origin).dot(this.direction);
  40534. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  40535. J.distanceToSquared(e))
  40536. }
  40537. ),
  40538. distanceSqToSegment: (Z = new Ci.Vector3,
  40539. K = new Ci.Vector3,
  40540. Q = new Ci.Vector3,
  40541. function(e, t, i, n) {
  40542. Z.copy(e).add(t).multiplyScalar(.5),
  40543. K.copy(t).sub(e).normalize(),
  40544. Q.copy(this.origin).sub(Z);
  40545. var r, o, a, s, l = .5 * e.distanceTo(t), c = -this.direction.dot(K), h = Q.dot(this.direction), u = -Q.dot(K), d = Q.lengthSq(), p = Math.abs(1 - c * c);
  40546. if (0 < p)
  40547. if (o = c * h - u,
  40548. s = l * p,
  40549. 0 <= (r = c * u - h))
  40550. if (-s <= o)
  40551. if (o <= s) {
  40552. var f = 1 / p;
  40553. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  40554. } else
  40555. o = l,
  40556. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40557. else
  40558. o = -l,
  40559. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40560. else
  40561. a = o <= -s ? -(r = Math.max(0, -(-c * l + h))) * r + (o = 0 < r ? -l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d : o <= s ? (r = 0,
  40562. (o = Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d) : -(r = Math.max(0, -(c * l + h))) * r + (o = 0 < r ? l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d;
  40563. else
  40564. o = 0 < c ? -l : l,
  40565. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40566. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  40567. n && n.copy(K).multiplyScalar(o).add(Z),
  40568. a
  40569. }
  40570. ),
  40571. intersectSphere: (X = new Ci.Vector3,
  40572. function(e, t) {
  40573. X.subVectors(e.center, this.origin);
  40574. var i = X.dot(this.direction)
  40575. , n = X.dot(X) - i * i
  40576. , r = e.radius * e.radius;
  40577. if (r < n)
  40578. return null;
  40579. var o = Math.sqrt(r - n)
  40580. , a = i - o
  40581. , s = i + o;
  40582. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  40583. }
  40584. ),
  40585. intersectsSphere: function(e) {
  40586. return this.distanceToPoint(e.center) <= e.radius
  40587. },
  40588. distanceToPlane: function(e) {
  40589. var t = e.normal.dot(this.direction);
  40590. if (0 === t)
  40591. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40592. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40593. return 0 <= i ? i : null
  40594. },
  40595. intersectPlane: function(e, t) {
  40596. var i = this.distanceToPlane(e);
  40597. return null === i ? null : this.at(i, t)
  40598. },
  40599. intersectsPlane: function(e) {
  40600. var t = e.distanceToPoint(this.origin);
  40601. return 0 === t || e.normal.dot(this.direction) * t < 0
  40602. },
  40603. intersectBox: function(e, t) {
  40604. 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;
  40605. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  40606. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40607. (e.min.x - u.x) * l),
  40608. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  40609. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40610. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  40611. (o < n || n != n) && (n = o),
  40612. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  40613. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40614. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  40615. (s < n || n != n) && (n = s),
  40616. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  40617. },
  40618. intersectsBox: (q = new Ci.Vector3,
  40619. function(e) {
  40620. return null !== this.intersectBox(e, q)
  40621. }
  40622. ),
  40623. intersectTriangle: (G = new Ci.Vector3,
  40624. W = new Ci.Vector3,
  40625. j = new Ci.Vector3,
  40626. Y = new Ci.Vector3,
  40627. function(e, t, i, n, r) {
  40628. W.subVectors(t, e),
  40629. j.subVectors(i, e),
  40630. Y.crossVectors(W, j);
  40631. var o, a = this.direction.dot(Y);
  40632. if (0 < a) {
  40633. if (n)
  40634. return null;
  40635. o = 1
  40636. } else {
  40637. if (!(a < 0))
  40638. return null;
  40639. o = -1,
  40640. a = -a
  40641. }
  40642. G.subVectors(this.origin, e);
  40643. var s = o * this.direction.dot(j.crossVectors(G, j));
  40644. if (s < 0)
  40645. return null;
  40646. var l = o * this.direction.dot(W.cross(G));
  40647. if (l < 0)
  40648. return null;
  40649. if (a < s + l)
  40650. return null;
  40651. var c = -o * G.dot(Y);
  40652. return c < 0 ? null : this.at(c / a, r)
  40653. }
  40654. ),
  40655. applyMatrix4: function(e) {
  40656. return this.direction.add(this.origin).applyMatrix4(e),
  40657. this.origin.applyMatrix4(e),
  40658. this.direction.sub(this.origin),
  40659. this.direction.normalize(),
  40660. this
  40661. },
  40662. equals: function(e) {
  40663. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40664. }
  40665. },
  40666. Ci.Sphere = function(e, t) {
  40667. this.center = void 0 !== e ? e : new Ci.Vector3,
  40668. this.radius = void 0 !== t ? t : 0
  40669. }
  40670. ,
  40671. Ci.Sphere.prototype = {
  40672. constructor: Ci.Sphere,
  40673. set: function(e, t) {
  40674. return this.center.copy(e),
  40675. this.radius = t,
  40676. this
  40677. },
  40678. setFromPoints: (z = new Ci.Box3,
  40679. function(e, t) {
  40680. var i = this.center;
  40681. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  40682. for (var n = 0, r = 0, o = e.length; r < o; r++)
  40683. n = Math.max(n, i.distanceToSquared(e[r]));
  40684. return this.radius = Math.sqrt(n),
  40685. this
  40686. }
  40687. ),
  40688. clone: function() {
  40689. return (new this.constructor).copy(this)
  40690. },
  40691. copy: function(e) {
  40692. return this.center.copy(e.center),
  40693. this.radius = e.radius,
  40694. this
  40695. },
  40696. empty: function() {
  40697. return this.radius <= 0
  40698. },
  40699. containsPoint: function(e) {
  40700. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40701. },
  40702. distanceToPoint: function(e) {
  40703. return e.distanceTo(this.center) - this.radius
  40704. },
  40705. intersectsSphere: function(e) {
  40706. var t = this.radius + e.radius;
  40707. return e.center.distanceToSquared(this.center) <= t * t
  40708. },
  40709. intersectsBox: function(e) {
  40710. return e.intersectsSphere(this)
  40711. },
  40712. intersectsPlane: function(e) {
  40713. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40714. },
  40715. clampPoint: function(e, t) {
  40716. var i = this.center.distanceToSquared(e)
  40717. , n = t || new Ci.Vector3;
  40718. return n.copy(e),
  40719. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  40720. n.multiplyScalar(this.radius).add(this.center)),
  40721. n
  40722. },
  40723. getBoundingBox: function(e) {
  40724. var t = e || new Ci.Box3;
  40725. return t.set(this.center, this.center),
  40726. t.expandByScalar(this.radius),
  40727. t
  40728. },
  40729. applyMatrix4: function(e) {
  40730. return this.center.applyMatrix4(e),
  40731. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40732. this
  40733. },
  40734. translate: function(e) {
  40735. return this.center.add(e),
  40736. this
  40737. },
  40738. equals: function(e) {
  40739. return e.center.equals(this.center) && e.radius === this.radius
  40740. }
  40741. },
  40742. Ci.Frustum = function(e, t, i, n, r, o) {
  40743. this.planes = [void 0 !== e ? e : new Ci.Plane, void 0 !== t ? t : new Ci.Plane, void 0 !== i ? i : new Ci.Plane, void 0 !== n ? n : new Ci.Plane, void 0 !== r ? r : new Ci.Plane, void 0 !== o ? o : new Ci.Plane]
  40744. }
  40745. ,
  40746. Ci.Frustum.prototype = {
  40747. constructor: Ci.Frustum,
  40748. set: function(e, t, i, n, r, o) {
  40749. var a = this.planes;
  40750. return a[0].copy(e),
  40751. a[1].copy(t),
  40752. a[2].copy(i),
  40753. a[3].copy(n),
  40754. a[4].copy(r),
  40755. a[5].copy(o),
  40756. this
  40757. },
  40758. clone: function() {
  40759. return (new this.constructor).copy(this)
  40760. },
  40761. copy: function(e) {
  40762. for (var t = this.planes, i = 0; i < 6; i++)
  40763. t[i].copy(e.planes[i]);
  40764. return this
  40765. },
  40766. setFromMatrix: function(e) {
  40767. var t = this.planes
  40768. , i = e.elements
  40769. , n = i[0]
  40770. , r = i[1]
  40771. , o = i[2]
  40772. , a = i[3]
  40773. , s = i[4]
  40774. , l = i[5]
  40775. , c = i[6]
  40776. , h = i[7]
  40777. , u = i[8]
  40778. , d = i[9]
  40779. , p = i[10]
  40780. , f = i[11]
  40781. , g = i[12]
  40782. , m = i[13]
  40783. , v = i[14]
  40784. , y = i[15];
  40785. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  40786. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  40787. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  40788. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  40789. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  40790. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40791. this
  40792. },
  40793. intersectsObject: (H = new Ci.Sphere,
  40794. function(e) {
  40795. var t = e.geometry;
  40796. return null === t.boundingSphere && t.computeBoundingSphere(),
  40797. H.copy(t.boundingSphere),
  40798. H.applyMatrix4(e.matrixWorld),
  40799. this.intersectsSphere(H)
  40800. }
  40801. ),
  40802. intersectsSphere: function(e) {
  40803. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40804. if (t[r].distanceToPoint(i) < n)
  40805. return !1
  40806. }
  40807. return !0
  40808. },
  40809. intersectsBox: (k = new Ci.Vector3,
  40810. U = new Ci.Vector3,
  40811. function(e) {
  40812. for (var t = this.planes, i = 0; i < 6; i++) {
  40813. var n = t[i];
  40814. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40815. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40816. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40817. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40818. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40819. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40820. var r = n.distanceToPoint(k)
  40821. , o = n.distanceToPoint(U);
  40822. if (r < 0 && o < 0)
  40823. return !1
  40824. }
  40825. return !0
  40826. }
  40827. ),
  40828. containsPoint: function(e) {
  40829. for (var t = this.planes, i = 0; i < 6; i++)
  40830. if (t[i].distanceToPoint(e) < 0)
  40831. return !1;
  40832. return !0
  40833. }
  40834. },
  40835. Ci.Plane = function(e, t) {
  40836. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40837. this.constant = void 0 !== t ? t : 0
  40838. }
  40839. ,
  40840. Ci.Plane.prototype = {
  40841. constructor: Ci.Plane,
  40842. set: function(e, t) {
  40843. return this.normal.copy(e),
  40844. this.constant = t,
  40845. this
  40846. },
  40847. setComponents: function(e, t, i, n) {
  40848. return this.normal.set(e, t, i),
  40849. this.constant = n,
  40850. this
  40851. },
  40852. setFromNormalAndCoplanarPoint: function(e, t) {
  40853. return this.normal.copy(e),
  40854. this.constant = -t.dot(this.normal),
  40855. this
  40856. },
  40857. setFromCoplanarPoints: (B = new Ci.Vector3,
  40858. V = new Ci.Vector3,
  40859. function(e, t, i) {
  40860. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40861. return this.setFromNormalAndCoplanarPoint(n, e),
  40862. this
  40863. }
  40864. ),
  40865. clone: function() {
  40866. return (new this.constructor).copy(this)
  40867. },
  40868. copy: function(e) {
  40869. return this.normal.copy(e.normal),
  40870. this.constant = e.constant,
  40871. this
  40872. },
  40873. normalize: function() {
  40874. var e = 1 / this.normal.length();
  40875. return this.normal.multiplyScalar(e),
  40876. this.constant *= e,
  40877. this
  40878. },
  40879. negate: function() {
  40880. return this.constant *= -1,
  40881. this.normal.negate(),
  40882. this
  40883. },
  40884. distanceToPoint: function(e) {
  40885. return this.normal.dot(e) + this.constant
  40886. },
  40887. distanceToSphere: function(e) {
  40888. return this.distanceToPoint(e.center) - e.radius
  40889. },
  40890. projectPoint: function(e, t) {
  40891. return this.orthoPoint(e, t).sub(e).negate()
  40892. },
  40893. orthoPoint: function(e, t) {
  40894. var i = this.distanceToPoint(e);
  40895. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40896. },
  40897. intersectLine: (F = new Ci.Vector3,
  40898. function(e, t) {
  40899. var i = t || new Ci.Vector3
  40900. , n = e.delta(F)
  40901. , r = this.normal.dot(n);
  40902. if (0 !== r) {
  40903. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40904. if (!(o < 0 || 1 < o))
  40905. return i.copy(n).multiplyScalar(o).add(e.start)
  40906. } else if (0 === this.distanceToPoint(e.start))
  40907. return i.copy(e.start)
  40908. }
  40909. ),
  40910. intersectsLine: function(e) {
  40911. var t = this.distanceToPoint(e.start)
  40912. , i = this.distanceToPoint(e.end);
  40913. return t < 0 && 0 < i || i < 0 && 0 < t
  40914. },
  40915. intersectsBox: function(e) {
  40916. return e.intersectsPlane(this)
  40917. },
  40918. intersectsSphere: function(e) {
  40919. return e.intersectsPlane(this)
  40920. },
  40921. coplanarPoint: function(e) {
  40922. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40923. },
  40924. applyMatrix4: (L = new Ci.Vector3,
  40925. D = new Ci.Vector3,
  40926. N = new Ci.Matrix3,
  40927. function(e, t) {
  40928. var i = t || N.getNormalMatrix(e)
  40929. , n = L.copy(this.normal).applyMatrix3(i)
  40930. , r = this.coplanarPoint(D);
  40931. return r.applyMatrix4(e),
  40932. this.setFromNormalAndCoplanarPoint(n, r),
  40933. this
  40934. }
  40935. ),
  40936. translate: function(e) {
  40937. return this.constant = this.constant - e.dot(this.normal),
  40938. this
  40939. },
  40940. equals: function(e) {
  40941. return e.normal.equals(this.normal) && e.constant === this.constant
  40942. }
  40943. },
  40944. Ci.Spherical = function(e, t, i) {
  40945. return this.radius = void 0 !== e ? e : 1,
  40946. this.phi = void 0 !== t ? t : 0,
  40947. this.theta = void 0 !== i ? i : 0,
  40948. this
  40949. }
  40950. ,
  40951. Ci.Spherical.prototype = {
  40952. constructor: Ci.Spherical,
  40953. set: function(e, t, i) {
  40954. this.radius = e,
  40955. this.phi = t,
  40956. this.theta = i
  40957. },
  40958. clone: function() {
  40959. return (new this.constructor).copy(this)
  40960. },
  40961. copy: function(e) {
  40962. return this.radius.copy(e.radius),
  40963. this.phi.copy(e.phi),
  40964. this.theta.copy(e.theta),
  40965. this
  40966. },
  40967. makeSafe: function() {
  40968. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  40969. },
  40970. setFromVector3: function(e) {
  40971. return this.radius = e.length(),
  40972. 0 === this.radius ? (this.theta = 0,
  40973. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40974. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  40975. this
  40976. }
  40977. },
  40978. Ci.Math = {
  40979. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  40980. P = new Array(36),
  40981. O = 0,
  40982. function() {
  40983. for (var e = 0; e < 36; e++)
  40984. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  40985. M = 15 & O,
  40986. O >>= 4,
  40987. P[e] = R[19 === e ? 3 & M | 8 : M]);
  40988. return P.join("")
  40989. }
  40990. ),
  40991. clamp: function(e, t, i) {
  40992. return Math.max(t, Math.min(i, e))
  40993. },
  40994. euclideanModulo: function(e, t) {
  40995. return (e % t + t) % t
  40996. },
  40997. mapLinear: function(e, t, i, n, r) {
  40998. return n + (e - t) * (r - n) / (i - t)
  40999. },
  41000. smoothstep: function(e, t, i) {
  41001. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  41002. },
  41003. smootherstep: function(e, t, i) {
  41004. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  41005. },
  41006. random16: function() {
  41007. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  41008. Math.random()
  41009. },
  41010. randInt: function(e, t) {
  41011. return e + Math.floor(Math.random() * (t - e + 1))
  41012. },
  41013. randFloat: function(e, t) {
  41014. return e + Math.random() * (t - e)
  41015. },
  41016. randFloatSpread: function(e) {
  41017. return e * (.5 - Math.random())
  41018. },
  41019. degToRad: (S = Math.PI / 180,
  41020. function(e) {
  41021. return e * S
  41022. }
  41023. ),
  41024. radToDeg: (x = 180 / Math.PI,
  41025. function(e) {
  41026. return e * x
  41027. }
  41028. ),
  41029. isPowerOfTwo: function(e) {
  41030. return 0 == (e & e - 1) && 0 !== e
  41031. },
  41032. nearestPowerOfTwo: function(e) {
  41033. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  41034. },
  41035. nextPowerOfTwo: function(e) {
  41036. return e--,
  41037. e |= e >> 1,
  41038. e |= e >> 2,
  41039. e |= e >> 4,
  41040. e |= e >> 8,
  41041. e |= e >> 16,
  41042. ++e
  41043. }
  41044. },
  41045. Ci.Spline = function(e) {
  41046. function t(e, t, i, n, r, o, a) {
  41047. var s = .5 * (i - e)
  41048. , l = .5 * (n - t);
  41049. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  41050. }
  41051. this.points = e;
  41052. var i, n, r, o, a, s, l, c, h, u = [], d = {
  41053. x: 0,
  41054. y: 0,
  41055. z: 0
  41056. };
  41057. this.initFromArray = function(e) {
  41058. this.points = [];
  41059. for (var t = 0; t < e.length; t++)
  41060. this.points[t] = {
  41061. x: e[t][0],
  41062. y: e[t][1],
  41063. z: e[t][2]
  41064. }
  41065. }
  41066. ,
  41067. this.getPoint = function(e) {
  41068. return i = (this.points.length - 1) * e,
  41069. n = Math.floor(i),
  41070. r = i - n,
  41071. u[0] = 0 === n ? n : n - 1,
  41072. u[1] = n,
  41073. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  41074. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  41075. s = this.points[u[0]],
  41076. l = this.points[u[1]],
  41077. c = this.points[u[2]],
  41078. h = this.points[u[3]],
  41079. a = r * (o = r * r),
  41080. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  41081. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  41082. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  41083. d
  41084. }
  41085. ,
  41086. this.getControlPointsArray = function() {
  41087. var e, t, i = this.points.length, n = [];
  41088. for (e = 0; e < i; e++)
  41089. t = this.points[e],
  41090. n[e] = [t.x, t.y, t.z];
  41091. return n
  41092. }
  41093. ,
  41094. this.getLength = function(e) {
  41095. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  41096. for (h[0] = 0,
  41097. e = e || 100,
  41098. n = this.points.length * e,
  41099. l.copy(this.points[0]),
  41100. t = 1; t < n; t++)
  41101. i = t / n,
  41102. r = this.getPoint(i),
  41103. c.copy(r),
  41104. u += c.distanceTo(l),
  41105. l.copy(r),
  41106. o = (this.points.length - 1) * i,
  41107. (a = Math.floor(o)) !== s && (h[a] = u,
  41108. s = a);
  41109. return h[h.length] = u,
  41110. {
  41111. chunks: h,
  41112. total: u
  41113. }
  41114. }
  41115. ,
  41116. this.reparametrizeByArcLength = function(e) {
  41117. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  41118. for (c.push(h.copy(this.points[0]).clone()),
  41119. t = 1; t < this.points.length; t++) {
  41120. for (a = u.chunks[t] - u.chunks[t - 1],
  41121. s = Math.ceil(e * a / u.total),
  41122. r = (t - 1) / (this.points.length - 1),
  41123. o = t / (this.points.length - 1),
  41124. i = 1; i < s - 1; i++)
  41125. n = r + i * (1 / s) * (o - r),
  41126. l = this.getPoint(n),
  41127. c.push(h.copy(l).clone());
  41128. c.push(h.copy(this.points[t]).clone())
  41129. }
  41130. this.points = c
  41131. }
  41132. }
  41133. ,
  41134. Ci.Triangle = function(e, t, i) {
  41135. this.a = void 0 !== e ? e : new Ci.Vector3,
  41136. this.b = void 0 !== t ? t : new Ci.Vector3,
  41137. this.c = void 0 !== i ? i : new Ci.Vector3
  41138. }
  41139. ,
  41140. Ci.Triangle.normal = (T = new Ci.Vector3,
  41141. function(e, t, i, n) {
  41142. var r = n || new Ci.Vector3;
  41143. r.subVectors(i, t),
  41144. T.subVectors(e, t),
  41145. r.cross(T);
  41146. var o = r.lengthSq();
  41147. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  41148. }
  41149. ),
  41150. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  41151. b = new Ci.Vector3,
  41152. w = new Ci.Vector3,
  41153. function(e, t, i, n, r) {
  41154. _.subVectors(n, t),
  41155. b.subVectors(i, t),
  41156. w.subVectors(e, t);
  41157. var o = _.dot(_)
  41158. , a = _.dot(b)
  41159. , s = _.dot(w)
  41160. , l = b.dot(b)
  41161. , c = b.dot(w)
  41162. , h = o * l - a * a
  41163. , u = r || new Ci.Vector3;
  41164. if (0 == h)
  41165. return u.set(-2, -1, -1);
  41166. var d = 1 / h
  41167. , p = (l * s - a * c) * d
  41168. , f = (o * c - a * s) * d;
  41169. return u.set(1 - p - f, f, p)
  41170. }
  41171. ),
  41172. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  41173. function(e, t, i, n) {
  41174. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  41175. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  41176. }
  41177. ),
  41178. Ci.Triangle.prototype = {
  41179. constructor: Ci.Triangle,
  41180. set: function(e, t, i) {
  41181. return this.a.copy(e),
  41182. this.b.copy(t),
  41183. this.c.copy(i),
  41184. this
  41185. },
  41186. setFromPointsAndIndices: function(e, t, i, n) {
  41187. return this.a.copy(e[t]),
  41188. this.b.copy(e[i]),
  41189. this.c.copy(e[n]),
  41190. this
  41191. },
  41192. clone: function() {
  41193. return (new this.constructor).copy(this)
  41194. },
  41195. copy: function(e) {
  41196. return this.a.copy(e.a),
  41197. this.b.copy(e.b),
  41198. this.c.copy(e.c),
  41199. this
  41200. },
  41201. area: (C = new Ci.Vector3,
  41202. I = new Ci.Vector3,
  41203. function() {
  41204. return C.subVectors(this.c, this.b),
  41205. I.subVectors(this.a, this.b),
  41206. .5 * C.cross(I).length()
  41207. }
  41208. ),
  41209. midpoint: function(e) {
  41210. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  41211. },
  41212. normal: function(e) {
  41213. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  41214. },
  41215. plane: function(e) {
  41216. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  41217. },
  41218. barycoordFromPoint: function(e, t) {
  41219. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  41220. },
  41221. containsPoint: function(e) {
  41222. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  41223. },
  41224. equals: function(e) {
  41225. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  41226. }
  41227. },
  41228. Ci.Interpolant = function(e, t, i, n) {
  41229. this.parameterPositions = e,
  41230. this._cachedIndex = 0,
  41231. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  41232. this.sampleValues = t,
  41233. this.valueSize = i
  41234. }
  41235. ,
  41236. Ci.Interpolant.prototype = {
  41237. constructor: Ci.Interpolant,
  41238. evaluate: function(e) {
  41239. var t = this.parameterPositions
  41240. , i = this._cachedIndex
  41241. , n = t[i]
  41242. , r = t[i - 1];
  41243. e: {
  41244. t: {
  41245. var o;
  41246. i: {
  41247. n: if (!(e < n)) {
  41248. for (var a = i + 2; ; ) {
  41249. if (void 0 === n) {
  41250. if (e < r)
  41251. break n;
  41252. return i = t.length,
  41253. this._cachedIndex = i,
  41254. this.afterEnd_(i - 1, e, r)
  41255. }
  41256. if (i === a)
  41257. break;
  41258. if (r = n,
  41259. e < (n = t[++i]))
  41260. break t
  41261. }
  41262. o = t.length;
  41263. break i
  41264. }
  41265. if (r <= e)
  41266. break e;
  41267. var s = t[1];
  41268. e < s && (i = 2,
  41269. r = s);
  41270. for (a = i - 2; ; ) {
  41271. if (void 0 === r)
  41272. return this._cachedIndex = 0,
  41273. this.beforeStart_(0, e, n);
  41274. if (i === a)
  41275. break;
  41276. if (n = r,
  41277. (r = t[--i - 1]) <= e)
  41278. break t
  41279. }
  41280. o = i,
  41281. i = 0
  41282. }
  41283. for (; i < o; ) {
  41284. var l = i + o >>> 1;
  41285. e < t[l] ? o = l : i = 1 + l
  41286. }
  41287. if (n = t[i],
  41288. void 0 === (r = t[i - 1]))
  41289. return this._cachedIndex = 0,
  41290. this.beforeStart_(0, e, n);
  41291. if (void 0 === n)
  41292. return i = t.length,
  41293. this._cachedIndex = i,
  41294. this.afterEnd_(i - 1, r, e)
  41295. }
  41296. this._cachedIndex = i,
  41297. this.intervalChanged_(i, r, n)
  41298. }
  41299. return this.interpolate_(i, r, e, n)
  41300. },
  41301. settings: null,
  41302. DefaultSettings_: {},
  41303. getSettings_: function() {
  41304. return this.settings || this.DefaultSettings_
  41305. },
  41306. copySampleValue_: function(e) {
  41307. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  41308. t[o] = i[r + o];
  41309. return t
  41310. },
  41311. interpolate_: function(e, t, i, n) {
  41312. throw new Error("call to abstract method")
  41313. },
  41314. intervalChanged_: function(e, t, i) {}
  41315. },
  41316. Object.assign(Ci.Interpolant.prototype, {
  41317. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  41318. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  41319. }),
  41320. Ci.CubicInterpolant = function(e, t, i, n) {
  41321. Ci.Interpolant.call(this, e, t, i, n),
  41322. this._weightPrev = -0,
  41323. this._offsetPrev = -0,
  41324. this._weightNext = -0,
  41325. this._offsetNext = -0
  41326. }
  41327. ,
  41328. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41329. constructor: Ci.CubicInterpolant,
  41330. DefaultSettings_: {
  41331. endingStart: Ci.ZeroCurvatureEnding,
  41332. endingEnd: Ci.ZeroCurvatureEnding
  41333. },
  41334. intervalChanged_: function(e, t, i) {
  41335. var n = this.parameterPositions
  41336. , r = e - 2
  41337. , o = e + 1
  41338. , a = n[r]
  41339. , s = n[o];
  41340. if (void 0 === a)
  41341. switch (this.getSettings_().endingStart) {
  41342. case Ci.ZeroSlopeEnding:
  41343. r = e,
  41344. a = 2 * t - i;
  41345. break;
  41346. case Ci.WrapAroundEnding:
  41347. a = t + n[r = n.length - 2] - n[r + 1];
  41348. break;
  41349. default:
  41350. r = e,
  41351. a = i
  41352. }
  41353. if (void 0 === s)
  41354. switch (this.getSettings_().endingEnd) {
  41355. case Ci.ZeroSlopeEnding:
  41356. o = e,
  41357. s = 2 * i - t;
  41358. break;
  41359. case Ci.WrapAroundEnding:
  41360. s = i + n[o = 1] - n[0];
  41361. break;
  41362. default:
  41363. o = e - 1,
  41364. s = t
  41365. }
  41366. var l = .5 * (i - t)
  41367. , c = this.valueSize;
  41368. this._weightPrev = l / (t - a),
  41369. this._weightNext = l / (s - i),
  41370. this._offsetPrev = r * c,
  41371. this._offsetNext = o * c
  41372. },
  41373. interpolate_: function(e, t, i, n) {
  41374. 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, y = (-1 - d) * g + (1.5 + d) * f + .5 * p, A = d * g - d * f, C = 0; C !== a; ++C)
  41375. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  41376. return r
  41377. }
  41378. }),
  41379. Ci.DiscreteInterpolant = function(e, t, i, n) {
  41380. Ci.Interpolant.call(this, e, t, i, n)
  41381. }
  41382. ,
  41383. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41384. constructor: Ci.DiscreteInterpolant,
  41385. interpolate_: function(e, t, i, n) {
  41386. return this.copySampleValue_(e - 1)
  41387. }
  41388. }),
  41389. Ci.LinearInterpolant = function(e, t, i, n) {
  41390. Ci.Interpolant.call(this, e, t, i, n)
  41391. }
  41392. ,
  41393. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41394. constructor: Ci.LinearInterpolant,
  41395. interpolate_: function(e, t, i, n) {
  41396. 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)
  41397. r[u] = o[l + u] * h + o[s + u] * c;
  41398. return r
  41399. }
  41400. }),
  41401. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  41402. Ci.Interpolant.call(this, e, t, i, n)
  41403. }
  41404. ,
  41405. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41406. constructor: Ci.QuaternionLinearInterpolant,
  41407. interpolate_: function(e, t, i, n) {
  41408. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = (i - t) / (n - t), c = s + a; s !== c; s += 4)
  41409. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  41410. return r
  41411. }
  41412. }),
  41413. Ci.Clock = function(e) {
  41414. this.autoStart = void 0 === e || e,
  41415. this.startTime = 0,
  41416. this.oldTime = 0,
  41417. this.elapsedTime = 0,
  41418. this.running = !1
  41419. }
  41420. ,
  41421. Ci.Clock.prototype = {
  41422. constructor: Ci.Clock,
  41423. start: function() {
  41424. this.startTime = performance.now(),
  41425. this.oldTime = this.startTime,
  41426. this.running = !0
  41427. },
  41428. stop: function() {
  41429. this.getElapsedTime(),
  41430. this.running = !1
  41431. },
  41432. getElapsedTime: function() {
  41433. return this.getDelta(),
  41434. this.elapsedTime
  41435. },
  41436. getDelta: function() {
  41437. var e = 0;
  41438. if (this.autoStart && !this.running && this.start(),
  41439. this.running) {
  41440. var t = performance.now();
  41441. e = .001 * (t - this.oldTime),
  41442. this.oldTime = t,
  41443. this.elapsedTime += e
  41444. }
  41445. return e
  41446. }
  41447. },
  41448. Ci.EventDispatcher = function() {}
  41449. ,
  41450. Ci.EventDispatcher.prototype = {
  41451. constructor: Ci.EventDispatcher,
  41452. apply: function(e) {
  41453. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  41454. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  41455. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  41456. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  41457. },
  41458. addEventListener: function(e, t) {
  41459. void 0 === this._listeners && (this._listeners = {});
  41460. var i = this._listeners;
  41461. void 0 === i[e] && (i[e] = []),
  41462. -1 === i[e].indexOf(t) && i[e].push(t)
  41463. },
  41464. hasEventListener: function(e, t) {
  41465. if (void 0 === this._listeners)
  41466. return !1;
  41467. var i = this._listeners;
  41468. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  41469. },
  41470. removeEventListener: function(e, t) {
  41471. if (void 0 !== this._listeners) {
  41472. var i = this._listeners[e];
  41473. if (void 0 !== i) {
  41474. var n = i.indexOf(t);
  41475. -1 !== n && i.splice(n, 1)
  41476. }
  41477. }
  41478. },
  41479. dispatchEvent: function(e) {
  41480. if (void 0 !== this._listeners) {
  41481. var t = this._listeners[e.type];
  41482. if (void 0 !== t) {
  41483. e.target = this;
  41484. for (var i = [], n = t.length, r = 0; r < n; r++)
  41485. i[r] = t[r];
  41486. for (r = 0; r < n; r++)
  41487. i[r].call(this, e)
  41488. }
  41489. }
  41490. }
  41491. },
  41492. Ci.Layers = function() {
  41493. this.mask = 1
  41494. }
  41495. ,
  41496. Ci.Layers.prototype = {
  41497. constructor: Ci.Layers,
  41498. set: function(e) {
  41499. this.mask = 1 << e
  41500. },
  41501. enable: function(e) {
  41502. this.mask |= 1 << e
  41503. },
  41504. toggle: function(e) {
  41505. this.mask ^= 1 << e
  41506. },
  41507. disable: function(e) {
  41508. this.mask &= ~(1 << e)
  41509. },
  41510. test: function(e) {
  41511. return 0 != (this.mask & e.mask)
  41512. }
  41513. },
  41514. (A = Ci).Raycaster = function(e, t, i, n) {
  41515. this.ray = new A.Ray(e,t),
  41516. this.near = i || 0,
  41517. this.far = n || 1 / 0,
  41518. this.params = {
  41519. Mesh: {},
  41520. Line: {},
  41521. LOD: {},
  41522. Points: {
  41523. threshold: 1
  41524. },
  41525. Sprite: {}
  41526. },
  41527. Object.defineProperties(this.params, {
  41528. PointCloud: {
  41529. get: function() {
  41530. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  41531. this.Points
  41532. }
  41533. }
  41534. })
  41535. }
  41536. ,
  41537. A.Raycaster.prototype = {
  41538. constructor: A.Raycaster,
  41539. linePrecision: 1,
  41540. set: function(e, t) {
  41541. this.ray.set(e, t)
  41542. },
  41543. setFromCamera: function(e, t) {
  41544. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  41545. this.ray.direction.set(e.x, e.y, .5).unproject(t).sub(this.ray.origin).normalize()) : t instanceof A.OrthographicCamera ? (this.ray.origin.set(e.x, e.y, -1).unproject(t),
  41546. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  41547. },
  41548. intersectObject: function(e, t) {
  41549. var i = [];
  41550. return Ei(e, this, i, t),
  41551. i.sort(Ii),
  41552. i
  41553. },
  41554. intersectObjects: function(e, t) {
  41555. var i = [];
  41556. if (!1 === Array.isArray(e))
  41557. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  41558. i;
  41559. for (var n = 0, r = e.length; n < r; n++)
  41560. Ei(e[n], this, i, t);
  41561. return i.sort(Ii),
  41562. i
  41563. }
  41564. },
  41565. Ci.Object3D = function() {
  41566. Object.defineProperty(this, "id", {
  41567. value: Ci.Object3DIdCount++
  41568. }),
  41569. this.uuid = Ci.Math.generateUUID(),
  41570. this.name = "",
  41571. this.type = "Object3D",
  41572. this.parent = null,
  41573. this.children = [],
  41574. this.up = Ci.Object3D.DefaultUp.clone();
  41575. var e = new Ci.Vector3
  41576. , t = new Ci.Euler
  41577. , i = new Ci.Quaternion
  41578. , n = new Ci.Vector3(1,1,1);
  41579. t.onChange(function() {
  41580. i.setFromEuler(t, !1)
  41581. }),
  41582. i.onChange(function() {
  41583. t.setFromQuaternion(i, void 0, !1)
  41584. }),
  41585. Object.defineProperties(this, {
  41586. position: {
  41587. enumerable: !0,
  41588. value: e
  41589. },
  41590. rotation: {
  41591. enumerable: !0,
  41592. value: t
  41593. },
  41594. quaternion: {
  41595. enumerable: !0,
  41596. value: i
  41597. },
  41598. scale: {
  41599. enumerable: !0,
  41600. value: n
  41601. },
  41602. modelViewMatrix: {
  41603. value: new Ci.Matrix4
  41604. },
  41605. normalMatrix: {
  41606. value: new Ci.Matrix3
  41607. }
  41608. }),
  41609. this.rotationAutoUpdate = !0,
  41610. this.matrix = new Ci.Matrix4,
  41611. this.matrixWorld = new Ci.Matrix4,
  41612. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  41613. this.matrixWorldNeedsUpdate = !1,
  41614. this.layers = new Ci.Layers,
  41615. this.visible = !0,
  41616. this.castShadow = !1,
  41617. this.receiveShadow = !1,
  41618. this.frustumCulled = !0,
  41619. this.renderOrder = 0,
  41620. this.userData = {}
  41621. }
  41622. ,
  41623. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  41624. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  41625. Ci.Object3D.prototype = {
  41626. constructor: Ci.Object3D,
  41627. applyMatrix: function(e) {
  41628. this.matrix.multiplyMatrices(e, this.matrix),
  41629. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41630. },
  41631. setRotationFromAxisAngle: function(e, t) {
  41632. this.quaternion.setFromAxisAngle(e, t)
  41633. },
  41634. setRotationFromEuler: function(e) {
  41635. this.quaternion.setFromEuler(e, !0)
  41636. },
  41637. setRotationFromMatrix: function(e) {
  41638. this.quaternion.setFromRotationMatrix(e)
  41639. },
  41640. setRotationFromQuaternion: function(e) {
  41641. this.quaternion.copy(e)
  41642. },
  41643. rotateOnAxis: (y = new Ci.Quaternion,
  41644. function(e, t) {
  41645. return y.setFromAxisAngle(e, t),
  41646. this.quaternion.multiply(y),
  41647. this
  41648. }
  41649. ),
  41650. rotateX: (v = new Ci.Vector3(1,0,0),
  41651. function(e) {
  41652. return this.rotateOnAxis(v, e)
  41653. }
  41654. ),
  41655. rotateY: (m = new Ci.Vector3(0,1,0),
  41656. function(e) {
  41657. return this.rotateOnAxis(m, e)
  41658. }
  41659. ),
  41660. rotateZ: (g = new Ci.Vector3(0,0,1),
  41661. function(e) {
  41662. return this.rotateOnAxis(g, e)
  41663. }
  41664. ),
  41665. translateOnAxis: (f = new Ci.Vector3,
  41666. function(e, t) {
  41667. return f.copy(e).applyQuaternion(this.quaternion),
  41668. this.position.add(f.multiplyScalar(t)),
  41669. this
  41670. }
  41671. ),
  41672. translateX: (p = new Ci.Vector3(1,0,0),
  41673. function(e) {
  41674. return this.translateOnAxis(p, e)
  41675. }
  41676. ),
  41677. translateY: (d = new Ci.Vector3(0,1,0),
  41678. function(e) {
  41679. return this.translateOnAxis(d, e)
  41680. }
  41681. ),
  41682. translateZ: (u = new Ci.Vector3(0,0,1),
  41683. function(e) {
  41684. return this.translateOnAxis(u, e)
  41685. }
  41686. ),
  41687. localToWorld: function(e) {
  41688. return e.applyMatrix4(this.matrixWorld)
  41689. },
  41690. worldToLocal: (h = new Ci.Matrix4,
  41691. function(e) {
  41692. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  41693. }
  41694. ),
  41695. lookAt: (c = new Ci.Matrix4,
  41696. function(e) {
  41697. c.lookAt(e, this.position, this.up),
  41698. this.quaternion.setFromRotationMatrix(c)
  41699. }
  41700. ),
  41701. add: function(e) {
  41702. if (1 < arguments.length) {
  41703. for (var t = 0; t < arguments.length; t++)
  41704. this.add(arguments[t]);
  41705. return this
  41706. }
  41707. return e === this ? console.error("THREE.Object3D.add: object can't be added as a child of itself.", e) : e instanceof Ci.Object3D ? (null !== e.parent && e.parent.remove(e),
  41708. e.parent = this,
  41709. e.dispatchEvent({
  41710. type: "added"
  41711. }),
  41712. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41713. this
  41714. },
  41715. remove: function(e) {
  41716. if (1 < arguments.length)
  41717. for (var t = 0; t < arguments.length; t++)
  41718. this.remove(arguments[t]);
  41719. var i = this.children.indexOf(e);
  41720. -1 !== i && (e.parent = null,
  41721. e.dispatchEvent({
  41722. type: "removed"
  41723. }),
  41724. this.children.splice(i, 1))
  41725. },
  41726. getObjectById: function(e) {
  41727. return this.getObjectByProperty("id", e)
  41728. },
  41729. getObjectByName: function(e) {
  41730. return this.getObjectByProperty("name", e)
  41731. },
  41732. getObjectByProperty: function(e, t) {
  41733. if (this[e] === t)
  41734. return this;
  41735. for (var i = 0, n = this.children.length; i < n; i++) {
  41736. var r = this.children[i].getObjectByProperty(e, t);
  41737. if (void 0 !== r)
  41738. return r
  41739. }
  41740. },
  41741. getWorldPosition: function(e) {
  41742. var t = e || new Ci.Vector3;
  41743. return this.updateMatrixWorld(!0),
  41744. t.setFromMatrixPosition(this.matrixWorld)
  41745. },
  41746. getWorldQuaternion: (s = new Ci.Vector3,
  41747. l = new Ci.Vector3,
  41748. function(e) {
  41749. var t = e || new Ci.Quaternion;
  41750. return this.updateMatrixWorld(!0),
  41751. this.matrixWorld.decompose(s, t, l),
  41752. t
  41753. }
  41754. ),
  41755. getWorldRotation: (a = new Ci.Quaternion,
  41756. function(e) {
  41757. var t = e || new Ci.Euler;
  41758. return this.getWorldQuaternion(a),
  41759. t.setFromQuaternion(a, this.rotation.order, !1)
  41760. }
  41761. ),
  41762. getWorldScale: (r = new Ci.Vector3,
  41763. o = new Ci.Quaternion,
  41764. function(e) {
  41765. var t = e || new Ci.Vector3;
  41766. return this.updateMatrixWorld(!0),
  41767. this.matrixWorld.decompose(r, o, t),
  41768. t
  41769. }
  41770. ),
  41771. getWorldDirection: (n = new Ci.Quaternion,
  41772. function(e) {
  41773. var t = e || new Ci.Vector3;
  41774. return this.getWorldQuaternion(n),
  41775. t.set(0, 0, 1).applyQuaternion(n)
  41776. }
  41777. ),
  41778. raycast: function() {},
  41779. traverse: function(e) {
  41780. e(this);
  41781. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41782. t[i].traverse(e)
  41783. },
  41784. traverseVisible: function(e) {
  41785. if (!1 !== this.visible) {
  41786. e(this);
  41787. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41788. t[i].traverseVisible(e)
  41789. }
  41790. },
  41791. traverseAncestors: function(e) {
  41792. var t = this.parent;
  41793. null !== t && (e(t),
  41794. t.traverseAncestors(e))
  41795. },
  41796. updateMatrix: function() {
  41797. this.matrix.compose(this.position, this.quaternion, this.scale),
  41798. this.matrixWorldNeedsUpdate = !0
  41799. },
  41800. updateMatrixWorld: function(e) {
  41801. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41802. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41803. e = !(this.matrixWorldNeedsUpdate = !1));
  41804. for (var t = 0, i = this.children.length; t < i; t++)
  41805. this.children[t].updateMatrixWorld(e)
  41806. },
  41807. toJSON: function(e) {
  41808. function t(e) {
  41809. var t = [];
  41810. for (var i in e) {
  41811. var n = e[i];
  41812. delete n.metadata,
  41813. t.push(n)
  41814. }
  41815. return t
  41816. }
  41817. var i = void 0 === e
  41818. , n = {};
  41819. i && (e = {
  41820. geometries: {},
  41821. materials: {},
  41822. textures: {},
  41823. images: {}
  41824. },
  41825. n.metadata = {
  41826. version: 4.4,
  41827. type: "Object",
  41828. generator: "Object3D.toJSON"
  41829. });
  41830. var r = {};
  41831. if (r.uuid = this.uuid,
  41832. r.type = this.type,
  41833. "" !== this.name && (r.name = this.name),
  41834. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41835. !0 === this.castShadow && (r.castShadow = !0),
  41836. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41837. !1 === this.visible && (r.visible = !1),
  41838. r.matrix = this.matrix.toArray(),
  41839. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41840. r.geometry = this.geometry.uuid),
  41841. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41842. r.material = this.material.uuid),
  41843. 0 < this.children.length) {
  41844. r.children = [];
  41845. for (var o = 0; o < this.children.length; o++)
  41846. r.children.push(this.children[o].toJSON(e).object)
  41847. }
  41848. if (i) {
  41849. var a = t(e.geometries)
  41850. , s = t(e.materials)
  41851. , l = t(e.textures)
  41852. , c = t(e.images);
  41853. 0 < a.length && (n.geometries = a),
  41854. 0 < s.length && (n.materials = s),
  41855. 0 < l.length && (n.textures = l),
  41856. 0 < c.length && (n.images = c)
  41857. }
  41858. return n.object = r,
  41859. n
  41860. },
  41861. clone: function(e) {
  41862. return (new this.constructor).copy(this, e)
  41863. },
  41864. copy: function(e, t) {
  41865. if (void 0 === t && (t = !0),
  41866. this.name = e.name,
  41867. this.up.copy(e.up),
  41868. this.position.copy(e.position),
  41869. this.quaternion.copy(e.quaternion),
  41870. this.scale.copy(e.scale),
  41871. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41872. this.matrix.copy(e.matrix),
  41873. this.matrixWorld.copy(e.matrixWorld),
  41874. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41875. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41876. this.visible = e.visible,
  41877. this.castShadow = e.castShadow,
  41878. this.receiveShadow = e.receiveShadow,
  41879. this.frustumCulled = e.frustumCulled,
  41880. this.renderOrder = e.renderOrder,
  41881. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41882. !0 === t)
  41883. for (var i = 0; i < e.children.length; i++) {
  41884. var n = e.children[i];
  41885. this.add(n.clone())
  41886. }
  41887. return this
  41888. }
  41889. },
  41890. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41891. Ci.Object3DIdCount = 0,
  41892. Ci.Face3 = function(e, t, i, n, r, o) {
  41893. this.a = e,
  41894. this.b = t,
  41895. this.c = i,
  41896. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41897. this.vertexNormals = Array.isArray(n) ? n : [],
  41898. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41899. this.vertexColors = Array.isArray(r) ? r : [],
  41900. this.materialIndex = void 0 !== o ? o : 0
  41901. }
  41902. ,
  41903. Ci.Face3.prototype = {
  41904. constructor: Ci.Face3,
  41905. clone: function() {
  41906. return (new this.constructor).copy(this)
  41907. },
  41908. copy: function(e) {
  41909. this.a = e.a,
  41910. this.b = e.b,
  41911. this.c = e.c,
  41912. this.normal.copy(e.normal),
  41913. this.color.copy(e.color),
  41914. this.materialIndex = e.materialIndex;
  41915. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41916. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41917. for (t = 0,
  41918. i = e.vertexColors.length; t < i; t++)
  41919. this.vertexColors[t] = e.vertexColors[t].clone();
  41920. return this
  41921. }
  41922. },
  41923. Ci.BufferAttribute = function(e, t) {
  41924. this.uuid = Ci.Math.generateUUID(),
  41925. this.array = e,
  41926. this.itemSize = t,
  41927. this.dynamic = !1,
  41928. this.updateRange = {
  41929. offset: 0,
  41930. count: -1
  41931. },
  41932. this.version = 0
  41933. }
  41934. ,
  41935. Ci.BufferAttribute.prototype = {
  41936. constructor: Ci.BufferAttribute,
  41937. get count() {
  41938. return this.array.length / this.itemSize
  41939. },
  41940. set needsUpdate(e) {
  41941. !0 === e && this.version++
  41942. },
  41943. setDynamic: function(e) {
  41944. return this.dynamic = e,
  41945. this
  41946. },
  41947. copy: function(e) {
  41948. return this.array = new e.array.constructor(e.array),
  41949. this.itemSize = e.itemSize,
  41950. this.dynamic = e.dynamic,
  41951. this
  41952. },
  41953. copyAt: function(e, t, i) {
  41954. e *= this.itemSize,
  41955. i *= t.itemSize;
  41956. for (var n = 0, r = this.itemSize; n < r; n++)
  41957. this.array[e + n] = t.array[i + n];
  41958. return this
  41959. },
  41960. copyArray: function(e) {
  41961. return this.array.set(e),
  41962. this
  41963. },
  41964. copyColorsArray: function(e) {
  41965. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41966. var o = e[n];
  41967. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  41968. o = new Ci.Color),
  41969. t[i++] = o.r,
  41970. t[i++] = o.g,
  41971. t[i++] = o.b
  41972. }
  41973. return this
  41974. },
  41975. copyIndicesArray: function(e) {
  41976. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41977. var o = e[n];
  41978. t[i++] = o.a,
  41979. t[i++] = o.b,
  41980. t[i++] = o.c
  41981. }
  41982. return this
  41983. },
  41984. copyVector2sArray: function(e) {
  41985. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41986. var o = e[n];
  41987. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  41988. o = new Ci.Vector2),
  41989. t[i++] = o.x,
  41990. t[i++] = o.y
  41991. }
  41992. return this
  41993. },
  41994. copyVector3sArray: function(e) {
  41995. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41996. var o = e[n];
  41997. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  41998. o = new Ci.Vector3),
  41999. t[i++] = o.x,
  42000. t[i++] = o.y,
  42001. t[i++] = o.z
  42002. }
  42003. return this
  42004. },
  42005. copyVector4sArray: function(e) {
  42006. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  42007. var o = e[n];
  42008. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  42009. o = new Ci.Vector4),
  42010. t[i++] = o.x,
  42011. t[i++] = o.y,
  42012. t[i++] = o.z,
  42013. t[i++] = o.w
  42014. }
  42015. return this
  42016. },
  42017. set: function(e, t) {
  42018. return void 0 === t && (t = 0),
  42019. this.array.set(e, t),
  42020. this
  42021. },
  42022. getX: function(e) {
  42023. return this.array[e * this.itemSize]
  42024. },
  42025. setX: function(e, t) {
  42026. return this.array[e * this.itemSize] = t,
  42027. this
  42028. },
  42029. getY: function(e) {
  42030. return this.array[e * this.itemSize + 1]
  42031. },
  42032. setY: function(e, t) {
  42033. return this.array[e * this.itemSize + 1] = t,
  42034. this
  42035. },
  42036. getZ: function(e) {
  42037. return this.array[e * this.itemSize + 2]
  42038. },
  42039. setZ: function(e, t) {
  42040. return this.array[e * this.itemSize + 2] = t,
  42041. this
  42042. },
  42043. getW: function(e) {
  42044. return this.array[e * this.itemSize + 3]
  42045. },
  42046. setW: function(e, t) {
  42047. return this.array[e * this.itemSize + 3] = t,
  42048. this
  42049. },
  42050. setXY: function(e, t, i) {
  42051. return e *= this.itemSize,
  42052. this.array[e + 0] = t,
  42053. this.array[e + 1] = i,
  42054. this
  42055. },
  42056. setXYZ: function(e, t, i, n) {
  42057. return e *= this.itemSize,
  42058. this.array[e + 0] = t,
  42059. this.array[e + 1] = i,
  42060. this.array[e + 2] = n,
  42061. this
  42062. },
  42063. setXYZW: function(e, t, i, n, r) {
  42064. return e *= this.itemSize,
  42065. this.array[e + 0] = t,
  42066. this.array[e + 1] = i,
  42067. this.array[e + 2] = n,
  42068. this.array[e + 3] = r,
  42069. this
  42070. },
  42071. clone: function() {
  42072. return (new this.constructor).copy(this)
  42073. }
  42074. },
  42075. Ci.Int8Attribute = function(e, t) {
  42076. return new Ci.BufferAttribute(new Int8Array(e),t)
  42077. }
  42078. ,
  42079. Ci.Uint8Attribute = function(e, t) {
  42080. return new Ci.BufferAttribute(new Uint8Array(e),t)
  42081. }
  42082. ,
  42083. Ci.Uint8ClampedAttribute = function(e, t) {
  42084. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  42085. }
  42086. ,
  42087. Ci.Int16Attribute = function(e, t) {
  42088. return new Ci.BufferAttribute(new Int16Array(e),t)
  42089. }
  42090. ,
  42091. Ci.Uint16Attribute = function(e, t) {
  42092. return new Ci.BufferAttribute(new Uint16Array(e),t)
  42093. }
  42094. ,
  42095. Ci.Int32Attribute = function(e, t) {
  42096. return new Ci.BufferAttribute(new Int32Array(e),t)
  42097. }
  42098. ,
  42099. Ci.Uint32Attribute = function(e, t) {
  42100. return new Ci.BufferAttribute(new Uint32Array(e),t)
  42101. }
  42102. ,
  42103. Ci.Float32Attribute = function(e, t) {
  42104. return new Ci.BufferAttribute(new Float32Array(e),t)
  42105. }
  42106. ,
  42107. Ci.Float64Attribute = function(e, t) {
  42108. return new Ci.BufferAttribute(new Float64Array(e),t)
  42109. }
  42110. ,
  42111. Ci.DynamicBufferAttribute = function(e, t) {
  42112. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  42113. new Ci.BufferAttribute(e,t).setDynamic(!0)
  42114. }
  42115. ,
  42116. Ci.InstancedBufferAttribute = function(e, t, i) {
  42117. Ci.BufferAttribute.call(this, e, t),
  42118. this.meshPerAttribute = i || 1
  42119. }
  42120. ,
  42121. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  42122. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  42123. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  42124. return Ci.BufferAttribute.prototype.copy.call(this, e),
  42125. this.meshPerAttribute = e.meshPerAttribute,
  42126. this
  42127. }
  42128. ,
  42129. Ci.InterleavedBuffer = function(e, t) {
  42130. this.uuid = Ci.Math.generateUUID(),
  42131. this.array = e,
  42132. this.stride = t,
  42133. this.dynamic = !1,
  42134. this.updateRange = {
  42135. offset: 0,
  42136. count: -1
  42137. },
  42138. this.version = 0
  42139. }
  42140. ,
  42141. Ci.InterleavedBuffer.prototype = {
  42142. constructor: Ci.InterleavedBuffer,
  42143. get length() {
  42144. return this.array.length
  42145. },
  42146. get count() {
  42147. return this.array.length / this.stride
  42148. },
  42149. set needsUpdate(e) {
  42150. !0 === e && this.version++
  42151. },
  42152. setDynamic: function(e) {
  42153. return this.dynamic = e,
  42154. this
  42155. },
  42156. copy: function(e) {
  42157. return this.array = new e.array.constructor(e.array),
  42158. this.stride = e.stride,
  42159. this.dynamic = e.dynamic,
  42160. this
  42161. },
  42162. copyAt: function(e, t, i) {
  42163. e *= this.stride,
  42164. i *= t.stride;
  42165. for (var n = 0, r = this.stride; n < r; n++)
  42166. this.array[e + n] = t.array[i + n];
  42167. return this
  42168. },
  42169. set: function(e, t) {
  42170. return void 0 === t && (t = 0),
  42171. this.array.set(e, t),
  42172. this
  42173. },
  42174. clone: function() {
  42175. return (new this.constructor).copy(this)
  42176. }
  42177. },
  42178. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  42179. Ci.InterleavedBuffer.call(this, e, t),
  42180. this.meshPerAttribute = i || 1
  42181. }
  42182. ,
  42183. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  42184. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  42185. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  42186. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  42187. this.meshPerAttribute = e.meshPerAttribute,
  42188. this
  42189. }
  42190. ,
  42191. Ci.InterleavedBufferAttribute = function(e, t, i) {
  42192. this.uuid = Ci.Math.generateUUID(),
  42193. this.data = e,
  42194. this.itemSize = t,
  42195. this.offset = i
  42196. }
  42197. ,
  42198. Ci.InterleavedBufferAttribute.prototype = {
  42199. constructor: Ci.InterleavedBufferAttribute,
  42200. get length() {
  42201. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  42202. this.array.length
  42203. },
  42204. get count() {
  42205. return this.data.count
  42206. },
  42207. setX: function(e, t) {
  42208. return this.data.array[e * this.data.stride + this.offset] = t,
  42209. this
  42210. },
  42211. setY: function(e, t) {
  42212. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  42213. this
  42214. },
  42215. setZ: function(e, t) {
  42216. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  42217. this
  42218. },
  42219. setW: function(e, t) {
  42220. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  42221. this
  42222. },
  42223. getX: function(e) {
  42224. return this.data.array[e * this.data.stride + this.offset]
  42225. },
  42226. getY: function(e) {
  42227. return this.data.array[e * this.data.stride + this.offset + 1]
  42228. },
  42229. getZ: function(e) {
  42230. return this.data.array[e * this.data.stride + this.offset + 2]
  42231. },
  42232. getW: function(e) {
  42233. return this.data.array[e * this.data.stride + this.offset + 3]
  42234. },
  42235. setXY: function(e, t, i) {
  42236. return e = e * this.data.stride + this.offset,
  42237. this.data.array[e + 0] = t,
  42238. this.data.array[e + 1] = i,
  42239. this
  42240. },
  42241. setXYZ: function(e, t, i, n) {
  42242. return e = e * this.data.stride + this.offset,
  42243. this.data.array[e + 0] = t,
  42244. this.data.array[e + 1] = i,
  42245. this.data.array[e + 2] = n,
  42246. this
  42247. },
  42248. setXYZW: function(e, t, i, n, r) {
  42249. return e = e * this.data.stride + this.offset,
  42250. this.data.array[e + 0] = t,
  42251. this.data.array[e + 1] = i,
  42252. this.data.array[e + 2] = n,
  42253. this.data.array[e + 3] = r,
  42254. this
  42255. }
  42256. },
  42257. Ci.Geometry = function() {
  42258. Object.defineProperty(this, "id", {
  42259. value: Ci.GeometryIdCount++
  42260. }),
  42261. this.uuid = Ci.Math.generateUUID(),
  42262. this.name = "",
  42263. this.type = "Geometry",
  42264. this.vertices = [],
  42265. this.colors = [],
  42266. this.faces = [],
  42267. this.faceVertexUvs = [[]],
  42268. this.morphTargets = [],
  42269. this.morphNormals = [],
  42270. this.skinWeights = [],
  42271. this.skinIndices = [],
  42272. this.lineDistances = [],
  42273. this.boundingBox = null,
  42274. this.boundingSphere = null,
  42275. this.verticesNeedUpdate = !1,
  42276. this.elementsNeedUpdate = !1,
  42277. this.uvsNeedUpdate = !1,
  42278. this.normalsNeedUpdate = !1,
  42279. this.colorsNeedUpdate = !1,
  42280. this.lineDistancesNeedUpdate = !1,
  42281. this.groupsNeedUpdate = !1
  42282. }
  42283. ,
  42284. Ci.Geometry.prototype = {
  42285. constructor: Ci.Geometry,
  42286. applyMatrix: function(e) {
  42287. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  42288. this.vertices[i].applyMatrix4(e)
  42289. }
  42290. for (i = 0,
  42291. n = this.faces.length; i < n; i++) {
  42292. var r = this.faces[i];
  42293. r.normal.applyMatrix3(t).normalize();
  42294. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  42295. r.vertexNormals[o].applyMatrix3(t).normalize()
  42296. }
  42297. return null !== this.boundingBox && this.computeBoundingBox(),
  42298. null !== this.boundingSphere && this.computeBoundingSphere(),
  42299. this.verticesNeedUpdate = !0,
  42300. this.normalsNeedUpdate = !0,
  42301. this
  42302. },
  42303. rotateX: function(e) {
  42304. return void 0 === mt && (mt = new Ci.Matrix4),
  42305. mt.makeRotationX(e),
  42306. this.applyMatrix(mt),
  42307. this
  42308. },
  42309. rotateY: function(e) {
  42310. return void 0 === gt && (gt = new Ci.Matrix4),
  42311. gt.makeRotationY(e),
  42312. this.applyMatrix(gt),
  42313. this
  42314. },
  42315. rotateZ: function(e) {
  42316. return void 0 === ft && (ft = new Ci.Matrix4),
  42317. ft.makeRotationZ(e),
  42318. this.applyMatrix(ft),
  42319. this
  42320. },
  42321. translate: function(e, t, i) {
  42322. return void 0 === pt && (pt = new Ci.Matrix4),
  42323. pt.makeTranslation(e, t, i),
  42324. this.applyMatrix(pt),
  42325. this
  42326. },
  42327. scale: function(e, t, i) {
  42328. return void 0 === dt && (dt = new Ci.Matrix4),
  42329. dt.makeScale(e, t, i),
  42330. this.applyMatrix(dt),
  42331. this
  42332. },
  42333. lookAt: function(e) {
  42334. void 0 === ut && (ut = new Ci.Object3D),
  42335. ut.lookAt(e),
  42336. ut.updateMatrix(),
  42337. this.applyMatrix(ut.matrix)
  42338. },
  42339. fromBufferGeometry: function(e) {
  42340. function t(e, t, i, n) {
  42341. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  42342. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  42343. , a = new Ci.Face3(e,t,i,r,o,n);
  42344. s.faces.push(a),
  42345. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  42346. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  42347. }
  42348. var s = this
  42349. , i = null !== e.index ? e.index.array : void 0
  42350. , n = e.attributes
  42351. , r = n.position.array
  42352. , l = void 0 !== n.normal ? n.normal.array : void 0
  42353. , c = void 0 !== n.color ? n.color.array : void 0
  42354. , h = void 0 !== n.uv ? n.uv.array : void 0
  42355. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  42356. void 0 !== u && (this.faceVertexUvs[1] = []);
  42357. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  42358. a += 2)
  42359. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  42360. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  42361. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  42362. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  42363. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  42364. if (void 0 !== i) {
  42365. var g = e.groups;
  42366. if (0 < g.length)
  42367. for (o = 0; o < g.length; o++)
  42368. for (var m = g[o], v = m.start, y = (a = v,
  42369. v + m.count); a < y; a += 3)
  42370. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  42371. else
  42372. for (o = 0; o < i.length; o += 3)
  42373. t(i[o], i[o + 1], i[o + 2])
  42374. } else
  42375. for (o = 0; o < r.length / 3; o += 3)
  42376. t(o, o + 1, o + 2);
  42377. return this.computeFaceNormals(),
  42378. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42379. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42380. this
  42381. },
  42382. center: function() {
  42383. this.computeBoundingBox();
  42384. var e = this.boundingBox.center().negate();
  42385. return this.translate(e.x, e.y, e.z),
  42386. e
  42387. },
  42388. normalize: function() {
  42389. this.computeBoundingSphere();
  42390. var e = this.boundingSphere.center
  42391. , t = this.boundingSphere.radius
  42392. , i = 0 === t ? 1 : 1 / t
  42393. , n = new Ci.Matrix4;
  42394. return n.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  42395. this.applyMatrix(n),
  42396. this
  42397. },
  42398. computeFaceNormals: function() {
  42399. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  42400. var r = this.faces[i]
  42401. , o = this.vertices[r.a]
  42402. , a = this.vertices[r.b]
  42403. , s = this.vertices[r.c];
  42404. e.subVectors(s, a),
  42405. t.subVectors(o, a),
  42406. e.cross(t),
  42407. e.normalize(),
  42408. r.normal.copy(e)
  42409. }
  42410. },
  42411. computeVertexNormals: function(e) {
  42412. var t, i, n, r, o, a;
  42413. for (void 0 === e && (e = !0),
  42414. a = new Array(this.vertices.length),
  42415. t = 0,
  42416. i = this.vertices.length; t < i; t++)
  42417. a[t] = new Ci.Vector3;
  42418. if (e) {
  42419. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  42420. for (n = 0,
  42421. r = this.faces.length; n < r; n++)
  42422. o = this.faces[n],
  42423. s = this.vertices[o.a],
  42424. l = this.vertices[o.b],
  42425. c = this.vertices[o.c],
  42426. h.subVectors(c, l),
  42427. u.subVectors(s, l),
  42428. h.cross(u),
  42429. a[o.a].add(h),
  42430. a[o.b].add(h),
  42431. a[o.c].add(h)
  42432. } else
  42433. for (n = 0,
  42434. r = this.faces.length; n < r; n++)
  42435. a[(o = this.faces[n]).a].add(o.normal),
  42436. a[o.b].add(o.normal),
  42437. a[o.c].add(o.normal);
  42438. for (t = 0,
  42439. i = this.vertices.length; t < i; t++)
  42440. a[t].normalize();
  42441. for (n = 0,
  42442. r = this.faces.length; n < r; n++) {
  42443. var d = (o = this.faces[n]).vertexNormals;
  42444. 3 === d.length ? (d[0].copy(a[o.a]),
  42445. d[1].copy(a[o.b]),
  42446. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  42447. d[1] = a[o.b].clone(),
  42448. d[2] = a[o.c].clone())
  42449. }
  42450. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  42451. },
  42452. computeMorphNormals: function() {
  42453. var e, t, i, n, r;
  42454. for (i = 0,
  42455. n = this.faces.length; i < n; i++)
  42456. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  42457. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  42458. e = 0,
  42459. t = r.vertexNormals.length; e < t; e++)
  42460. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  42461. var o = new Ci.Geometry;
  42462. for (o.faces = this.faces,
  42463. e = 0,
  42464. t = this.morphTargets.length; e < t; e++) {
  42465. if (!this.morphNormals[e]) {
  42466. this.morphNormals[e] = {},
  42467. this.morphNormals[e].faceNormals = [],
  42468. this.morphNormals[e].vertexNormals = [];
  42469. var a = this.morphNormals[e].faceNormals
  42470. , s = this.morphNormals[e].vertexNormals;
  42471. for (i = 0,
  42472. n = this.faces.length; i < n; i++)
  42473. l = new Ci.Vector3,
  42474. c = {
  42475. a: new Ci.Vector3,
  42476. b: new Ci.Vector3,
  42477. c: new Ci.Vector3
  42478. },
  42479. a.push(l),
  42480. s.push(c)
  42481. }
  42482. var l, c, h = this.morphNormals[e];
  42483. for (o.vertices = this.morphTargets[e].vertices,
  42484. o.computeFaceNormals(),
  42485. o.computeVertexNormals(),
  42486. i = 0,
  42487. n = this.faces.length; i < n; i++)
  42488. r = this.faces[i],
  42489. l = h.faceNormals[i],
  42490. c = h.vertexNormals[i],
  42491. l.copy(r.normal),
  42492. c.a.copy(r.vertexNormals[0]),
  42493. c.b.copy(r.vertexNormals[1]),
  42494. c.c.copy(r.vertexNormals[2])
  42495. }
  42496. for (i = 0,
  42497. n = this.faces.length; i < n; i++)
  42498. (r = this.faces[i]).normal = r.__originalFaceNormal,
  42499. r.vertexNormals = r.__originalVertexNormals
  42500. },
  42501. computeTangents: function() {
  42502. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  42503. },
  42504. computeLineDistances: function() {
  42505. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  42506. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  42507. this.lineDistances[i] = e
  42508. },
  42509. computeBoundingBox: function() {
  42510. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  42511. this.boundingBox.setFromPoints(this.vertices)
  42512. },
  42513. computeBoundingSphere: function() {
  42514. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  42515. this.boundingSphere.setFromPoints(this.vertices)
  42516. },
  42517. merge: function(e, t, i) {
  42518. if (e instanceof Ci.Geometry != 0) {
  42519. var n, r = this.vertices.length, o = this.vertices, a = e.vertices, s = this.faces, l = e.faces, c = this.faceVertexUvs[0], h = e.faceVertexUvs[0];
  42520. void 0 === i && (i = 0),
  42521. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  42522. for (var u = 0, d = a.length; u < d; u++) {
  42523. var p = a[u].clone();
  42524. void 0 !== t && p.applyMatrix4(t),
  42525. o.push(p)
  42526. }
  42527. for (u = 0,
  42528. d = l.length; u < d; u++) {
  42529. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  42530. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  42531. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  42532. for (var C = 0, I = y.length; C < I; C++)
  42533. g = y[C].clone(),
  42534. void 0 !== n && g.applyMatrix3(n).normalize(),
  42535. f.vertexNormals.push(g);
  42536. f.color.copy(v.color);
  42537. for (C = 0,
  42538. I = A.length; C < I; C++)
  42539. m = A[C],
  42540. f.vertexColors.push(m.clone());
  42541. f.materialIndex = v.materialIndex + i,
  42542. s.push(f)
  42543. }
  42544. for (u = 0,
  42545. d = h.length; u < d; u++) {
  42546. var E = h[u]
  42547. , _ = [];
  42548. if (void 0 !== E) {
  42549. for (C = 0,
  42550. I = E.length; C < I; C++)
  42551. _.push(E[C].clone());
  42552. c.push(_)
  42553. }
  42554. }
  42555. } else
  42556. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  42557. },
  42558. mergeMesh: function(e) {
  42559. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42560. void this.merge(e.geometry, e.matrix))
  42561. },
  42562. mergeVertices: function() {
  42563. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  42564. for (i = 0,
  42565. n = this.vertices.length; i < n; i++)
  42566. e = this.vertices[i],
  42567. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  42568. c.push(this.vertices[i]),
  42569. h[i] = c.length - 1) : h[i] = h[l[t]];
  42570. var d = [];
  42571. for (i = 0,
  42572. n = this.faces.length; i < n; i++) {
  42573. (r = this.faces[i]).a = h[r.a],
  42574. r.b = h[r.b],
  42575. r.c = h[r.c],
  42576. o = [r.a, r.b, r.c];
  42577. for (var p = 0; p < 3; p++)
  42578. if (o[p] === o[(p + 1) % 3]) {
  42579. p,
  42580. d.push(i);
  42581. break
  42582. }
  42583. }
  42584. for (i = d.length - 1; 0 <= i; i--) {
  42585. var f = d[i];
  42586. for (this.faces.splice(f, 1),
  42587. a = 0,
  42588. s = this.faceVertexUvs.length; a < s; a++)
  42589. this.faceVertexUvs[a].splice(f, 1)
  42590. }
  42591. var g = this.vertices.length - c.length;
  42592. return this.vertices = c,
  42593. g
  42594. },
  42595. sortFacesByMaterialIndex: function() {
  42596. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  42597. e[i]._id = i;
  42598. e.sort(function(e, t) {
  42599. return e.materialIndex - t.materialIndex
  42600. });
  42601. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  42602. o && o.length === t && (n = []),
  42603. a && a.length === t && (r = []);
  42604. for (i = 0; i < t; i++) {
  42605. var s = e[i]._id;
  42606. n && n.push(o[s]),
  42607. r && r.push(a[s])
  42608. }
  42609. n && (this.faceVertexUvs[0] = n),
  42610. r && (this.faceVertexUvs[1] = r)
  42611. },
  42612. toJSON: function() {
  42613. function e(e, t, i) {
  42614. return i ? e | 1 << t : e & ~(1 << t)
  42615. }
  42616. function t(e) {
  42617. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42618. return void 0 !== d[t] || (d[t] = u.length / 3,
  42619. u.push(e.x, e.y, e.z)),
  42620. d[t]
  42621. }
  42622. function i(e) {
  42623. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42624. return void 0 !== f[t] || (f[t] = p.length,
  42625. p.push(e.getHex())),
  42626. f[t]
  42627. }
  42628. function n(e) {
  42629. var t = e.x.toString() + e.y.toString();
  42630. return void 0 !== m[t] || (m[t] = g.length / 2,
  42631. g.push(e.x, e.y)),
  42632. m[t]
  42633. }
  42634. var r = {
  42635. metadata: {
  42636. version: 4.4,
  42637. type: "Geometry",
  42638. generator: "Geometry.toJSON"
  42639. }
  42640. };
  42641. if (r.uuid = this.uuid,
  42642. r.type = this.type,
  42643. "" !== this.name && (r.name = this.name),
  42644. void 0 !== this.parameters) {
  42645. var o = this.parameters;
  42646. for (var a in o)
  42647. void 0 !== o[a] && (r[a] = o[a]);
  42648. return r
  42649. }
  42650. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42651. var c = this.vertices[l];
  42652. s.push(c.x, c.y, c.z)
  42653. }
  42654. var h = []
  42655. , u = []
  42656. , d = {}
  42657. , p = []
  42658. , f = {}
  42659. , g = []
  42660. , m = {};
  42661. for (l = 0; l < this.faces.length; l++) {
  42662. var v = this.faces[l]
  42663. , y = void 0 !== this.faceVertexUvs[0][l]
  42664. , A = 0 < v.normal.length()
  42665. , C = 0 < v.vertexNormals.length
  42666. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42667. , E = 0 < v.vertexColors.length
  42668. , _ = 0;
  42669. if (_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_, 0, 0), 1, !0), 2, !1), 3, y), 4, A), 5, C), 6, I), 7, E),
  42670. h.push(_),
  42671. h.push(v.a, v.b, v.c),
  42672. h.push(v.materialIndex),
  42673. y) {
  42674. var b = this.faceVertexUvs[0][l];
  42675. h.push(n(b[0]), n(b[1]), n(b[2]))
  42676. }
  42677. if (A && h.push(t(v.normal)),
  42678. C) {
  42679. var w = v.vertexNormals;
  42680. h.push(t(w[0]), t(w[1]), t(w[2]))
  42681. }
  42682. if (I && h.push(i(v.color)),
  42683. E) {
  42684. var T = v.vertexColors;
  42685. h.push(i(T[0]), i(T[1]), i(T[2]))
  42686. }
  42687. }
  42688. return r.data = {},
  42689. r.data.vertices = s,
  42690. r.data.normals = u,
  42691. 0 < p.length && (r.data.colors = p),
  42692. 0 < g.length && (r.data.uvs = [g]),
  42693. r.data.faces = h,
  42694. r
  42695. },
  42696. clone: function() {
  42697. return (new Ci.Geometry).copy(this)
  42698. },
  42699. copy: function(e) {
  42700. this.vertices = [],
  42701. this.faces = [],
  42702. this.faceVertexUvs = [[]];
  42703. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42704. this.vertices.push(t[i].clone());
  42705. var r = e.faces;
  42706. for (i = 0,
  42707. n = r.length; i < n; i++)
  42708. this.faces.push(r[i].clone());
  42709. for (i = 0,
  42710. n = e.faceVertexUvs.length; i < n; i++) {
  42711. var o = e.faceVertexUvs[i];
  42712. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42713. for (var a = 0, s = o.length; a < s; a++) {
  42714. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42715. var d = l[h];
  42716. c.push(d.clone())
  42717. }
  42718. this.faceVertexUvs[i].push(c)
  42719. }
  42720. }
  42721. return this
  42722. },
  42723. dispose: function() {
  42724. this.dispatchEvent({
  42725. type: "dispose"
  42726. })
  42727. }
  42728. },
  42729. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  42730. Ci.GeometryIdCount = 0,
  42731. Ci.DirectGeometry = function() {
  42732. Object.defineProperty(this, "id", {
  42733. value: Ci.GeometryIdCount++
  42734. }),
  42735. this.uuid = Ci.Math.generateUUID(),
  42736. this.name = "",
  42737. this.type = "DirectGeometry",
  42738. this.indices = [],
  42739. this.vertices = [],
  42740. this.normals = [],
  42741. this.colors = [],
  42742. this.uvs = [],
  42743. this.uvs2 = [],
  42744. this.groups = [],
  42745. this.morphTargets = {},
  42746. this.skinWeights = [],
  42747. this.skinIndices = [],
  42748. this.boundingBox = null,
  42749. this.boundingSphere = null,
  42750. this.verticesNeedUpdate = !1,
  42751. this.normalsNeedUpdate = !1,
  42752. this.colorsNeedUpdate = !1,
  42753. this.uvsNeedUpdate = !1,
  42754. this.groupsNeedUpdate = !1
  42755. }
  42756. ,
  42757. Ci.DirectGeometry.prototype = {
  42758. constructor: Ci.DirectGeometry,
  42759. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  42760. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  42761. computeFaceNormals: function() {
  42762. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42763. },
  42764. computeVertexNormals: function() {
  42765. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42766. },
  42767. computeGroups: function(e) {
  42768. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42769. var a = r[o];
  42770. a.materialIndex !== i && (i = a.materialIndex,
  42771. void 0 !== t && (t.count = 3 * o - t.start,
  42772. n.push(t)),
  42773. t = {
  42774. start: 3 * o,
  42775. materialIndex: i
  42776. })
  42777. }
  42778. void 0 !== t && (t.count = 3 * o - t.start,
  42779. n.push(t)),
  42780. this.groups = n
  42781. },
  42782. fromGeometry: function(e) {
  42783. var t, i = e.faces, n = e.vertices, r = e.faceVertexUvs, o = r[0] && 0 < r[0].length, a = r[1] && 0 < r[1].length, s = e.morphTargets, l = s.length;
  42784. if (0 < l) {
  42785. t = [];
  42786. for (var c = 0; c < l; c++)
  42787. t[c] = [];
  42788. this.morphTargets.position = t
  42789. }
  42790. var h, u = e.morphNormals, d = u.length;
  42791. if (0 < d) {
  42792. h = [];
  42793. for (c = 0; c < d; c++)
  42794. h[c] = [];
  42795. this.morphTargets.normal = h
  42796. }
  42797. var p = e.skinIndices
  42798. , f = e.skinWeights
  42799. , g = p.length === n.length
  42800. , m = f.length === n.length;
  42801. for (c = 0; c < i.length; c++) {
  42802. var v = i[c];
  42803. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42804. var y = v.vertexNormals;
  42805. if (3 === y.length)
  42806. this.normals.push(y[0], y[1], y[2]);
  42807. else {
  42808. var A = v.normal;
  42809. this.normals.push(A, A, A)
  42810. }
  42811. var C, I = v.vertexColors;
  42812. if (3 === I.length)
  42813. this.colors.push(I[0], I[1], I[2]);
  42814. else {
  42815. var E = v.color;
  42816. this.colors.push(E, E, E)
  42817. }
  42818. if (!0 === o)
  42819. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42820. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42821. if (!0 === a)
  42822. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42823. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42824. for (var _ = 0; _ < l; _++) {
  42825. var b = s[_].vertices;
  42826. t[_].push(b[v.a], b[v.b], b[v.c])
  42827. }
  42828. for (_ = 0; _ < d; _++) {
  42829. var w = u[_].vertexNormals[c];
  42830. h[_].push(w.a, w.b, w.c)
  42831. }
  42832. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42833. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42834. }
  42835. return this.computeGroups(e),
  42836. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42837. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42838. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42839. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42840. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42841. this
  42842. },
  42843. dispose: function() {
  42844. this.dispatchEvent({
  42845. type: "dispose"
  42846. })
  42847. }
  42848. },
  42849. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42850. Ci.BufferGeometry = function() {
  42851. Object.defineProperty(this, "id", {
  42852. value: Ci.GeometryIdCount++
  42853. }),
  42854. this.uuid = Ci.Math.generateUUID(),
  42855. this.name = "",
  42856. this.type = "BufferGeometry",
  42857. this.index = null,
  42858. this.attributes = {},
  42859. this.morphAttributes = {},
  42860. this.groups = [],
  42861. this.boundingBox = null,
  42862. this.boundingSphere = null,
  42863. this.drawRange = {
  42864. start: 0,
  42865. count: 1 / 0
  42866. }
  42867. }
  42868. ,
  42869. Ci.BufferGeometry.prototype = {
  42870. constructor: Ci.BufferGeometry,
  42871. getIndex: function() {
  42872. return this.index
  42873. },
  42874. setIndex: function(e) {
  42875. this.index = e
  42876. },
  42877. addAttribute: function(e, t) {
  42878. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42879. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42880. void this.setIndex(t)) : (this.attributes[e] = t,
  42881. this)
  42882. },
  42883. getAttribute: function(e) {
  42884. return this.attributes[e]
  42885. },
  42886. removeAttribute: function(e) {
  42887. return delete this.attributes[e],
  42888. this
  42889. },
  42890. addGroup: function(e, t, i) {
  42891. this.groups.push({
  42892. start: e,
  42893. count: t,
  42894. materialIndex: void 0 !== i ? i : 0
  42895. })
  42896. },
  42897. clearGroups: function() {
  42898. this.groups = []
  42899. },
  42900. setDrawRange: function(e, t) {
  42901. this.drawRange.start = e,
  42902. this.drawRange.count = t
  42903. },
  42904. applyMatrix: function(e) {
  42905. var t = this.attributes.position;
  42906. void 0 !== t && (e.applyToVector3Array(t.array),
  42907. t.needsUpdate = !0);
  42908. var i = this.attributes.normal;
  42909. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42910. i.needsUpdate = !0);
  42911. return null !== this.boundingBox && this.computeBoundingBox(),
  42912. null !== this.boundingSphere && this.computeBoundingSphere(),
  42913. this
  42914. },
  42915. rotateX: function(e) {
  42916. return void 0 === ht && (ht = new Ci.Matrix4),
  42917. ht.makeRotationX(e),
  42918. this.applyMatrix(ht),
  42919. this
  42920. },
  42921. rotateY: function(e) {
  42922. return void 0 === ct && (ct = new Ci.Matrix4),
  42923. ct.makeRotationY(e),
  42924. this.applyMatrix(ct),
  42925. this
  42926. },
  42927. rotateZ: function(e) {
  42928. return void 0 === lt && (lt = new Ci.Matrix4),
  42929. lt.makeRotationZ(e),
  42930. this.applyMatrix(lt),
  42931. this
  42932. },
  42933. translate: function(e, t, i) {
  42934. return void 0 === st && (st = new Ci.Matrix4),
  42935. st.makeTranslation(e, t, i),
  42936. this.applyMatrix(st),
  42937. this
  42938. },
  42939. scale: function(e, t, i) {
  42940. return void 0 === at && (at = new Ci.Matrix4),
  42941. at.makeScale(e, t, i),
  42942. this.applyMatrix(at),
  42943. this
  42944. },
  42945. lookAt: function(e) {
  42946. void 0 === ot && (ot = new Ci.Object3D),
  42947. ot.lookAt(e),
  42948. ot.updateMatrix(),
  42949. this.applyMatrix(ot.matrix)
  42950. },
  42951. center: function() {
  42952. this.computeBoundingBox();
  42953. var e = this.boundingBox.center().negate();
  42954. return this.translate(e.x, e.y, e.z),
  42955. e
  42956. },
  42957. setFromObject: function(e) {
  42958. var t = e.geometry;
  42959. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  42960. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  42961. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  42962. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42963. this.addAttribute("color", n.copyColorsArray(t.colors)),
  42964. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42965. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  42966. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  42967. }
  42968. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42969. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42970. } else
  42971. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  42972. return this
  42973. },
  42974. updateFromObject: function(e) {
  42975. var t, i = e.geometry;
  42976. if (e instanceof Ci.Mesh) {
  42977. var n = i.__directGeometry;
  42978. if (void 0 === n)
  42979. return this.fromGeometry(i);
  42980. n.verticesNeedUpdate = i.verticesNeedUpdate,
  42981. n.normalsNeedUpdate = i.normalsNeedUpdate,
  42982. n.colorsNeedUpdate = i.colorsNeedUpdate,
  42983. n.uvsNeedUpdate = i.uvsNeedUpdate,
  42984. n.groupsNeedUpdate = i.groupsNeedUpdate,
  42985. i.verticesNeedUpdate = !1,
  42986. i.normalsNeedUpdate = !1,
  42987. i.colorsNeedUpdate = !1,
  42988. i.uvsNeedUpdate = !1,
  42989. i.groupsNeedUpdate = !1,
  42990. i = n
  42991. }
  42992. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  42993. t.needsUpdate = !0),
  42994. i.verticesNeedUpdate = !1);
  42995. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  42996. t.needsUpdate = !0),
  42997. i.normalsNeedUpdate = !1);
  42998. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  42999. t.needsUpdate = !0),
  43000. i.colorsNeedUpdate = !1);
  43001. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  43002. t.needsUpdate = !0),
  43003. i.uvsNeedUpdate = !1);
  43004. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  43005. t.needsUpdate = !0),
  43006. i.lineDistancesNeedUpdate = !1);
  43007. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  43008. this.groups = i.groups,
  43009. i.groupsNeedUpdate = !1),
  43010. this
  43011. },
  43012. fromGeometry: function(e) {
  43013. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  43014. this.fromDirectGeometry(e.__directGeometry)
  43015. },
  43016. fromDirectGeometry: function(e) {
  43017. var t = new Float32Array(3 * e.vertices.length);
  43018. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  43019. 0 < e.normals.length) {
  43020. var i = new Float32Array(3 * e.normals.length);
  43021. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  43022. }
  43023. if (0 < e.colors.length) {
  43024. var n = new Float32Array(3 * e.colors.length);
  43025. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  43026. }
  43027. if (0 < e.uvs.length) {
  43028. var r = new Float32Array(2 * e.uvs.length);
  43029. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  43030. }
  43031. if (0 < e.uvs2.length) {
  43032. var o = new Float32Array(2 * e.uvs2.length);
  43033. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  43034. }
  43035. if (0 < e.indices.length) {
  43036. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  43037. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  43038. }
  43039. for (var s in this.groups = e.groups,
  43040. e.morphTargets) {
  43041. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  43042. var d = c[h]
  43043. , p = new Ci.Float32Attribute(3 * d.length,3);
  43044. l.push(p.copyVector3sArray(d))
  43045. }
  43046. this.morphAttributes[s] = l
  43047. }
  43048. if (0 < e.skinIndices.length) {
  43049. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  43050. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  43051. }
  43052. if (0 < e.skinWeights.length) {
  43053. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  43054. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  43055. }
  43056. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  43057. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  43058. this
  43059. },
  43060. computeBoundingBox: (new Ci.Vector3,
  43061. function() {
  43062. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  43063. var e = this.attributes.position.array;
  43064. e && this.boundingBox.setFromArray(e),
  43065. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  43066. this.boundingBox.max.set(0, 0, 0)),
  43067. (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)
  43068. }
  43069. ),
  43070. computeBoundingSphere: (nt = new Ci.Box3,
  43071. rt = new Ci.Vector3,
  43072. function() {
  43073. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  43074. var e = this.attributes.position.array;
  43075. if (e) {
  43076. var t = this.boundingSphere.center;
  43077. nt.setFromArray(e),
  43078. nt.center(t);
  43079. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  43080. rt.fromArray(e, n),
  43081. i = Math.max(i, t.distanceToSquared(rt));
  43082. this.boundingSphere.radius = Math.sqrt(i),
  43083. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  43084. }
  43085. }
  43086. ),
  43087. computeFaceNormals: function() {},
  43088. computeVertexNormals: function() {
  43089. var e = this.index
  43090. , t = this.attributes
  43091. , i = this.groups;
  43092. if (t.position) {
  43093. var n = t.position.array;
  43094. if (void 0 === t.normal)
  43095. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  43096. else
  43097. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  43098. r[o] = 0;
  43099. var s, l, c, h = t.normal.array, u = new Ci.Vector3, d = new Ci.Vector3, p = new Ci.Vector3, f = new Ci.Vector3, g = new Ci.Vector3;
  43100. if (e) {
  43101. var m = e.array;
  43102. 0 === i.length && this.addGroup(0, m.length);
  43103. for (var v = 0, y = i.length; v < y; ++v) {
  43104. var A = i[v]
  43105. , C = A.start;
  43106. for (o = C,
  43107. a = C + A.count; o < a; o += 3)
  43108. s = 3 * m[o + 0],
  43109. l = 3 * m[o + 1],
  43110. c = 3 * m[o + 2],
  43111. u.fromArray(n, s),
  43112. d.fromArray(n, l),
  43113. p.fromArray(n, c),
  43114. f.subVectors(p, d),
  43115. g.subVectors(u, d),
  43116. f.cross(g),
  43117. h[s] += f.x,
  43118. h[1 + s] += f.y,
  43119. h[2 + s] += f.z,
  43120. h[l] += f.x,
  43121. h[1 + l] += f.y,
  43122. h[2 + l] += f.z,
  43123. h[c] += f.x,
  43124. h[1 + c] += f.y,
  43125. h[2 + c] += f.z
  43126. }
  43127. } else
  43128. for (o = 0,
  43129. a = n.length; o < a; o += 9)
  43130. u.fromArray(n, o),
  43131. d.fromArray(n, o + 3),
  43132. p.fromArray(n, o + 6),
  43133. f.subVectors(p, d),
  43134. g.subVectors(u, d),
  43135. f.cross(g),
  43136. h[o] = f.x,
  43137. h[o + 1] = f.y,
  43138. h[o + 2] = f.z,
  43139. h[o + 3] = f.x,
  43140. h[o + 4] = f.y,
  43141. h[o + 5] = f.z,
  43142. h[o + 6] = f.x,
  43143. h[o + 7] = f.y,
  43144. h[o + 8] = f.z;
  43145. this.normalizeNormals(),
  43146. t.normal.needsUpdate = !0
  43147. }
  43148. },
  43149. merge: function(e, t) {
  43150. if (e instanceof Ci.BufferGeometry != 0) {
  43151. void 0 === t && (t = 0);
  43152. var i = this.attributes;
  43153. for (var n in i)
  43154. if (void 0 !== e.attributes[n])
  43155. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  43156. l++)
  43157. r[l] = a[s];
  43158. return this
  43159. }
  43160. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  43161. },
  43162. normalizeNormals: function() {
  43163. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  43164. e = r[o],
  43165. t = r[o + 1],
  43166. i = r[o + 2],
  43167. n = 1 / Math.sqrt(e * e + t * t + i * i),
  43168. r[o] *= n,
  43169. r[o + 1] *= n,
  43170. r[o + 2] *= n
  43171. },
  43172. toNonIndexed: function() {
  43173. if (null === this.index)
  43174. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  43175. this;
  43176. var e = new Ci.BufferGeometry
  43177. , t = this.index.array
  43178. , i = this.attributes;
  43179. for (var n in i) {
  43180. for (var r = i[n], o = r.array, a = r.itemSize, s = new o.constructor(t.length * a), l = 0, c = 0, h = 0, u = t.length; h < u; h++) {
  43181. l = t[h] * a;
  43182. for (var d = 0; d < a; d++)
  43183. s[c++] = o[l++]
  43184. }
  43185. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  43186. }
  43187. return e
  43188. },
  43189. toJSON: function() {
  43190. var e = {
  43191. metadata: {
  43192. version: 4.4,
  43193. type: "BufferGeometry",
  43194. generator: "BufferGeometry.toJSON"
  43195. }
  43196. };
  43197. if (e.uuid = this.uuid,
  43198. e.type = this.type,
  43199. "" !== this.name && (e.name = this.name),
  43200. void 0 !== this.parameters) {
  43201. var t = this.parameters;
  43202. for (var i in t)
  43203. void 0 !== t[i] && (e[i] = t[i]);
  43204. return e
  43205. }
  43206. e.data = {
  43207. attributes: {}
  43208. };
  43209. var n = this.index;
  43210. if (null !== n) {
  43211. var r = Array.prototype.slice.call(n.array);
  43212. e.data.index = {
  43213. type: n.array.constructor.name,
  43214. array: r
  43215. }
  43216. }
  43217. var o = this.attributes;
  43218. for (var i in o) {
  43219. var a = o[i];
  43220. r = Array.prototype.slice.call(a.array);
  43221. e.data.attributes[i] = {
  43222. itemSize: a.itemSize,
  43223. type: a.array.constructor.name,
  43224. array: r
  43225. }
  43226. }
  43227. var s = this.groups;
  43228. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  43229. var l = this.boundingSphere;
  43230. return null !== l && (e.data.boundingSphere = {
  43231. center: l.center.toArray(),
  43232. radius: l.radius
  43233. }),
  43234. e
  43235. },
  43236. clone: function() {
  43237. return (new Ci.BufferGeometry).copy(this)
  43238. },
  43239. copy: function(e) {
  43240. var t = e.index;
  43241. null !== t && this.setIndex(t.clone());
  43242. var i = e.attributes;
  43243. for (var n in i) {
  43244. var r = i[n];
  43245. this.addAttribute(n, r.clone())
  43246. }
  43247. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43248. var l = o[a];
  43249. this.addGroup(l.start, l.count)
  43250. }
  43251. return this
  43252. },
  43253. dispose: function() {
  43254. this.dispatchEvent({
  43255. type: "dispose"
  43256. })
  43257. }
  43258. },
  43259. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  43260. Ci.BufferGeometry.MaxIndex = 65535,
  43261. Ci.InstancedBufferGeometry = function() {
  43262. Ci.BufferGeometry.call(this),
  43263. this.type = "InstancedBufferGeometry",
  43264. this.maxInstancedCount = void 0
  43265. }
  43266. ,
  43267. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  43268. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  43269. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  43270. this.groups.push({
  43271. start: e,
  43272. count: t,
  43273. instances: i
  43274. })
  43275. }
  43276. ,
  43277. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  43278. var t = e.index;
  43279. null !== t && this.setIndex(t.clone());
  43280. var i = e.attributes;
  43281. for (var n in i) {
  43282. var r = i[n];
  43283. this.addAttribute(n, r.clone())
  43284. }
  43285. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43286. var l = o[a];
  43287. this.addGroup(l.start, l.count, l.instances)
  43288. }
  43289. return this
  43290. }
  43291. ,
  43292. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  43293. Ci.Uniform = function(e, t) {
  43294. this.type = e,
  43295. this.value = t,
  43296. this.dynamic = !1
  43297. }
  43298. ,
  43299. Ci.Uniform.prototype = {
  43300. constructor: Ci.Uniform,
  43301. onUpdate: function(e) {
  43302. return this.dynamic = !0,
  43303. this.onUpdateCallback = e,
  43304. this
  43305. }
  43306. },
  43307. Ci.AnimationClip = function(e, t, i) {
  43308. this.name = e || Ci.Math.generateUUID(),
  43309. this.tracks = i,
  43310. this.duration = void 0 !== t ? t : -1,
  43311. this.duration < 0 && this.resetDuration(),
  43312. this.trim(),
  43313. this.optimize()
  43314. }
  43315. ,
  43316. Ci.AnimationClip.prototype = {
  43317. constructor: Ci.AnimationClip,
  43318. resetDuration: function() {
  43319. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  43320. var n = this.tracks[t];
  43321. e = Math.max(e, n.times[n.times.length - 1])
  43322. }
  43323. this.duration = e
  43324. },
  43325. trim: function() {
  43326. for (var e = 0; e < this.tracks.length; e++)
  43327. this.tracks[e].trim(0, this.duration);
  43328. return this
  43329. },
  43330. optimize: function() {
  43331. for (var e = 0; e < this.tracks.length; e++)
  43332. this.tracks[e].optimize();
  43333. return this
  43334. }
  43335. },
  43336. Object.assign(Ci.AnimationClip, {
  43337. parse: function(e) {
  43338. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  43339. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  43340. return new Ci.AnimationClip(e.name,e.duration,t)
  43341. },
  43342. toJSON: function(e) {
  43343. for (var t = [], i = e.tracks, n = {
  43344. name: e.name,
  43345. duration: e.duration,
  43346. tracks: t
  43347. }, r = 0, o = i.length; r !== o; ++r)
  43348. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  43349. return n
  43350. },
  43351. CreateFromMorphTargetSequence: function(e, t, i) {
  43352. for (var n = t.length, r = [], o = 0; o < n; o++) {
  43353. var a = []
  43354. , s = [];
  43355. a.push((o + n - 1) % n, o, (o + 1) % n),
  43356. s.push(0, 1, 0);
  43357. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  43358. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  43359. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  43360. 0 === a[0] && (a.push(n),
  43361. s.push(s[0])),
  43362. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  43363. }
  43364. return new Ci.AnimationClip(e,-1,r)
  43365. },
  43366. findByName: function(e, t) {
  43367. for (var i = 0; i < e.length; i++)
  43368. if (e[i].name === t)
  43369. return e[i];
  43370. return null
  43371. },
  43372. CreateClipsFromMorphTargetSequences: function(e, t) {
  43373. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  43374. var a = e[r]
  43375. , s = a.name.match(n);
  43376. if (s && 1 < s.length) {
  43377. var l = i[h = s[1]];
  43378. l || (i[h] = l = []),
  43379. l.push(a)
  43380. }
  43381. }
  43382. var c = [];
  43383. for (var h in i)
  43384. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  43385. return c
  43386. },
  43387. parseAnimation: function(e, t, i) {
  43388. if (!e)
  43389. return console.error(" no animation in JSONLoader data"),
  43390. null;
  43391. function n(e, t, i, n, r) {
  43392. if (0 !== i.length) {
  43393. var o = []
  43394. , a = [];
  43395. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  43396. 0 !== o.length && r.push(new e(t,o,a))
  43397. }
  43398. }
  43399. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  43400. var h = l[c].keys;
  43401. if (h && 0 != h.length)
  43402. if (h[0].morphTargets) {
  43403. for (var u = {}, d = 0; d < h.length; d++)
  43404. if (h[d].morphTargets)
  43405. for (var p = 0; p < h[d].morphTargets.length; p++)
  43406. u[h[d].morphTargets[p]] = -1;
  43407. for (var f in u) {
  43408. var g = []
  43409. , m = [];
  43410. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  43411. var v = h[d];
  43412. g.push(v.time),
  43413. m.push(v.morphTarget === f ? 1 : 0)
  43414. }
  43415. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  43416. }
  43417. a = u.length * (s || 1)
  43418. } else {
  43419. var y = ".bones[" + t[c].name + "]";
  43420. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  43421. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  43422. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  43423. }
  43424. }
  43425. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  43426. }
  43427. }),
  43428. Ci.AnimationMixer = function(e) {
  43429. this._root = e,
  43430. this._initMemoryManager(),
  43431. this._accuIndex = 0,
  43432. this.time = 0,
  43433. this.timeScale = 1
  43434. }
  43435. ,
  43436. Ci.AnimationMixer.prototype = {
  43437. constructor: Ci.AnimationMixer,
  43438. clipAction: function(e, t) {
  43439. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  43440. if (void 0 !== a) {
  43441. var s = a.actionByRoot[n];
  43442. if (void 0 !== s)
  43443. return s;
  43444. if (o = (i = a.knownActions[0])._clip,
  43445. e !== r && e !== o)
  43446. throw new Error("Different clips with the same name detected!")
  43447. }
  43448. if (null === o)
  43449. return null;
  43450. var l = new Ci.AnimationMixer._Action(this,o,t);
  43451. return this._bindAction(l, i),
  43452. this._addInactiveAction(l, r, n),
  43453. l
  43454. },
  43455. existingAction: function(e, t) {
  43456. var i = (t || this._root).uuid
  43457. , n = "string" == typeof e ? e : e.name
  43458. , r = this._actionsByClip[n];
  43459. return void 0 !== r && r.actionByRoot[i] || null
  43460. },
  43461. stopAllAction: function() {
  43462. var e = this._actions
  43463. , t = this._nActiveActions
  43464. , i = this._bindings
  43465. , n = this._nActiveBindings;
  43466. this._nActiveActions = 0;
  43467. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  43468. e[r].reset();
  43469. for (r = 0; r !== n; ++r)
  43470. i[r].useCount = 0;
  43471. return this
  43472. },
  43473. update: function(e) {
  43474. e *= this.timeScale;
  43475. 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) {
  43476. var s = t[a];
  43477. s.enabled && s._update(n, e, r, o)
  43478. }
  43479. var l = this._bindings
  43480. , c = this._nActiveBindings;
  43481. for (a = 0; a !== c; ++a)
  43482. l[a].apply(o);
  43483. return this
  43484. },
  43485. getRoot: function() {
  43486. return this._root
  43487. },
  43488. uncacheClip: function(e) {
  43489. var t = this._actions
  43490. , i = e.name
  43491. , n = this._actionsByClip
  43492. , r = n[i];
  43493. if (void 0 !== r) {
  43494. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43495. var l = o[a];
  43496. this._deactivateAction(l);
  43497. var c = l._cacheIndex
  43498. , h = t[t.length - 1];
  43499. l._cacheIndex = null,
  43500. l._byClipCacheIndex = null,
  43501. t[h._cacheIndex = c] = h,
  43502. t.pop(),
  43503. this._removeInactiveBindingsForAction(l)
  43504. }
  43505. delete n[i]
  43506. }
  43507. },
  43508. uncacheRoot: function(e) {
  43509. var t = e.uuid
  43510. , i = this._actionsByClip;
  43511. for (var n in i) {
  43512. var r = i[n].actionByRoot[t];
  43513. void 0 !== r && (this._deactivateAction(r),
  43514. this._removeInactiveAction(r))
  43515. }
  43516. var o = this._bindingsByRootAndName[t];
  43517. if (void 0 !== o)
  43518. for (var a in o) {
  43519. var s = o[a];
  43520. s.restoreOriginalState(),
  43521. this._removeInactiveBinding(s)
  43522. }
  43523. },
  43524. uncacheAction: function(e, t) {
  43525. var i = this.existingAction(e, t);
  43526. null !== i && (this._deactivateAction(i),
  43527. this._removeInactiveAction(i))
  43528. }
  43529. },
  43530. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  43531. Ci.AnimationMixer._Action = function(e, t, i) {
  43532. this._mixer = e,
  43533. this._clip = t,
  43534. this._localRoot = i || null;
  43535. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  43536. endingStart: Ci.ZeroCurvatureEnding,
  43537. endingEnd: Ci.ZeroCurvatureEnding
  43538. }, s = 0; s !== r; ++s) {
  43539. var l = n[s].createInterpolant(null);
  43540. (o[s] = l).settings = a
  43541. }
  43542. this._interpolantSettings = a,
  43543. this._interpolants = o,
  43544. this._propertyBindings = new Array(r),
  43545. this._cacheIndex = null,
  43546. this._byClipCacheIndex = null,
  43547. this._timeScaleInterpolant = null,
  43548. this._weightInterpolant = null,
  43549. this.loop = Ci.LoopRepeat,
  43550. this._loopCount = -1,
  43551. this._startTime = null,
  43552. this.time = 0,
  43553. this.timeScale = 1,
  43554. this._effectiveTimeScale = 1,
  43555. this.weight = 1,
  43556. this._effectiveWeight = 1,
  43557. this.repetitions = 1 / 0,
  43558. this.paused = !1,
  43559. this.enabled = !0,
  43560. this.clampWhenFinished = !1,
  43561. this.zeroSlopeAtStart = !0,
  43562. this.zeroSlopeAtEnd = !0
  43563. }
  43564. ,
  43565. Ci.AnimationMixer._Action.prototype = {
  43566. constructor: Ci.AnimationMixer._Action,
  43567. play: function() {
  43568. return this._mixer._activateAction(this),
  43569. this
  43570. },
  43571. stop: function() {
  43572. return this._mixer._deactivateAction(this),
  43573. this.reset()
  43574. },
  43575. reset: function() {
  43576. return this.paused = !1,
  43577. this.enabled = !0,
  43578. this.time = 0,
  43579. this._loopCount = -1,
  43580. this._startTime = null,
  43581. this.stopFading().stopWarping()
  43582. },
  43583. isRunning: function() {
  43584. return this._startTime,
  43585. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43586. },
  43587. isScheduled: function() {
  43588. return this._mixer._isActiveAction(this)
  43589. },
  43590. startAt: function(e) {
  43591. return this._startTime = e,
  43592. this
  43593. },
  43594. setLoop: function(e, t) {
  43595. return this.loop = e,
  43596. this.repetitions = t,
  43597. this
  43598. },
  43599. setEffectiveWeight: function(e) {
  43600. return this.weight = e,
  43601. this._effectiveWeight = this.enabled ? e : 0,
  43602. this.stopFading()
  43603. },
  43604. getEffectiveWeight: function() {
  43605. return this._effectiveWeight
  43606. },
  43607. fadeIn: function(e) {
  43608. return this._scheduleFading(e, 0, 1)
  43609. },
  43610. fadeOut: function(e) {
  43611. return this._scheduleFading(e, 1, 0)
  43612. },
  43613. crossFadeFrom: function(e, t, i) {
  43614. if (this._mixer,
  43615. e.fadeOut(t),
  43616. this.fadeIn(t),
  43617. i) {
  43618. var n = this._clip.duration
  43619. , r = e._clip.duration
  43620. , o = r / n
  43621. , a = n / r;
  43622. e.warp(1, o, t),
  43623. this.warp(a, 1, t)
  43624. }
  43625. return this
  43626. },
  43627. crossFadeTo: function(e, t, i) {
  43628. return e.crossFadeFrom(this, t, i)
  43629. },
  43630. stopFading: function() {
  43631. var e = this._weightInterpolant;
  43632. return null !== e && (this._weightInterpolant = null,
  43633. this._mixer._takeBackControlInterpolant(e)),
  43634. this
  43635. },
  43636. setEffectiveTimeScale: function(e) {
  43637. return this.timeScale = e,
  43638. this._effectiveTimeScale = this.paused ? 0 : e,
  43639. this.stopWarping()
  43640. },
  43641. getEffectiveTimeScale: function() {
  43642. return this._effectiveTimeScale
  43643. },
  43644. setDuration: function(e) {
  43645. return this.timeScale = this._clip.duration / e,
  43646. this.stopWarping()
  43647. },
  43648. syncWith: function(e) {
  43649. return this.time = e.time,
  43650. this.timeScale = e.timeScale,
  43651. this.stopWarping()
  43652. },
  43653. halt: function(e) {
  43654. return this.warp(this._currentTimeScale, 0, e)
  43655. },
  43656. warp: function(e, t, i) {
  43657. var n = this._mixer
  43658. , r = n.time
  43659. , o = this._timeScaleInterpolant
  43660. , a = this.timeScale;
  43661. null === o && (o = n._lendControlInterpolant(),
  43662. this._timeScaleInterpolant = o);
  43663. var s = o.parameterPositions
  43664. , l = o.sampleValues;
  43665. return s[0] = r,
  43666. s[1] = r + i,
  43667. l[0] = e / a,
  43668. l[1] = t / a,
  43669. this
  43670. },
  43671. stopWarping: function() {
  43672. var e = this._timeScaleInterpolant;
  43673. return null !== e && (this._timeScaleInterpolant = null,
  43674. this._mixer._takeBackControlInterpolant(e)),
  43675. this
  43676. },
  43677. getMixer: function() {
  43678. return this._mixer
  43679. },
  43680. getClip: function() {
  43681. return this._clip
  43682. },
  43683. getRoot: function() {
  43684. return this._localRoot || this._mixer._root
  43685. },
  43686. _update: function(e, t, i, n) {
  43687. var r = this._startTime;
  43688. if (null !== r) {
  43689. var o = (e - r) * i;
  43690. if (o < 0 || 0 === i)
  43691. return;
  43692. this._startTime = null,
  43693. t = i * o
  43694. }
  43695. t *= this._updateTimeScale(e);
  43696. var a = this._updateTime(t)
  43697. , s = this._updateWeight(e);
  43698. if (0 < s)
  43699. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43700. l[h].evaluate(a),
  43701. c[h].accumulate(n, s)
  43702. },
  43703. _updateWeight: function(e) {
  43704. var t = 0;
  43705. if (this.enabled) {
  43706. t = this.weight;
  43707. var i = this._weightInterpolant;
  43708. if (null !== i) {
  43709. var n = i.evaluate(e)[0];
  43710. t *= n,
  43711. e > i.parameterPositions[1] && (this.stopFading(),
  43712. 0 === n && (this.enabled = !1))
  43713. }
  43714. }
  43715. return this._effectiveWeight = t
  43716. },
  43717. _updateTimeScale: function(e) {
  43718. var t = 0;
  43719. if (!this.paused) {
  43720. t = this.timeScale;
  43721. var i = this._timeScaleInterpolant;
  43722. if (null !== i)
  43723. t *= i.evaluate(e)[0],
  43724. e > i.parameterPositions[1] && (this.stopWarping(),
  43725. 0 === t ? this.pause = !0 : this.timeScale = t)
  43726. }
  43727. return this._effectiveTimeScale = t
  43728. },
  43729. _updateTime: function(e) {
  43730. var t = this.time + e;
  43731. if (0 === e)
  43732. return t;
  43733. var i = this._clip.duration
  43734. , n = this.loop
  43735. , r = this._loopCount
  43736. , o = !1;
  43737. switch (n) {
  43738. case Ci.LoopOnce:
  43739. if (-1 === r && (this.loopCount = 0,
  43740. this._setEndings(!0, !0, !1)),
  43741. i <= t)
  43742. t = i;
  43743. else {
  43744. if (!(t < 0))
  43745. break;
  43746. t = 0
  43747. }
  43748. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43749. this._mixer.dispatchEvent({
  43750. type: "finished",
  43751. action: this,
  43752. direction: e < 0 ? -1 : 1
  43753. });
  43754. break;
  43755. case Ci.LoopPingPong:
  43756. o = !0;
  43757. case Ci.LoopRepeat:
  43758. if (-1 === r && (0 < e ? (r = 0,
  43759. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  43760. i <= t || t < 0) {
  43761. var a = Math.floor(t / i);
  43762. t -= i * a,
  43763. r += Math.abs(a);
  43764. var s = this.repetitions - r;
  43765. if (s < 0) {
  43766. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43767. t = 0 < e ? i : 0,
  43768. this._mixer.dispatchEvent({
  43769. type: "finished",
  43770. action: this,
  43771. direction: 0 < e ? 1 : -1
  43772. });
  43773. break
  43774. }
  43775. if (0 == s) {
  43776. var l = e < 0;
  43777. this._setEndings(l, !l, o)
  43778. } else
  43779. this._setEndings(!1, !1, o);
  43780. this._loopCount = r,
  43781. this._mixer.dispatchEvent({
  43782. type: "loop",
  43783. action: this,
  43784. loopDelta: a
  43785. })
  43786. }
  43787. if (n === Ci.LoopPingPong && 1 == (1 & r))
  43788. return i - (this.time = t)
  43789. }
  43790. return this.time = t
  43791. },
  43792. _setEndings: function(e, t, i) {
  43793. var n = this._interpolantSettings;
  43794. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43795. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43796. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43797. },
  43798. _scheduleFading: function(e, t, i) {
  43799. var n = this._mixer
  43800. , r = n.time
  43801. , o = this._weightInterpolant;
  43802. null === o && (o = n._lendControlInterpolant(),
  43803. this._weightInterpolant = o);
  43804. var a = o.parameterPositions
  43805. , s = o.sampleValues;
  43806. return a[0] = r,
  43807. s[0] = t,
  43808. a[1] = r + e,
  43809. s[1] = i,
  43810. this
  43811. }
  43812. },
  43813. Object.assign(Ci.AnimationMixer.prototype, {
  43814. _bindAction: function(e, t) {
  43815. var i = e._localRoot || this._root
  43816. , n = e._clip.tracks
  43817. , r = n.length
  43818. , o = e._propertyBindings
  43819. , a = e._interpolants
  43820. , s = i.uuid
  43821. , l = this._bindingsByRootAndName
  43822. , c = l[s];
  43823. void 0 === c && (c = {},
  43824. l[s] = c);
  43825. for (var h = 0; h !== r; ++h) {
  43826. var u = n[h]
  43827. , d = u.name
  43828. , p = c[d];
  43829. if (void 0 !== p)
  43830. o[h] = p;
  43831. else {
  43832. if (void 0 !== (p = o[h])) {
  43833. null === p._cacheIndex && (++p.referenceCount,
  43834. this._addInactiveBinding(p, s, d));
  43835. continue
  43836. }
  43837. var f = t && t._propertyBindings[h].binding.parsedPath;
  43838. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43839. this._addInactiveBinding(p, s, d),
  43840. o[h] = p
  43841. }
  43842. a[h].resultBuffer = p.buffer
  43843. }
  43844. },
  43845. _activateAction: function(e) {
  43846. if (!this._isActiveAction(e)) {
  43847. if (null === e._cacheIndex) {
  43848. var t = (e._localRoot || this._root).uuid
  43849. , i = e._clip.name
  43850. , n = this._actionsByClip[i];
  43851. this._bindAction(e, n && n.knownActions[0]),
  43852. this._addInactiveAction(e, i, t)
  43853. }
  43854. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43855. var s = r[o];
  43856. 0 == s.useCount++ && (this._lendBinding(s),
  43857. s.saveOriginalState())
  43858. }
  43859. this._lendAction(e)
  43860. }
  43861. },
  43862. _deactivateAction: function(e) {
  43863. if (this._isActiveAction(e)) {
  43864. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43865. var r = t[i];
  43866. 0 == --r.useCount && (r.restoreOriginalState(),
  43867. this._takeBackBinding(r))
  43868. }
  43869. this._takeBackAction(e)
  43870. }
  43871. },
  43872. _initMemoryManager: function() {
  43873. this._actions = [],
  43874. this._nActiveActions = 0,
  43875. this._actionsByClip = {},
  43876. this._bindings = [],
  43877. this._nActiveBindings = 0,
  43878. this._bindingsByRootAndName = {},
  43879. this._controlInterpolants = [],
  43880. this._nActiveControlInterpolants = 0;
  43881. var e = this;
  43882. this.stats = {
  43883. actions: {
  43884. get total() {
  43885. return e._actions.length
  43886. },
  43887. get inUse() {
  43888. return e._nActiveActions
  43889. }
  43890. },
  43891. bindings: {
  43892. get total() {
  43893. return e._bindings.length
  43894. },
  43895. get inUse() {
  43896. return e._nActiveBindings
  43897. }
  43898. },
  43899. controlInterpolants: {
  43900. get total() {
  43901. return e._controlInterpolants.length
  43902. },
  43903. get inUse() {
  43904. return e._nActiveControlInterpolants
  43905. }
  43906. }
  43907. }
  43908. },
  43909. _isActiveAction: function(e) {
  43910. var t = e._cacheIndex;
  43911. return null !== t && t < this._nActiveActions
  43912. },
  43913. _addInactiveAction: function(e, t, i) {
  43914. var n = this._actions
  43915. , r = this._actionsByClip
  43916. , o = r[t];
  43917. if (void 0 === o)
  43918. o = {
  43919. knownActions: [e],
  43920. actionByRoot: {}
  43921. },
  43922. e._byClipCacheIndex = 0,
  43923. r[t] = o;
  43924. else {
  43925. var a = o.knownActions;
  43926. e._byClipCacheIndex = a.length,
  43927. a.push(e)
  43928. }
  43929. e._cacheIndex = n.length,
  43930. n.push(e),
  43931. o.actionByRoot[i] = e
  43932. },
  43933. _removeInactiveAction: function(e) {
  43934. var t = this._actions
  43935. , i = t[t.length - 1]
  43936. , n = e._cacheIndex;
  43937. t[i._cacheIndex = n] = i,
  43938. t.pop(),
  43939. e._cacheIndex = null;
  43940. var r = e._clip.name
  43941. , o = this._actionsByClip
  43942. , a = o[r]
  43943. , s = a.knownActions
  43944. , l = s[s.length - 1]
  43945. , c = e._byClipCacheIndex;
  43946. s[l._byClipCacheIndex = c] = l,
  43947. s.pop(),
  43948. e._byClipCacheIndex = null,
  43949. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  43950. 0 === s.length && delete o[r],
  43951. this._removeInactiveBindingsForAction(e)
  43952. },
  43953. _removeInactiveBindingsForAction: function(e) {
  43954. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43955. var r = t[i];
  43956. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  43957. }
  43958. },
  43959. _lendAction: function(e) {
  43960. var t = this._actions
  43961. , i = e._cacheIndex
  43962. , n = this._nActiveActions++
  43963. , r = t[n];
  43964. t[e._cacheIndex = n] = e,
  43965. t[r._cacheIndex = i] = r
  43966. },
  43967. _takeBackAction: function(e) {
  43968. var t = this._actions
  43969. , i = e._cacheIndex
  43970. , n = --this._nActiveActions
  43971. , r = t[n];
  43972. t[e._cacheIndex = n] = e,
  43973. t[r._cacheIndex = i] = r
  43974. },
  43975. _addInactiveBinding: function(e, t, i) {
  43976. var n = this._bindingsByRootAndName
  43977. , r = n[t]
  43978. , o = this._bindings;
  43979. void 0 === r && (r = {},
  43980. n[t] = r),
  43981. (r[i] = e)._cacheIndex = o.length,
  43982. o.push(e)
  43983. },
  43984. _removeInactiveBinding: function(e) {
  43985. var t = this._bindings
  43986. , i = e.binding
  43987. , n = i.rootNode.uuid
  43988. , r = i.path
  43989. , o = this._bindingsByRootAndName
  43990. , a = o[n]
  43991. , s = t[t.length - 1]
  43992. , l = e._cacheIndex;
  43993. t[s._cacheIndex = l] = s,
  43994. t.pop(),
  43995. delete a[r];
  43996. e: {
  43997. for (var c in a)
  43998. break e;
  43999. delete o[n]
  44000. }
  44001. },
  44002. _lendBinding: function(e) {
  44003. var t = this._bindings
  44004. , i = e._cacheIndex
  44005. , n = this._nActiveBindings++
  44006. , r = t[n];
  44007. t[e._cacheIndex = n] = e,
  44008. t[r._cacheIndex = i] = r
  44009. },
  44010. _takeBackBinding: function(e) {
  44011. var t = this._bindings
  44012. , i = e._cacheIndex
  44013. , n = --this._nActiveBindings
  44014. , r = t[n];
  44015. t[e._cacheIndex = n] = e,
  44016. t[r._cacheIndex = i] = r
  44017. },
  44018. _lendControlInterpolant: function() {
  44019. var e = this._controlInterpolants
  44020. , t = this._nActiveControlInterpolants++
  44021. , i = e[t];
  44022. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  44023. i
  44024. },
  44025. _takeBackControlInterpolant: function(e) {
  44026. var t = this._controlInterpolants
  44027. , i = e.__cacheIndex
  44028. , n = --this._nActiveControlInterpolants
  44029. , r = t[n];
  44030. t[e.__cacheIndex = n] = e,
  44031. t[r.__cacheIndex = i] = r
  44032. },
  44033. _controlInterpolantsResultBuffer: new Float32Array(1)
  44034. }),
  44035. Ci.AnimationObjectGroup = function(e) {
  44036. this.uuid = Ci.Math.generateUUID(),
  44037. this._objects = Array.prototype.slice.call(arguments),
  44038. this.nCachedObjects_ = 0;
  44039. var t = {};
  44040. this._indicesByUUID = t;
  44041. for (var i = 0, n = arguments.length; i !== n; ++i)
  44042. t[arguments[i].uuid] = i;
  44043. this._paths = [],
  44044. this._parsedPaths = [],
  44045. this._bindings = [],
  44046. this._bindingsIndicesByPath = {};
  44047. var r = this;
  44048. this.stats = {
  44049. objects: {
  44050. get total() {
  44051. return r._objects.length
  44052. },
  44053. get inUse() {
  44054. return this.total - r.nCachedObjects_
  44055. }
  44056. },
  44057. get bindingsPerObject() {
  44058. return r._bindings.length
  44059. }
  44060. }
  44061. }
  44062. ,
  44063. Ci.AnimationObjectGroup.prototype = {
  44064. constructor: Ci.AnimationObjectGroup,
  44065. add: function(e) {
  44066. for (var t = this._objects, i = t.length, n = this.nCachedObjects_, r = this._indicesByUUID, o = this._paths, a = this._parsedPaths, s = this._bindings, l = s.length, c = 0, h = arguments.length; c !== h; ++c) {
  44067. var u = arguments[c]
  44068. , d = u.uuid
  44069. , p = r[d];
  44070. if (void 0 === p) {
  44071. p = i++,
  44072. r[d] = p,
  44073. t.push(u);
  44074. for (var f = 0, g = l; f !== g; ++f)
  44075. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  44076. } else if (p < n) {
  44077. var m = t[p]
  44078. , v = --n
  44079. , y = t[v];
  44080. t[r[y.uuid] = p] = y,
  44081. t[r[d] = v] = u;
  44082. for (f = 0,
  44083. g = l; f !== g; ++f) {
  44084. var A = s[f]
  44085. , C = A[v]
  44086. , I = A[p];
  44087. A[p] = C,
  44088. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  44089. A[v] = I
  44090. }
  44091. } else
  44092. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  44093. }
  44094. this.nCachedObjects_ = n
  44095. },
  44096. remove: function(e) {
  44097. for (var t = this._objects, i = (t.length,
  44098. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  44099. var l = arguments[a]
  44100. , c = l.uuid
  44101. , h = n[c];
  44102. if (void 0 !== h && i <= h) {
  44103. var u = i++
  44104. , d = t[u];
  44105. t[n[d.uuid] = h] = d,
  44106. t[n[c] = u] = l;
  44107. for (var p = 0, f = o; p !== f; ++p) {
  44108. var g = r[p]
  44109. , m = g[u]
  44110. , v = g[h];
  44111. g[h] = m,
  44112. g[u] = v
  44113. }
  44114. }
  44115. }
  44116. this.nCachedObjects_ = i
  44117. },
  44118. uncache: function(e) {
  44119. 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) {
  44120. var c = arguments[s].uuid
  44121. , h = r[c];
  44122. if (void 0 !== h)
  44123. if (delete r[c],
  44124. h < n) {
  44125. var u = --n
  44126. , d = t[u]
  44127. , p = t[y = --i];
  44128. t[r[d.uuid] = h] = d,
  44129. t[r[p.uuid] = u] = p,
  44130. t.pop();
  44131. for (var f = 0, g = a; f !== g; ++f) {
  44132. var m = (A = o[f])[u]
  44133. , v = A[y];
  44134. A[h] = m,
  44135. A[u] = v,
  44136. A.pop()
  44137. }
  44138. } else {
  44139. var y;
  44140. t[r[(p = t[y = --i]).uuid] = h] = p,
  44141. t.pop();
  44142. for (f = 0,
  44143. g = a; f !== g; ++f) {
  44144. var A;
  44145. (A = o[f])[h] = A[y],
  44146. A.pop()
  44147. }
  44148. }
  44149. }
  44150. this.nCachedObjects_ = n
  44151. },
  44152. subscribe_: function(e, t) {
  44153. var i = this._bindingsIndicesByPath
  44154. , n = i[e]
  44155. , r = this._bindings;
  44156. if (void 0 !== n)
  44157. return r[n];
  44158. var o = this._paths
  44159. , a = this._parsedPaths
  44160. , s = this._objects
  44161. , l = s.length
  44162. , c = this.nCachedObjects_
  44163. , h = new Array(l);
  44164. n = r.length,
  44165. i[e] = n,
  44166. o.push(e),
  44167. a.push(t),
  44168. r.push(h);
  44169. for (var u = c, d = s.length; u !== d; ++u) {
  44170. var p = s[u];
  44171. h[u] = new Ci.PropertyBinding(p,e,t)
  44172. }
  44173. return h
  44174. },
  44175. unsubscribe_: function(e) {
  44176. var t = this._bindingsIndicesByPath
  44177. , i = t[e];
  44178. if (void 0 !== i) {
  44179. var n = this._paths
  44180. , r = this._parsedPaths
  44181. , o = this._bindings
  44182. , a = o.length - 1
  44183. , s = o[a];
  44184. o[t[e[a]] = i] = s,
  44185. o.pop(),
  44186. r[i] = r[a],
  44187. r.pop(),
  44188. n[i] = n[a],
  44189. n.pop()
  44190. }
  44191. }
  44192. },
  44193. Ci.AnimationUtils = {
  44194. arraySlice: function(e, t, i) {
  44195. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  44196. },
  44197. convertArray: function(e, t, i) {
  44198. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  44199. },
  44200. isTypedArray: function(e) {
  44201. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  44202. },
  44203. getKeyframeOrder: function(i) {
  44204. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  44205. t[n] = n;
  44206. return t.sort(function(e, t) {
  44207. return i[e] - i[t]
  44208. }),
  44209. t
  44210. },
  44211. sortedArray: function(e, t, i) {
  44212. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  44213. for (var s = i[o] * t, l = 0; l !== t; ++l)
  44214. r[a++] = e[s + l];
  44215. return r
  44216. },
  44217. flattenJSON: function(e, t, i, n) {
  44218. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  44219. o = e[r++];
  44220. if (void 0 !== o) {
  44221. var a = o[n];
  44222. if (void 0 !== a)
  44223. if (Array.isArray(a))
  44224. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44225. i.push.apply(i, a)),
  44226. void 0 !== (o = e[r++]); )
  44227. ;
  44228. else if (void 0 !== a.toArray)
  44229. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44230. a.toArray(i, i.length)),
  44231. void 0 !== (o = e[r++]); )
  44232. ;
  44233. else
  44234. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44235. i.push(a)),
  44236. void 0 !== (o = e[r++]); )
  44237. ;
  44238. }
  44239. }
  44240. },
  44241. Ci.KeyframeTrack = function(e, t, i, n) {
  44242. if (void 0 === e)
  44243. throw new Error("track name is undefined");
  44244. if (void 0 === t || 0 === t.length)
  44245. throw new Error("no keyframes in track named " + e);
  44246. this.name = e,
  44247. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  44248. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  44249. this.setInterpolation(n || this.DefaultInterpolation),
  44250. this.validate(),
  44251. this.optimize()
  44252. }
  44253. ,
  44254. Ci.KeyframeTrack.prototype = {
  44255. constructor: Ci.KeyframeTrack,
  44256. TimeBufferType: Float32Array,
  44257. ValueBufferType: Float32Array,
  44258. DefaultInterpolation: Ci.InterpolateLinear,
  44259. InterpolantFactoryMethodDiscrete: function(e) {
  44260. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  44261. },
  44262. InterpolantFactoryMethodLinear: function(e) {
  44263. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44264. },
  44265. InterpolantFactoryMethodSmooth: function(e) {
  44266. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  44267. },
  44268. setInterpolation: function(e) {
  44269. var t = void 0;
  44270. switch (e) {
  44271. case Ci.InterpolateDiscrete:
  44272. t = this.InterpolantFactoryMethodDiscrete;
  44273. break;
  44274. case Ci.InterpolateLinear:
  44275. t = this.InterpolantFactoryMethodLinear;
  44276. break;
  44277. case Ci.InterpolateSmooth:
  44278. t = this.InterpolantFactoryMethodSmooth
  44279. }
  44280. if (void 0 !== t)
  44281. this.createInterpolant = t;
  44282. else {
  44283. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  44284. if (void 0 === this.createInterpolant) {
  44285. if (e === this.DefaultInterpolation)
  44286. throw new Error(i);
  44287. this.setInterpolation(this.DefaultInterpolation)
  44288. }
  44289. console.warn(i)
  44290. }
  44291. },
  44292. getInterpolation: function() {
  44293. switch (this.createInterpolant) {
  44294. case this.InterpolantFactoryMethodDiscrete:
  44295. return Ci.InterpolateDiscrete;
  44296. case this.InterpolantFactoryMethodLinear:
  44297. return Ci.InterpolateLinear;
  44298. case this.InterpolantFactoryMethodSmooth:
  44299. return Ci.InterpolateSmooth
  44300. }
  44301. },
  44302. getValueSize: function() {
  44303. return this.values.length / this.times.length
  44304. },
  44305. shift: function(e) {
  44306. if (0 !== e)
  44307. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44308. t[i] += e;
  44309. return this
  44310. },
  44311. scale: function(e) {
  44312. if (1 !== e)
  44313. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44314. t[i] *= e;
  44315. return this
  44316. },
  44317. trim: function(e, t) {
  44318. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  44319. ++r;
  44320. for (; -1 !== o && i[o] > t; )
  44321. --o;
  44322. if (++o,
  44323. 0 !== r || o !== n) {
  44324. o <= r && (r = (o = Math.max(o, 1)) - 1);
  44325. var a = this.getValueSize();
  44326. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  44327. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  44328. }
  44329. return this
  44330. },
  44331. validate: function() {
  44332. var e = !0
  44333. , t = this.getValueSize();
  44334. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  44335. e = !1);
  44336. var i = this.times
  44337. , n = this.values
  44338. , r = i.length;
  44339. 0 === r && (console.error("track is empty", this),
  44340. e = !1);
  44341. for (var o = null, a = 0; a !== r; a++) {
  44342. var s = i[a];
  44343. if ("number" == typeof s && isNaN(s)) {
  44344. console.error("time is not a valid number", this, a, s),
  44345. e = !1;
  44346. break
  44347. }
  44348. if (null !== o && s < o) {
  44349. console.error("out of order keys", this, a, s, o),
  44350. e = !1;
  44351. break
  44352. }
  44353. o = s
  44354. }
  44355. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  44356. a = 0;
  44357. for (var l = n.length; a !== l; ++a) {
  44358. var c = n[a];
  44359. if (isNaN(c)) {
  44360. console.error("value is not a valid number", this, a, c),
  44361. e = !1;
  44362. break
  44363. }
  44364. }
  44365. }
  44366. return e
  44367. },
  44368. optimize: function() {
  44369. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  44370. var a = !1
  44371. , s = e[r];
  44372. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  44373. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  44374. var d = t[l + u];
  44375. if (d !== t[c + u] || d !== t[h + u]) {
  44376. a = !0;
  44377. break
  44378. }
  44379. }
  44380. if (a) {
  44381. if (r !== n) {
  44382. e[n] = e[r];
  44383. var p = r * i
  44384. , f = n * i;
  44385. for (u = 0; u !== i; ++u)
  44386. t[f + u] = t[p + u]
  44387. }
  44388. ++n
  44389. }
  44390. }
  44391. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  44392. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  44393. this
  44394. }
  44395. },
  44396. Object.assign(Ci.KeyframeTrack, {
  44397. parse: function(e) {
  44398. if (void 0 === e.type)
  44399. throw new Error("track type undefined, can not parse");
  44400. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  44401. if (void 0 === e.times) {
  44402. console.warn("legacy JSON format detected, converting");
  44403. var i = []
  44404. , n = [];
  44405. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  44406. e.times = i,
  44407. e.values = n
  44408. }
  44409. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  44410. },
  44411. toJSON: function(e) {
  44412. var t, i = e.constructor;
  44413. if (void 0 !== i.toJSON)
  44414. t = i.toJSON(e);
  44415. else {
  44416. t = {
  44417. name: e.name,
  44418. times: Ci.AnimationUtils.convertArray(e.times, Array),
  44419. values: Ci.AnimationUtils.convertArray(e.values, Array)
  44420. };
  44421. var n = e.getInterpolation();
  44422. n !== e.DefaultInterpolation && (t.interpolation = n)
  44423. }
  44424. return t.type = e.ValueTypeName,
  44425. t
  44426. },
  44427. _getTrackTypeForValueTypeName: function(e) {
  44428. switch (e.toLowerCase()) {
  44429. case "scalar":
  44430. case "double":
  44431. case "float":
  44432. case "number":
  44433. case "integer":
  44434. return Ci.NumberKeyframeTrack;
  44435. case "vector":
  44436. case "vector2":
  44437. case "vector3":
  44438. case "vector4":
  44439. return Ci.VectorKeyframeTrack;
  44440. case "color":
  44441. return Ci.ColorKeyframeTrack;
  44442. case "quaternion":
  44443. return Ci.QuaternionKeyframeTrack;
  44444. case "bool":
  44445. case "boolean":
  44446. return Ci.BooleanKeyframeTrack;
  44447. case "string":
  44448. return Ci.StringKeyframeTrack
  44449. }
  44450. throw new Error("Unsupported typeName: " + e)
  44451. }
  44452. }),
  44453. Ci.PropertyBinding = function(e, t, i) {
  44454. this.path = t,
  44455. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  44456. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44457. this.rootNode = e
  44458. }
  44459. ,
  44460. Ci.PropertyBinding.prototype = {
  44461. constructor: Ci.PropertyBinding,
  44462. getValue: function(e, t) {
  44463. this.bind(),
  44464. this.getValue(e, t)
  44465. },
  44466. setValue: function(e, t) {
  44467. this.bind(),
  44468. this.setValue(e, t)
  44469. },
  44470. bind: function() {
  44471. var e = this.node
  44472. , t = this.parsedPath
  44473. , i = t.objectName
  44474. , n = t.propertyName
  44475. , r = t.propertyIndex;
  44476. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44477. this.node = e),
  44478. this.getValue = this._getValue_unavailable,
  44479. this.setValue = this._setValue_unavailable,
  44480. e) {
  44481. if (i) {
  44482. var o = t.objectIndex;
  44483. switch (i) {
  44484. case "materials":
  44485. if (!e.material)
  44486. return void console.error(" can not bind to material as node does not have a material", this);
  44487. if (!e.material.materials)
  44488. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44489. e = e.material.materials;
  44490. break;
  44491. case "bones":
  44492. if (!e.skeleton)
  44493. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44494. e = e.skeleton.bones;
  44495. for (var a = 0; a < e.length; a++)
  44496. if (e[a].name === o) {
  44497. o = a;
  44498. break
  44499. }
  44500. break;
  44501. default:
  44502. if (void 0 === e[i])
  44503. return void console.error(" can not bind to objectName of node, undefined", this);
  44504. e = e[i]
  44505. }
  44506. if (void 0 !== o) {
  44507. if (void 0 === e[o])
  44508. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44509. e = e[o]
  44510. }
  44511. }
  44512. var s = e[n];
  44513. if (s) {
  44514. var l = this.Versioning.None;
  44515. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  44516. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  44517. this.targetObject = e);
  44518. var c = this.BindingType.Direct;
  44519. if (void 0 !== r) {
  44520. if ("morphTargetInfluences" === n) {
  44521. if (!e.geometry)
  44522. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44523. if (!e.geometry.morphTargets)
  44524. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44525. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  44526. if (e.geometry.morphTargets[a].name === r) {
  44527. r = a;
  44528. break
  44529. }
  44530. }
  44531. c = this.BindingType.ArrayElement,
  44532. this.resolvedProperty = s,
  44533. this.propertyIndex = r
  44534. } else
  44535. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  44536. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  44537. this.resolvedProperty = s) : this.propertyName = n;
  44538. this.getValue = this.GetterByBindingType[c],
  44539. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  44540. } else {
  44541. var h = t.nodeName;
  44542. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  44543. }
  44544. } else
  44545. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  44546. },
  44547. unbind: function() {
  44548. this.node = null,
  44549. this.getValue = this._getValue_unbound,
  44550. this.setValue = this._setValue_unbound
  44551. }
  44552. },
  44553. Object.assign(Ci.PropertyBinding.prototype, {
  44554. _getValue_unavailable: function() {},
  44555. _setValue_unavailable: function() {},
  44556. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  44557. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  44558. BindingType: {
  44559. Direct: 0,
  44560. EntireArray: 1,
  44561. ArrayElement: 2,
  44562. HasFromToArray: 3
  44563. },
  44564. Versioning: {
  44565. None: 0,
  44566. NeedsUpdate: 1,
  44567. MatrixWorldNeedsUpdate: 2
  44568. },
  44569. GetterByBindingType: [function(e, t) {
  44570. e[t] = this.node[this.propertyName]
  44571. }
  44572. , function(e, t) {
  44573. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44574. e[t++] = i[n]
  44575. }
  44576. , function(e, t) {
  44577. e[t] = this.resolvedProperty[this.propertyIndex]
  44578. }
  44579. , function(e, t) {
  44580. this.resolvedProperty.toArray(e, t)
  44581. }
  44582. ],
  44583. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44584. this.node[this.propertyName] = e[t]
  44585. }
  44586. , function(e, t) {
  44587. this.node[this.propertyName] = e[t],
  44588. this.targetObject.needsUpdate = !0
  44589. }
  44590. , function(e, t) {
  44591. this.node[this.propertyName] = e[t],
  44592. this.targetObject.matrixWorldNeedsUpdate = !0
  44593. }
  44594. ], [function(e, t) {
  44595. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44596. i[n] = e[t++]
  44597. }
  44598. , function(e, t) {
  44599. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44600. i[n] = e[t++];
  44601. this.targetObject.needsUpdate = !0
  44602. }
  44603. , function(e, t) {
  44604. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44605. i[n] = e[t++];
  44606. this.targetObject.matrixWorldNeedsUpdate = !0
  44607. }
  44608. ], [function(e, t) {
  44609. this.resolvedProperty[this.propertyIndex] = e[t]
  44610. }
  44611. , function(e, t) {
  44612. this.resolvedProperty[this.propertyIndex] = e[t],
  44613. this.targetObject.needsUpdate = !0
  44614. }
  44615. , function(e, t) {
  44616. this.resolvedProperty[this.propertyIndex] = e[t],
  44617. this.targetObject.matrixWorldNeedsUpdate = !0
  44618. }
  44619. ], [function(e, t) {
  44620. this.resolvedProperty.fromArray(e, t)
  44621. }
  44622. , function(e, t) {
  44623. this.resolvedProperty.fromArray(e, t),
  44624. this.targetObject.needsUpdate = !0
  44625. }
  44626. , function(e, t) {
  44627. this.resolvedProperty.fromArray(e, t),
  44628. this.targetObject.matrixWorldNeedsUpdate = !0
  44629. }
  44630. ]]
  44631. }),
  44632. Ci.PropertyBinding.Composite = function(e, t, i) {
  44633. var n = i || Ci.PropertyBinding.parseTrackName(t);
  44634. this._targetGroup = e,
  44635. this._bindings = e.subscribe_(t, n)
  44636. }
  44637. ,
  44638. Ci.PropertyBinding.Composite.prototype = {
  44639. constructor: Ci.PropertyBinding.Composite,
  44640. getValue: function(e, t) {
  44641. this.bind();
  44642. var i = this._targetGroup.nCachedObjects_
  44643. , n = this._bindings[i];
  44644. void 0 !== n && n.getValue(e, t)
  44645. },
  44646. setValue: function(e, t) {
  44647. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44648. i[n].setValue(e, t)
  44649. },
  44650. bind: function() {
  44651. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44652. e[t].bind()
  44653. },
  44654. unbind: function() {
  44655. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44656. e[t].unbind()
  44657. }
  44658. },
  44659. Ci.PropertyBinding.create = function(e, t, i) {
  44660. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  44661. }
  44662. ,
  44663. Ci.PropertyBinding.parseTrackName = function(e) {
  44664. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44665. , i = t.exec(e);
  44666. if (!i)
  44667. throw new Error("cannot parse trackName at all: " + e);
  44668. i.index === t.lastIndex && t.lastIndex++;
  44669. var n = {
  44670. nodeName: i[3],
  44671. objectName: i[5],
  44672. objectIndex: i[7],
  44673. propertyName: i[9],
  44674. propertyIndex: i[11]
  44675. };
  44676. if (null === n.propertyName || 0 === n.propertyName.length)
  44677. throw new Error("can not parse propertyName from trackName: " + e);
  44678. return n
  44679. }
  44680. ,
  44681. Ci.PropertyBinding.findNode = function(e, r) {
  44682. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  44683. return e;
  44684. if (e.skeleton) {
  44685. var t = function(e) {
  44686. for (var t = 0; t < e.bones.length; t++) {
  44687. var i = e.bones[t];
  44688. if (i.name === r)
  44689. return i
  44690. }
  44691. return null
  44692. }(e.skeleton);
  44693. if (t)
  44694. return t
  44695. }
  44696. if (e.children) {
  44697. var o = function(e) {
  44698. for (var t = 0; t < e.length; t++) {
  44699. var i = e[t];
  44700. if (i.name === r || i.uuid === r)
  44701. return i;
  44702. var n = o(i.children);
  44703. if (n)
  44704. return n
  44705. }
  44706. return null
  44707. }
  44708. , i = o(e.children);
  44709. if (i)
  44710. return i
  44711. }
  44712. return null
  44713. }
  44714. ,
  44715. Ci.PropertyMixer = function(e, t, i) {
  44716. this.binding = e,
  44717. this.valueSize = i;
  44718. var n, r = Float64Array;
  44719. switch (t) {
  44720. case "quaternion":
  44721. n = this._slerp;
  44722. break;
  44723. case "string":
  44724. case "bool":
  44725. r = Array,
  44726. n = this._select;
  44727. break;
  44728. default:
  44729. n = this._lerp
  44730. }
  44731. this.buffer = new r(4 * i),
  44732. this._mixBufferRegion = n,
  44733. this.cumulativeWeight = 0,
  44734. this.useCount = 0,
  44735. this.referenceCount = 0
  44736. }
  44737. ,
  44738. Ci.PropertyMixer.prototype = {
  44739. constructor: Ci.PropertyMixer,
  44740. accumulate: function(e, t) {
  44741. var i = this.buffer
  44742. , n = this.valueSize
  44743. , r = e * n + n
  44744. , o = this.cumulativeWeight;
  44745. if (0 === o) {
  44746. for (var a = 0; a !== n; ++a)
  44747. i[r + a] = i[a];
  44748. o = t
  44749. } else {
  44750. var s = t / (o += t);
  44751. this._mixBufferRegion(i, r, 0, s, n)
  44752. }
  44753. this.cumulativeWeight = o
  44754. },
  44755. apply: function(e) {
  44756. var t = this.valueSize
  44757. , i = this.buffer
  44758. , n = e * t + t
  44759. , r = this.cumulativeWeight
  44760. , o = this.binding;
  44761. if (this.cumulativeWeight = 0,
  44762. r < 1) {
  44763. var a = 3 * t;
  44764. this._mixBufferRegion(i, n, a, 1 - r, t)
  44765. }
  44766. for (var s = t, l = t + t; s !== l; ++s)
  44767. if (i[s] !== i[s + t]) {
  44768. o.setValue(i, n);
  44769. break
  44770. }
  44771. },
  44772. saveOriginalState: function() {
  44773. var e = this.binding
  44774. , t = this.buffer
  44775. , i = this.valueSize
  44776. , n = 3 * i;
  44777. e.getValue(t, n);
  44778. for (var r = i, o = n; r !== o; ++r)
  44779. t[r] = t[n + r % i];
  44780. this.cumulativeWeight = 0
  44781. },
  44782. restoreOriginalState: function() {
  44783. var e = 3 * this.valueSize;
  44784. this.binding.setValue(this.buffer, e)
  44785. },
  44786. _select: function(e, t, i, n, r) {
  44787. if (.5 <= n)
  44788. for (var o = 0; o !== r; ++o)
  44789. e[t + o] = e[i + o]
  44790. },
  44791. _slerp: function(e, t, i, n, r) {
  44792. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44793. },
  44794. _lerp: function(e, t, i, n, r) {
  44795. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44796. var s = t + a;
  44797. e[s] = e[s] * o + e[i + a] * n
  44798. }
  44799. }
  44800. },
  44801. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44802. Ci.KeyframeTrack.call(this, e, t, i)
  44803. }
  44804. ,
  44805. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44806. constructor: Ci.BooleanKeyframeTrack,
  44807. ValueTypeName: "bool",
  44808. ValueBufferType: Array,
  44809. DefaultInterpolation: Ci.IntepolateDiscrete,
  44810. InterpolantFactoryMethodLinear: void 0,
  44811. InterpolantFactoryMethodSmooth: void 0
  44812. }),
  44813. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44814. Ci.KeyframeTrack.call(this, e, t, i, n)
  44815. }
  44816. ,
  44817. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44818. constructor: Ci.NumberKeyframeTrack,
  44819. ValueTypeName: "number"
  44820. }),
  44821. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44822. Ci.KeyframeTrack.call(this, e, t, i, n)
  44823. }
  44824. ,
  44825. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44826. constructor: Ci.QuaternionKeyframeTrack,
  44827. ValueTypeName: "quaternion",
  44828. DefaultInterpolation: Ci.InterpolateLinear,
  44829. InterpolantFactoryMethodLinear: function(e) {
  44830. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44831. },
  44832. InterpolantFactoryMethodSmooth: void 0
  44833. }),
  44834. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44835. Ci.KeyframeTrack.call(this, e, t, i, n)
  44836. }
  44837. ,
  44838. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44839. constructor: Ci.StringKeyframeTrack,
  44840. ValueTypeName: "string",
  44841. ValueBufferType: Array,
  44842. DefaultInterpolation: Ci.IntepolateDiscrete,
  44843. InterpolantFactoryMethodLinear: void 0,
  44844. InterpolantFactoryMethodSmooth: void 0
  44845. }),
  44846. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44847. Ci.KeyframeTrack.call(this, e, t, i, n)
  44848. }
  44849. ,
  44850. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44851. constructor: Ci.VectorKeyframeTrack,
  44852. ValueTypeName: "vector"
  44853. }),
  44854. Ci.Audio = function(e) {
  44855. Ci.Object3D.call(this),
  44856. this.type = "Audio",
  44857. this.context = e.context,
  44858. this.source = this.context.createBufferSource(),
  44859. this.source.onended = this.onEnded.bind(this),
  44860. this.gain = this.context.createGain(),
  44861. this.gain.connect(e.getInput()),
  44862. this.autoplay = !1,
  44863. this.startTime = 0,
  44864. this.playbackRate = 1,
  44865. this.isPlaying = !1,
  44866. this.hasPlaybackControl = !0,
  44867. this.sourceType = "empty",
  44868. this.filter = null
  44869. }
  44870. ,
  44871. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44872. Ci.Audio.prototype.constructor = Ci.Audio,
  44873. Ci.Audio.prototype.getOutput = function() {
  44874. return this.gain
  44875. }
  44876. ,
  44877. Ci.Audio.prototype.load = function(e) {
  44878. var t = new Ci.AudioBuffer(this.context);
  44879. return t.load(e),
  44880. this.setBuffer(t),
  44881. this
  44882. }
  44883. ,
  44884. Ci.Audio.prototype.setNodeSource = function(e) {
  44885. return this.hasPlaybackControl = !1,
  44886. this.sourceType = "audioNode",
  44887. this.source = e,
  44888. this.connect(),
  44889. this
  44890. }
  44891. ,
  44892. Ci.Audio.prototype.setBuffer = function(e) {
  44893. var t = this;
  44894. return e.onReady(function(e) {
  44895. t.source.buffer = e,
  44896. t.sourceType = "buffer",
  44897. t.autoplay && t.play()
  44898. }),
  44899. this
  44900. }
  44901. ,
  44902. Ci.Audio.prototype.play = function() {
  44903. if (!0 !== this.isPlaying)
  44904. if (!1 !== this.hasPlaybackControl) {
  44905. var e = this.context.createBufferSource();
  44906. e.buffer = this.source.buffer,
  44907. e.loop = this.source.loop,
  44908. e.onended = this.source.onended,
  44909. e.start(0, this.startTime),
  44910. e.playbackRate.value = this.playbackRate,
  44911. this.isPlaying = !0,
  44912. this.source = e,
  44913. this.connect()
  44914. } else
  44915. console.warn("THREE.Audio: this Audio has no playback control.");
  44916. else
  44917. console.warn("THREE.Audio: Audio is already playing.")
  44918. }
  44919. ,
  44920. Ci.Audio.prototype.pause = function() {
  44921. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44922. void (this.startTime = this.context.currentTime))
  44923. }
  44924. ,
  44925. Ci.Audio.prototype.stop = function() {
  44926. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44927. void (this.startTime = 0))
  44928. }
  44929. ,
  44930. Ci.Audio.prototype.connect = function() {
  44931. null !== this.filter ? (this.source.connect(this.filter),
  44932. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44933. }
  44934. ,
  44935. Ci.Audio.prototype.disconnect = function() {
  44936. null !== this.filter ? (this.source.disconnect(this.filter),
  44937. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44938. }
  44939. ,
  44940. Ci.Audio.prototype.getFilter = function() {
  44941. return this.filter
  44942. }
  44943. ,
  44944. Ci.Audio.prototype.setFilter = function(e) {
  44945. void 0 === e && (e = null),
  44946. !0 === this.isPlaying ? (this.disconnect(),
  44947. this.filter = e,
  44948. this.connect()) : this.filter = e
  44949. }
  44950. ,
  44951. Ci.Audio.prototype.setPlaybackRate = function(e) {
  44952. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44953. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  44954. }
  44955. ,
  44956. Ci.Audio.prototype.getPlaybackRate = function() {
  44957. return this.playbackRate
  44958. }
  44959. ,
  44960. Ci.Audio.prototype.onEnded = function() {
  44961. this.isPlaying = !1
  44962. }
  44963. ,
  44964. Ci.Audio.prototype.setLoop = function(e) {
  44965. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44966. }
  44967. ,
  44968. Ci.Audio.prototype.getLoop = function() {
  44969. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44970. !1) : this.source.loop
  44971. }
  44972. ,
  44973. Ci.Audio.prototype.setVolume = function(e) {
  44974. this.gain.gain.value = e
  44975. }
  44976. ,
  44977. Ci.Audio.prototype.getVolume = function() {
  44978. return this.gain.gain.value
  44979. }
  44980. ,
  44981. Ci.AudioAnalyser = function(e, t) {
  44982. this.analyser = e.context.createAnalyser(),
  44983. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44984. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44985. e.getOutput().connect(this.analyser)
  44986. }
  44987. ,
  44988. Ci.AudioAnalyser.prototype = {
  44989. constructor: Ci.AudioAnalyser,
  44990. getData: function() {
  44991. return this.analyser.getByteFrequencyData(this.data),
  44992. this.data
  44993. }
  44994. },
  44995. Ci.AudioBuffer = function(e) {
  44996. this.context = e,
  44997. this.ready = !1,
  44998. this.readyCallbacks = []
  44999. }
  45000. ,
  45001. Ci.AudioBuffer.prototype.load = function(e) {
  45002. var i = this
  45003. , t = new XMLHttpRequest;
  45004. return t.open("GET", e, !0),
  45005. t.responseType = "arraybuffer",
  45006. t.onload = function(e) {
  45007. i.context.decodeAudioData(this.response, function(e) {
  45008. i.buffer = e,
  45009. i.ready = !0;
  45010. for (var t = 0; t < i.readyCallbacks.length; t++)
  45011. i.readyCallbacks[t](i.buffer);
  45012. i.readyCallbacks = []
  45013. })
  45014. }
  45015. ,
  45016. t.send(),
  45017. this
  45018. }
  45019. ,
  45020. Ci.AudioBuffer.prototype.onReady = function(e) {
  45021. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  45022. }
  45023. ,
  45024. Ci.PositionalAudio = function(e) {
  45025. Ci.Audio.call(this, e),
  45026. this.panner = this.context.createPanner(),
  45027. this.panner.connect(this.gain)
  45028. }
  45029. ,
  45030. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  45031. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  45032. Ci.PositionalAudio.prototype.getOutput = function() {
  45033. return this.panner
  45034. }
  45035. ,
  45036. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  45037. this.panner.refDistance = e
  45038. }
  45039. ,
  45040. Ci.PositionalAudio.prototype.getRefDistance = function() {
  45041. return this.panner.refDistance
  45042. }
  45043. ,
  45044. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  45045. this.panner.rolloffFactor = e
  45046. }
  45047. ,
  45048. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  45049. return this.panner.rolloffFactor
  45050. }
  45051. ,
  45052. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  45053. this.panner.distanceModel = e
  45054. }
  45055. ,
  45056. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  45057. return this.panner.distanceModel
  45058. }
  45059. ,
  45060. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  45061. this.panner.maxDistance = e
  45062. }
  45063. ,
  45064. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  45065. return this.panner.maxDistance
  45066. }
  45067. ,
  45068. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  45069. function(e) {
  45070. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  45071. it.setFromMatrixPosition(this.matrixWorld),
  45072. this.panner.setPosition(it.x, it.y, it.z)
  45073. }
  45074. ),
  45075. Ci.AudioListener = function() {
  45076. Ci.Object3D.call(this),
  45077. this.type = "AudioListener",
  45078. this.context = new (window.AudioContext || window.webkitAudioContext),
  45079. this.gain = this.context.createGain(),
  45080. this.gain.connect(this.context.destination),
  45081. this.filter = null
  45082. }
  45083. ,
  45084. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  45085. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  45086. Ci.AudioListener.prototype.getInput = function() {
  45087. return this.gain
  45088. }
  45089. ,
  45090. Ci.AudioListener.prototype.removeFilter = function() {
  45091. null !== this.filter && (this.gain.disconnect(this.filter),
  45092. this.filter.disconnect(this.context.destination),
  45093. this.gain.connect(this.context.destination),
  45094. this.filter = null)
  45095. }
  45096. ,
  45097. Ci.AudioListener.prototype.setFilter = function(e) {
  45098. null !== this.filter ? (this.gain.disconnect(this.filter),
  45099. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  45100. this.filter = e,
  45101. this.gain.connect(this.filter),
  45102. this.filter.connect(this.context.destination)
  45103. }
  45104. ,
  45105. Ci.AudioListener.prototype.getFilter = function() {
  45106. return this.filter
  45107. }
  45108. ,
  45109. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  45110. this.gain.gain.value = e
  45111. }
  45112. ,
  45113. Ci.AudioListener.prototype.getMasterVolume = function() {
  45114. return this.gain.gain.value
  45115. }
  45116. ,
  45117. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  45118. $e = new Ci.Quaternion,
  45119. et = new Ci.Vector3,
  45120. tt = new Ci.Vector3,
  45121. function(e) {
  45122. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  45123. var t = this.context.listener
  45124. , i = this.up;
  45125. this.matrixWorld.decompose(Je, $e, et),
  45126. tt.set(0, 0, -1).applyQuaternion($e),
  45127. t.setPosition(Je.x, Je.y, Je.z),
  45128. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  45129. }
  45130. ),
  45131. Ci.Camera = function() {
  45132. Ci.Object3D.call(this),
  45133. this.type = "Camera",
  45134. this.matrixWorldInverse = new Ci.Matrix4,
  45135. this.projectionMatrix = new Ci.Matrix4
  45136. }
  45137. ,
  45138. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  45139. Ci.Camera.prototype.constructor = Ci.Camera,
  45140. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  45141. function(e) {
  45142. var t = e || new Ci.Vector3;
  45143. return this.getWorldQuaternion(Qe),
  45144. t.set(0, 0, -1).applyQuaternion(Qe)
  45145. }
  45146. ),
  45147. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  45148. function(e) {
  45149. Ke.lookAt(this.position, e, this.up),
  45150. this.quaternion.setFromRotationMatrix(Ke)
  45151. }
  45152. ),
  45153. Ci.Camera.prototype.clone = function() {
  45154. return (new this.constructor).copy(this)
  45155. }
  45156. ,
  45157. Ci.Camera.prototype.copy = function(e) {
  45158. return Ci.Object3D.prototype.copy.call(this, e),
  45159. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  45160. this.projectionMatrix.copy(e.projectionMatrix),
  45161. this
  45162. }
  45163. ,
  45164. Ci.CubeCamera = function(e, t, i) {
  45165. Ci.Object3D.call(this),
  45166. this.type = "CubeCamera";
  45167. var r = new Ci.PerspectiveCamera(90,1,e,t);
  45168. r.up.set(0, -1, 0),
  45169. r.lookAt(new Ci.Vector3(1,0,0)),
  45170. this.add(r);
  45171. var o = new Ci.PerspectiveCamera(90,1,e,t);
  45172. o.up.set(0, -1, 0),
  45173. o.lookAt(new Ci.Vector3(-1,0,0)),
  45174. this.add(o);
  45175. var a = new Ci.PerspectiveCamera(90,1,e,t);
  45176. a.up.set(0, 0, 1),
  45177. a.lookAt(new Ci.Vector3(0,1,0)),
  45178. this.add(a);
  45179. var s = new Ci.PerspectiveCamera(90,1,e,t);
  45180. s.up.set(0, 0, -1),
  45181. s.lookAt(new Ci.Vector3(0,-1,0)),
  45182. this.add(s);
  45183. var l = new Ci.PerspectiveCamera(90,1,e,t);
  45184. l.up.set(0, -1, 0),
  45185. l.lookAt(new Ci.Vector3(0,0,1)),
  45186. this.add(l);
  45187. var c = new Ci.PerspectiveCamera(90,1,e,t);
  45188. c.up.set(0, -1, 0),
  45189. c.lookAt(new Ci.Vector3(0,0,-1)),
  45190. this.add(c);
  45191. var n = {
  45192. format: Ci.RGBFormat,
  45193. magFilter: Ci.LinearFilter,
  45194. minFilter: Ci.LinearFilter
  45195. };
  45196. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  45197. this.updateCubeMap = function(e, t) {
  45198. null === this.parent && this.updateMatrixWorld();
  45199. var i = this.renderTarget
  45200. , n = i.texture.generateMipmaps;
  45201. i.texture.generateMipmaps = !1,
  45202. i.activeCubeFace = 0,
  45203. e.render(t, r, i),
  45204. i.activeCubeFace = 1,
  45205. e.render(t, o, i),
  45206. i.activeCubeFace = 2,
  45207. e.render(t, a, i),
  45208. i.activeCubeFace = 3,
  45209. e.render(t, s, i),
  45210. i.activeCubeFace = 4,
  45211. e.render(t, l, i),
  45212. i.texture.generateMipmaps = n,
  45213. i.activeCubeFace = 5,
  45214. e.render(t, c, i),
  45215. e.setRenderTarget(null)
  45216. }
  45217. }
  45218. ,
  45219. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  45220. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  45221. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  45222. Ci.Camera.call(this),
  45223. this.type = "OrthographicCamera",
  45224. this.zoom = 1,
  45225. this.left = e,
  45226. this.right = t,
  45227. this.top = i,
  45228. this.bottom = n,
  45229. this.near = void 0 !== r ? r : .1,
  45230. this.far = void 0 !== o ? o : 2e3,
  45231. this.updateProjectionMatrix()
  45232. }
  45233. ,
  45234. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  45235. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  45236. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  45237. var e = (this.right - this.left) / (2 * this.zoom)
  45238. , t = (this.top - this.bottom) / (2 * this.zoom)
  45239. , i = (this.right + this.left) / 2
  45240. , n = (this.top + this.bottom) / 2;
  45241. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  45242. }
  45243. ,
  45244. Ci.OrthographicCamera.prototype.copy = function(e) {
  45245. return Ci.Camera.prototype.copy.call(this, e),
  45246. this.left = e.left,
  45247. this.right = e.right,
  45248. this.top = e.top,
  45249. this.bottom = e.bottom,
  45250. this.near = e.near,
  45251. this.far = e.far,
  45252. this.zoom = e.zoom,
  45253. this
  45254. }
  45255. ,
  45256. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  45257. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45258. return t.object.zoom = this.zoom,
  45259. t.object.left = this.left,
  45260. t.object.right = this.right,
  45261. t.object.top = this.top,
  45262. t.object.bottom = this.bottom,
  45263. t.object.near = this.near,
  45264. t.object.far = this.far,
  45265. t
  45266. }
  45267. ,
  45268. Ci.PerspectiveCamera = function(e, t, i, n) {
  45269. Ci.Camera.call(this),
  45270. this.type = "PerspectiveCamera",
  45271. this.focalLength = 10,
  45272. this.zoom = 1,
  45273. this.fov = void 0 !== e ? e : 50,
  45274. this.aspect = void 0 !== t ? t : 1,
  45275. this.near = void 0 !== i ? i : .1,
  45276. this.far = void 0 !== n ? n : 2e3,
  45277. this.updateProjectionMatrix()
  45278. }
  45279. ,
  45280. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  45281. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  45282. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  45283. void 0 === t && (t = 24),
  45284. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  45285. this.updateProjectionMatrix()
  45286. }
  45287. ,
  45288. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  45289. this.fullWidth = e,
  45290. this.fullHeight = t,
  45291. this.x = i,
  45292. this.y = n,
  45293. this.width = r,
  45294. this.height = o,
  45295. this.updateProjectionMatrix()
  45296. }
  45297. ,
  45298. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  45299. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  45300. if (this.fullWidth) {
  45301. var t = this.fullWidth / this.fullHeight
  45302. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  45303. , n = -i
  45304. , r = t * n
  45305. , o = t * i
  45306. , a = Math.abs(o - r)
  45307. , s = Math.abs(i - n);
  45308. this.projectionMatrix.makeFrustum(r + this.x * a / this.fullWidth, r + (this.x + this.width) * a / this.fullWidth, i - (this.y + this.height) * s / this.fullHeight, i - this.y * s / this.fullHeight, this.near, this.far)
  45309. } else
  45310. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  45311. }
  45312. ,
  45313. Ci.PerspectiveCamera.prototype.copy = function(e) {
  45314. return Ci.Camera.prototype.copy.call(this, e),
  45315. this.focalLength = e.focalLength,
  45316. this.zoom = e.zoom,
  45317. this.fov = e.fov,
  45318. this.aspect = e.aspect,
  45319. this.near = e.near,
  45320. this.far = e.far,
  45321. this
  45322. }
  45323. ,
  45324. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  45325. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45326. return t.object.focalLength = this.focalLength,
  45327. t.object.zoom = this.zoom,
  45328. t.object.fov = this.fov,
  45329. t.object.aspect = this.aspect,
  45330. t.object.near = this.near,
  45331. t.object.far = this.far,
  45332. t
  45333. }
  45334. ,
  45335. Ci.StereoCamera = function() {
  45336. this.type = "StereoCamera",
  45337. this.aspect = 1,
  45338. this.cameraL = new Ci.PerspectiveCamera,
  45339. this.cameraL.layers.enable(1),
  45340. this.cameraL.matrixAutoUpdate = !1,
  45341. this.cameraR = new Ci.PerspectiveCamera,
  45342. this.cameraR.layers.enable(2),
  45343. this.cameraR.matrixAutoUpdate = !1
  45344. }
  45345. ,
  45346. Ci.StereoCamera.prototype = {
  45347. constructor: Ci.StereoCamera,
  45348. update: (Xe = new Ci.Matrix4,
  45349. Ze = new Ci.Matrix4,
  45350. function(e) {
  45351. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  45352. Ge = e.focalLength,
  45353. We = e.fov,
  45354. je = e.aspect * this.aspect,
  45355. Ye = e.near,
  45356. qe = e.far;
  45357. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  45358. Ze.elements[12] = -.032,
  45359. Xe.elements[12] = .032,
  45360. t = -o * je + r,
  45361. i = o * je + r,
  45362. n.elements[0] = 2 * Ye / (i - t),
  45363. n.elements[8] = (i + t) / (i - t),
  45364. this.cameraL.projectionMatrix.copy(n),
  45365. t = -o * je - r,
  45366. i = o * je - r,
  45367. n.elements[0] = 2 * Ye / (i - t),
  45368. n.elements[8] = (i + t) / (i - t),
  45369. this.cameraR.projectionMatrix.copy(n)
  45370. }
  45371. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  45372. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  45373. }
  45374. )
  45375. },
  45376. Ci.Light = function(e, t) {
  45377. Ci.Object3D.call(this),
  45378. this.type = "Light",
  45379. this.color = new Ci.Color(e),
  45380. this.intensity = void 0 !== t ? t : 1,
  45381. this.receiveShadow = void 0
  45382. }
  45383. ,
  45384. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  45385. Ci.Light.prototype.constructor = Ci.Light,
  45386. Ci.Light.prototype.copy = function(e) {
  45387. return Ci.Object3D.prototype.copy.call(this, e),
  45388. this.color.copy(e.color),
  45389. this.intensity = e.intensity,
  45390. this
  45391. }
  45392. ,
  45393. Ci.Light.prototype.toJSON = function(e) {
  45394. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45395. return t.object.color = this.color.getHex(),
  45396. t.object.intensity = this.intensity,
  45397. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  45398. void 0 !== this.distance && (t.object.distance = this.distance),
  45399. void 0 !== this.angle && (t.object.angle = this.angle),
  45400. void 0 !== this.decay && (t.object.decay = this.decay),
  45401. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  45402. t
  45403. }
  45404. ,
  45405. Ci.LightShadow = function(e) {
  45406. this.camera = e,
  45407. this.bias = 0,
  45408. this.radius = 1,
  45409. this.mapSize = new Ci.Vector2(512,512),
  45410. this.map = null,
  45411. this.matrix = new Ci.Matrix4
  45412. }
  45413. ,
  45414. Ci.LightShadow.prototype = {
  45415. constructor: Ci.LightShadow,
  45416. copy: function(e) {
  45417. return this.camera = e.camera.clone(),
  45418. this.bias = e.bias,
  45419. this.radius = e.radius,
  45420. this.mapSize.copy(e.mapSize),
  45421. this
  45422. },
  45423. clone: function() {
  45424. return (new this.constructor).copy(this)
  45425. }
  45426. },
  45427. Ci.AmbientLight = function(e, t) {
  45428. Ci.Light.call(this, e, t),
  45429. this.type = "AmbientLight",
  45430. this.castShadow = void 0
  45431. }
  45432. ,
  45433. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  45434. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  45435. Ci.DirectionalLight = function(e, t) {
  45436. Ci.Light.call(this, e, t),
  45437. this.type = "DirectionalLight",
  45438. this.position.set(0, 1, 0),
  45439. this.updateMatrix(),
  45440. this.target = new Ci.Object3D,
  45441. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  45442. }
  45443. ,
  45444. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  45445. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  45446. Ci.DirectionalLight.prototype.copy = function(e) {
  45447. return Ci.Light.prototype.copy.call(this, e),
  45448. this.target = e.target.clone(),
  45449. this.shadow = e.shadow.clone(),
  45450. this
  45451. }
  45452. ,
  45453. Ci.HemisphereLight = function(e, t, i) {
  45454. Ci.Light.call(this, e, i),
  45455. this.type = "HemisphereLight",
  45456. this.castShadow = void 0,
  45457. this.position.set(0, 1, 0),
  45458. this.updateMatrix(),
  45459. this.groundColor = new Ci.Color(t)
  45460. }
  45461. ,
  45462. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  45463. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  45464. Ci.HemisphereLight.prototype.copy = function(e) {
  45465. return Ci.Light.prototype.copy.call(this, e),
  45466. this.groundColor.copy(e.groundColor),
  45467. this
  45468. }
  45469. ,
  45470. Ci.PointLight = function(e, t, i, n) {
  45471. Ci.Light.call(this, e, t),
  45472. this.type = "PointLight",
  45473. this.distance = void 0 !== i ? i : 0,
  45474. this.decay = void 0 !== n ? n : 1,
  45475. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  45476. }
  45477. ,
  45478. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  45479. Ci.PointLight.prototype.constructor = Ci.PointLight,
  45480. Object.defineProperty(Ci.PointLight.prototype, "power", {
  45481. get: function() {
  45482. return 4 * this.intensity * Math.PI
  45483. },
  45484. set: function(e) {
  45485. this.intensity = e / (4 * Math.PI)
  45486. }
  45487. }),
  45488. Ci.PointLight.prototype.copy = function(e) {
  45489. return Ci.Light.prototype.copy.call(this, e),
  45490. this.distance = e.distance,
  45491. this.decay = e.decay,
  45492. this.shadow = e.shadow.clone(),
  45493. this
  45494. }
  45495. ,
  45496. Ci.SpotLight = function(e, t, i, n, r, o) {
  45497. Ci.Light.call(this, e, t),
  45498. this.type = "SpotLight",
  45499. this.position.set(0, 1, 0),
  45500. this.updateMatrix(),
  45501. this.target = new Ci.Object3D,
  45502. this.distance = void 0 !== i ? i : 0,
  45503. this.angle = void 0 !== n ? n : Math.PI / 3,
  45504. this.penumbra = void 0 !== r ? r : 0,
  45505. this.decay = void 0 !== o ? o : 1,
  45506. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  45507. }
  45508. ,
  45509. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  45510. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  45511. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  45512. get: function() {
  45513. return this.intensity * Math.PI
  45514. },
  45515. set: function(e) {
  45516. this.intensity = e / Math.PI
  45517. }
  45518. }),
  45519. Ci.SpotLight.prototype.copy = function(e) {
  45520. return Ci.Light.prototype.copy.call(this, e),
  45521. this.distance = e.distance,
  45522. this.angle = e.angle,
  45523. this.penumbra = e.penumbra,
  45524. this.decay = e.decay,
  45525. this.target = e.target.clone(),
  45526. this.shadow = e.shadow.clone(),
  45527. this
  45528. }
  45529. ,
  45530. Ci.Cache = {
  45531. enabled: !1,
  45532. files: {},
  45533. add: function(e, t) {
  45534. !1 !== this.enabled && (this.files[e] = t)
  45535. },
  45536. get: function(e) {
  45537. if (!1 !== this.enabled)
  45538. return this.files[e]
  45539. },
  45540. remove: function(e) {
  45541. delete this.files[e]
  45542. },
  45543. clear: function() {
  45544. this.files = {}
  45545. }
  45546. },
  45547. Ci.Loader = function() {
  45548. this.onLoadStart = function() {}
  45549. ,
  45550. this.onLoadProgress = function() {}
  45551. ,
  45552. this.onLoadComplete = function() {}
  45553. }
  45554. ,
  45555. Ci.Loader.prototype = {
  45556. constructor: Ci.Loader,
  45557. crossOrigin: void 0,
  45558. extractUrlBase: function(e) {
  45559. var t = e.split("/");
  45560. return 1 === t.length ? "./" : (t.pop(),
  45561. t.join("/") + "/")
  45562. },
  45563. initMaterials: function(e, t, i) {
  45564. for (var n = [], r = 0; r < e.length; ++r)
  45565. n[r] = this.createMaterial(e[r], t, i);
  45566. return n
  45567. },
  45568. createMaterial: function(e, c, h) {
  45569. function t(e, t, i, n, r) {
  45570. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  45571. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  45572. He.load(a)),
  45573. void 0 !== t && (o.repeat.fromArray(t),
  45574. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  45575. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  45576. void 0 !== i && o.offset.fromArray(i),
  45577. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  45578. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  45579. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  45580. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  45581. void 0 !== r && (o.anisotropy = r);
  45582. var l = Ci.Math.generateUUID();
  45583. return u[l] = o,
  45584. l
  45585. }
  45586. void 0 === Ue && (Ue = new Ci.Color),
  45587. void 0 === He && (He = new Ci.TextureLoader),
  45588. void 0 === ze && (ze = new Ci.MaterialLoader);
  45589. var u = {}
  45590. , i = {
  45591. uuid: Ci.Math.generateUUID(),
  45592. type: "MeshLambertMaterial"
  45593. };
  45594. for (var n in e) {
  45595. var r = e[n];
  45596. switch (n) {
  45597. case "DbgColor":
  45598. case "DbgIndex":
  45599. case "opticalDensity":
  45600. case "illumination":
  45601. break;
  45602. case "DbgName":
  45603. i.name = r;
  45604. break;
  45605. case "blending":
  45606. i.blending = Ci[r];
  45607. break;
  45608. case "colorAmbient":
  45609. case "mapAmbient":
  45610. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  45611. break;
  45612. case "colorDiffuse":
  45613. i.color = Ue.fromArray(r).getHex();
  45614. break;
  45615. case "colorSpecular":
  45616. i.specular = Ue.fromArray(r).getHex();
  45617. break;
  45618. case "colorEmissive":
  45619. i.emissive = Ue.fromArray(r).getHex();
  45620. break;
  45621. case "specularCoef":
  45622. i.shininess = r;
  45623. break;
  45624. case "shading":
  45625. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  45626. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  45627. break;
  45628. case "mapDiffuse":
  45629. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  45630. break;
  45631. case "mapDiffuseRepeat":
  45632. case "mapDiffuseOffset":
  45633. case "mapDiffuseWrap":
  45634. case "mapDiffuseAnisotropy":
  45635. break;
  45636. case "mapLight":
  45637. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  45638. break;
  45639. case "mapLightRepeat":
  45640. case "mapLightOffset":
  45641. case "mapLightWrap":
  45642. case "mapLightAnisotropy":
  45643. break;
  45644. case "mapAO":
  45645. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  45646. break;
  45647. case "mapAORepeat":
  45648. case "mapAOOffset":
  45649. case "mapAOWrap":
  45650. case "mapAOAnisotropy":
  45651. break;
  45652. case "mapBump":
  45653. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  45654. break;
  45655. case "mapBumpScale":
  45656. i.bumpScale = r;
  45657. break;
  45658. case "mapBumpRepeat":
  45659. case "mapBumpOffset":
  45660. case "mapBumpWrap":
  45661. case "mapBumpAnisotropy":
  45662. break;
  45663. case "mapNormal":
  45664. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  45665. break;
  45666. case "mapNormalFactor":
  45667. i.normalScale = [r, r];
  45668. break;
  45669. case "mapNormalRepeat":
  45670. case "mapNormalOffset":
  45671. case "mapNormalWrap":
  45672. case "mapNormalAnisotropy":
  45673. break;
  45674. case "mapSpecular":
  45675. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  45676. break;
  45677. case "mapSpecularRepeat":
  45678. case "mapSpecularOffset":
  45679. case "mapSpecularWrap":
  45680. case "mapSpecularAnisotropy":
  45681. break;
  45682. case "mapAlpha":
  45683. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  45684. break;
  45685. case "mapAlphaRepeat":
  45686. case "mapAlphaOffset":
  45687. case "mapAlphaWrap":
  45688. case "mapAlphaAnisotropy":
  45689. break;
  45690. case "flipSided":
  45691. i.side = Ci.BackSide;
  45692. break;
  45693. case "doubleSided":
  45694. i.side = Ci.DoubleSide;
  45695. break;
  45696. case "transparency":
  45697. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45698. i.opacity = r;
  45699. break;
  45700. case "depthTest":
  45701. case "depthWrite":
  45702. case "colorWrite":
  45703. case "opacity":
  45704. case "reflectivity":
  45705. case "transparent":
  45706. case "visible":
  45707. case "wireframe":
  45708. i[n] = r;
  45709. break;
  45710. case "vertexColors":
  45711. !0 === r && (i.vertexColors = Ci.VertexColors),
  45712. "face" === r && (i.vertexColors = Ci.FaceColors);
  45713. break;
  45714. default:
  45715. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  45716. }
  45717. }
  45718. return "MeshBasicMaterial" === i.type && delete i.emissive,
  45719. "MeshPhongMaterial" !== i.type && delete i.specular,
  45720. i.opacity < 1 && (i.transparent = !0),
  45721. ze.setTextures(u),
  45722. ze.parse(i)
  45723. }
  45724. },
  45725. Ci.Loader.Handlers = {
  45726. handlers: [],
  45727. add: function(e, t) {
  45728. this.handlers.push(e, t)
  45729. },
  45730. get: function(e) {
  45731. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45732. var r = t[i]
  45733. , o = t[i + 1];
  45734. if (r.test(e))
  45735. return o
  45736. }
  45737. return null
  45738. }
  45739. },
  45740. Ci.XHRLoader = function(e) {
  45741. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45742. }
  45743. ,
  45744. Ci.XHRLoader.prototype = {
  45745. constructor: Ci.XHRLoader,
  45746. load: function(i, n, t, r) {
  45747. void 0 !== this.path && (i = this.path + i);
  45748. var o = this
  45749. , e = Ci.Cache.get(i);
  45750. if (void 0 !== e)
  45751. return n && setTimeout(function() {
  45752. n(e)
  45753. }, 0),
  45754. e;
  45755. var a = new XMLHttpRequest;
  45756. return a.overrideMimeType("text/plain"),
  45757. a.open("GET", i, !0),
  45758. a.addEventListener("load", function(e) {
  45759. var t = e.target.response;
  45760. Ci.Cache.add(i, t),
  45761. 200 === this.status ? (n && n(t),
  45762. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45763. n && n(t),
  45764. o.manager.itemEnd(i)) : (r && r(e),
  45765. o.manager.itemError(i))
  45766. }, !1),
  45767. void 0 !== t && a.addEventListener("progress", function(e) {
  45768. t(e)
  45769. }, !1),
  45770. a.addEventListener("error", function(e) {
  45771. r && r(e),
  45772. o.manager.itemError(i)
  45773. }, !1),
  45774. void 0 !== this.responseType && (a.responseType = this.responseType),
  45775. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  45776. a.send(null),
  45777. o.manager.itemStart(i),
  45778. a
  45779. },
  45780. setPath: function(e) {
  45781. this.path = e
  45782. },
  45783. setResponseType: function(e) {
  45784. this.responseType = e
  45785. },
  45786. setWithCredentials: function(e) {
  45787. this.withCredentials = e
  45788. }
  45789. },
  45790. Ci.FontLoader = function(e) {
  45791. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45792. }
  45793. ,
  45794. Ci.FontLoader.prototype = {
  45795. constructor: Ci.FontLoader,
  45796. load: function(e, t, i, n) {
  45797. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45798. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45799. }, i, n)
  45800. }
  45801. },
  45802. Ci.ImageLoader = function(e) {
  45803. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45804. }
  45805. ,
  45806. Ci.ImageLoader.prototype = {
  45807. constructor: Ci.ImageLoader,
  45808. load: function(t, i, n, r) {
  45809. void 0 !== this.path && (t = this.path + t);
  45810. var o = this
  45811. , e = Ci.Cache.get(t);
  45812. if (void 0 !== e)
  45813. return o.manager.itemStart(t),
  45814. i ? setTimeout(function() {
  45815. i(e),
  45816. o.manager.itemEnd(t)
  45817. }, 0) : o.manager.itemEnd(t),
  45818. e;
  45819. var a = document.createElement("img");
  45820. return a.addEventListener("load", function(e) {
  45821. Ci.Cache.add(t, this),
  45822. i && i(this),
  45823. o.manager.itemEnd(t)
  45824. }, !1),
  45825. void 0 !== n && a.addEventListener("progress", function(e) {
  45826. n(e)
  45827. }, !1),
  45828. a.addEventListener("error", function(e) {
  45829. r && r(e),
  45830. o.manager.itemError(t)
  45831. }, !1),
  45832. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45833. o.manager.itemStart(t),
  45834. a.src = t,
  45835. a
  45836. },
  45837. setCrossOrigin: function(e) {
  45838. this.crossOrigin = e
  45839. },
  45840. setPath: function(e) {
  45841. this.path = e
  45842. }
  45843. },
  45844. Ci.JSONLoader = function(e) {
  45845. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45846. e = void 0),
  45847. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45848. this.withCredentials = !1
  45849. }
  45850. ,
  45851. Ci.JSONLoader.prototype = {
  45852. constructor: Ci.JSONLoader,
  45853. get statusDomElement() {
  45854. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45855. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45856. this._statusDomElement
  45857. },
  45858. load: function(o, a, e, t) {
  45859. var s = this
  45860. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45861. , i = new Ci.XHRLoader(this.manager);
  45862. i.setWithCredentials(this.withCredentials),
  45863. i.load(o, function(e) {
  45864. var t = JSON.parse(e)
  45865. , i = t.metadata;
  45866. if (void 0 !== i) {
  45867. var n = i.type;
  45868. if (void 0 !== n) {
  45869. if ("object" === n.toLowerCase())
  45870. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45871. if ("scene" === n.toLowerCase())
  45872. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45873. }
  45874. }
  45875. var r = s.parse(t, l);
  45876. a(r.geometry, r.materials)
  45877. }, e, t)
  45878. },
  45879. setTexturePath: function(e) {
  45880. this.texturePath = e
  45881. },
  45882. parse: function(D, e) {
  45883. var N = new Ci.Geometry
  45884. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45885. if (function(e) {
  45886. function t(e, t) {
  45887. return e & 1 << t
  45888. }
  45889. var i, n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M = D.faces, R = D.vertices, P = D.normals, O = D.colors, L = 0;
  45890. if (void 0 !== D.uvs) {
  45891. for (i = 0; i < D.uvs.length; i++)
  45892. D.uvs[i].length && L++;
  45893. for (i = 0; i < L; i++)
  45894. N.faceVertexUvs[i] = []
  45895. }
  45896. for (o = 0,
  45897. a = R.length; o < a; )
  45898. (A = new Ci.Vector3).x = R[o++] * e,
  45899. A.y = R[o++] * e,
  45900. A.z = R[o++] * e,
  45901. N.vertices.push(A);
  45902. for (o = 0,
  45903. a = M.length; o < a; )
  45904. if (d = t(u = M[o++], 0),
  45905. p = t(u, 1),
  45906. f = t(u, 3),
  45907. g = t(u, 4),
  45908. m = t(u, 5),
  45909. v = t(u, 6),
  45910. y = t(u, 7),
  45911. d) {
  45912. if ((I = new Ci.Face3).a = M[o],
  45913. I.b = M[o + 1],
  45914. I.c = M[o + 3],
  45915. (E = new Ci.Face3).a = M[o + 1],
  45916. E.b = M[o + 2],
  45917. E.c = M[o + 3],
  45918. o += 4,
  45919. p && (h = M[o++],
  45920. I.materialIndex = h,
  45921. E.materialIndex = h),
  45922. r = N.faces.length,
  45923. f)
  45924. for (i = 0; i < L; i++)
  45925. for (w = D.uvs[i],
  45926. N.faceVertexUvs[i][r] = [],
  45927. N.faceVertexUvs[i][r + 1] = [],
  45928. n = 0; n < 4; n++)
  45929. x = w[2 * (c = M[o++])],
  45930. S = w[2 * c + 1],
  45931. T = new Ci.Vector2(x,S),
  45932. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45933. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45934. if (g && (l = 3 * M[o++],
  45935. I.normal.set(P[l++], P[l++], P[l]),
  45936. E.normal.copy(I.normal)),
  45937. m)
  45938. for (i = 0; i < 4; i++)
  45939. l = 3 * M[o++],
  45940. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45941. 2 !== i && I.vertexNormals.push(b),
  45942. 0 !== i && E.vertexNormals.push(b);
  45943. if (v && (_ = O[s = M[o++]],
  45944. I.color.setHex(_),
  45945. E.color.setHex(_)),
  45946. y)
  45947. for (i = 0; i < 4; i++)
  45948. _ = O[s = M[o++]],
  45949. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  45950. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  45951. N.faces.push(I),
  45952. N.faces.push(E)
  45953. } else {
  45954. if ((C = new Ci.Face3).a = M[o++],
  45955. C.b = M[o++],
  45956. C.c = M[o++],
  45957. p && (h = M[o++],
  45958. C.materialIndex = h),
  45959. r = N.faces.length,
  45960. f)
  45961. for (i = 0; i < L; i++)
  45962. for (w = D.uvs[i],
  45963. N.faceVertexUvs[i][r] = [],
  45964. n = 0; n < 3; n++)
  45965. x = w[2 * (c = M[o++])],
  45966. S = w[2 * c + 1],
  45967. T = new Ci.Vector2(x,S),
  45968. N.faceVertexUvs[i][r].push(T);
  45969. if (g && (l = 3 * M[o++],
  45970. C.normal.set(P[l++], P[l++], P[l])),
  45971. m)
  45972. for (i = 0; i < 3; i++)
  45973. l = 3 * M[o++],
  45974. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45975. C.vertexNormals.push(b);
  45976. if (v && (s = M[o++],
  45977. C.color.setHex(O[s])),
  45978. y)
  45979. for (i = 0; i < 3; i++)
  45980. s = M[o++],
  45981. C.vertexColors.push(new Ci.Color(O[s]));
  45982. N.faces.push(C)
  45983. }
  45984. }(t),
  45985. function() {
  45986. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  45987. if (D.skinWeights)
  45988. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  45989. var n = D.skinWeights[t]
  45990. , r = 1 < e ? D.skinWeights[t + 1] : 0
  45991. , o = 2 < e ? D.skinWeights[t + 2] : 0
  45992. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  45993. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  45994. }
  45995. if (D.skinIndices)
  45996. for (t = 0,
  45997. i = D.skinIndices.length; t < i; t += e) {
  45998. var s = D.skinIndices[t]
  45999. , l = 1 < e ? D.skinIndices[t + 1] : 0
  46000. , c = 2 < e ? D.skinIndices[t + 2] : 0
  46001. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  46002. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  46003. }
  46004. N.bones = D.bones,
  46005. N.bones && 0 < N.bones.length && (N.skinWeights.length !== N.skinIndices.length || N.skinIndices.length !== N.vertices.length) && console.warn("When skinning, number of vertices (" + N.vertices.length + "), skinIndices (" + N.skinIndices.length + "), and skinWeights (" + N.skinWeights.length + ") should match.")
  46006. }(),
  46007. function(e) {
  46008. if (void 0 !== D.morphTargets)
  46009. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  46010. N.morphTargets[t] = {},
  46011. N.morphTargets[t].name = D.morphTargets[t].name,
  46012. N.morphTargets[t].vertices = [];
  46013. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  46014. var s = new Ci.Vector3;
  46015. s.x = r[o] * e,
  46016. s.y = r[o + 1] * e,
  46017. s.z = r[o + 2] * e,
  46018. n.push(s)
  46019. }
  46020. }
  46021. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  46022. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  46023. var l = N.faces
  46024. , c = D.morphColors[0].colors;
  46025. for (t = 0,
  46026. i = l.length; t < i; t++)
  46027. l[t].color.fromArray(c, 3 * t)
  46028. }
  46029. }(t),
  46030. function() {
  46031. var e = []
  46032. , t = [];
  46033. void 0 !== D.animation && t.push(D.animation),
  46034. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  46035. for (var i = 0; i < t.length; i++) {
  46036. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  46037. n && e.push(n)
  46038. }
  46039. if (N.morphTargets) {
  46040. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  46041. e = e.concat(r)
  46042. }
  46043. 0 < e.length && (N.animations = e)
  46044. }(),
  46045. N.computeFaceNormals(),
  46046. N.computeBoundingSphere(),
  46047. void 0 === D.materials || 0 === D.materials.length)
  46048. return {
  46049. geometry: N
  46050. };
  46051. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  46052. return {
  46053. geometry: N,
  46054. materials: i
  46055. }
  46056. }
  46057. },
  46058. Ci.LoadingManager = function(e, t, i) {
  46059. var n = this
  46060. , r = !1
  46061. , o = 0
  46062. , a = 0;
  46063. this.onStart = void 0,
  46064. this.onLoad = e,
  46065. this.onProgress = t,
  46066. this.onError = i,
  46067. this.itemStart = function(e) {
  46068. a++,
  46069. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  46070. r = !0
  46071. }
  46072. ,
  46073. this.itemEnd = function(e) {
  46074. o++,
  46075. void 0 !== n.onProgress && n.onProgress(e, o, a),
  46076. o === a && (r = !1,
  46077. void 0 !== n.onLoad && n.onLoad())
  46078. }
  46079. ,
  46080. this.itemError = function(e) {
  46081. void 0 !== n.onError && n.onError(e)
  46082. }
  46083. }
  46084. ,
  46085. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  46086. Ci.BufferGeometryLoader = function(e) {
  46087. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46088. }
  46089. ,
  46090. Ci.BufferGeometryLoader.prototype = {
  46091. constructor: Ci.BufferGeometryLoader,
  46092. load: function(e, t, i, n) {
  46093. var r = this;
  46094. new Ci.XHRLoader(r.manager).load(e, function(e) {
  46095. t(r.parse(JSON.parse(e)))
  46096. }, i, n)
  46097. },
  46098. parse: function(e) {
  46099. var t = new Ci.BufferGeometry
  46100. , i = e.data.index
  46101. , n = {
  46102. Int8Array: Int8Array,
  46103. Uint8Array: Uint8Array,
  46104. Uint8ClampedArray: Uint8ClampedArray,
  46105. Int16Array: Int16Array,
  46106. Uint16Array: Uint16Array,
  46107. Int32Array: Int32Array,
  46108. Uint32Array: Uint32Array,
  46109. Float32Array: Float32Array,
  46110. Float64Array: Float64Array
  46111. };
  46112. if (void 0 !== i) {
  46113. var r = new n[i.type](i.array);
  46114. t.setIndex(new Ci.BufferAttribute(r,1))
  46115. }
  46116. var o = e.data.attributes;
  46117. for (var a in o) {
  46118. var s = o[a];
  46119. r = new n[s.type](s.array);
  46120. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  46121. }
  46122. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  46123. if (void 0 !== l)
  46124. for (var c = 0, h = l.length; c !== h; ++c) {
  46125. var u = l[c];
  46126. t.addGroup(u.start, u.count, u.materialIndex)
  46127. }
  46128. var d = e.data.boundingSphere;
  46129. if (void 0 !== d) {
  46130. var p = new Ci.Vector3;
  46131. void 0 !== d.center && p.fromArray(d.center),
  46132. t.boundingSphere = new Ci.Sphere(p,d.radius)
  46133. }
  46134. return t
  46135. }
  46136. },
  46137. Ci.MaterialLoader = function(e) {
  46138. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46139. this.textures = {}
  46140. }
  46141. ,
  46142. Ci.MaterialLoader.prototype = {
  46143. constructor: Ci.MaterialLoader,
  46144. load: function(e, t, i, n) {
  46145. var r = this;
  46146. new Ci.XHRLoader(r.manager).load(e, function(e) {
  46147. t(r.parse(JSON.parse(e)))
  46148. }, i, n)
  46149. },
  46150. setTextures: function(e) {
  46151. this.textures = e
  46152. },
  46153. getTexture: function(e) {
  46154. var t = this.textures;
  46155. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  46156. t[e]
  46157. },
  46158. parse: function(e) {
  46159. var t = new Ci[e.type];
  46160. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  46161. void 0 !== e.name && (t.name = e.name),
  46162. void 0 !== e.color && t.color.setHex(e.color),
  46163. void 0 !== e.roughness && (t.roughness = e.roughness),
  46164. void 0 !== e.metalness && (t.metalness = e.metalness),
  46165. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  46166. void 0 !== e.specular && t.specular.setHex(e.specular),
  46167. void 0 !== e.shininess && (t.shininess = e.shininess),
  46168. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  46169. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  46170. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  46171. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  46172. void 0 !== e.shading && (t.shading = e.shading),
  46173. void 0 !== e.blending && (t.blending = e.blending),
  46174. void 0 !== e.side && (t.side = e.side),
  46175. void 0 !== e.opacity && (t.opacity = e.opacity),
  46176. void 0 !== e.transparent && (t.transparent = e.transparent),
  46177. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  46178. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  46179. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  46180. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  46181. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  46182. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  46183. void 0 !== e.size && (t.size = e.size),
  46184. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  46185. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  46186. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  46187. t.transparent = !0),
  46188. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  46189. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  46190. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  46191. void 0 !== e.normalScale) {
  46192. var i = e.normalScale;
  46193. !1 === Array.isArray(i) && (i = [i, i]),
  46194. t.normalScale = (new Ci.Vector2).fromArray(i)
  46195. }
  46196. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  46197. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  46198. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  46199. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  46200. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  46201. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  46202. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  46203. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  46204. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  46205. t.combine = Ci.MultiplyOperation),
  46206. e.reflectivity && (t.reflectivity = e.reflectivity),
  46207. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  46208. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  46209. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  46210. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  46211. void 0 !== e.materials)
  46212. for (var n = 0, r = e.materials.length; n < r; n++)
  46213. t.materials.push(this.parse(e.materials[n]));
  46214. return t
  46215. }
  46216. },
  46217. Ci.ObjectLoader = function(e) {
  46218. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46219. this.texturePath = ""
  46220. }
  46221. ,
  46222. Ci.ObjectLoader.prototype = {
  46223. constructor: Ci.ObjectLoader,
  46224. load: function(e, t, i, n) {
  46225. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  46226. var r = this;
  46227. new Ci.XHRLoader(r.manager).load(e, function(e) {
  46228. r.parse(JSON.parse(e), t)
  46229. }, i, n)
  46230. },
  46231. setTexturePath: function(e) {
  46232. this.texturePath = e
  46233. },
  46234. setCrossOrigin: function(e) {
  46235. this.crossOrigin = e
  46236. },
  46237. parse: function(e, t) {
  46238. var i = this.parseGeometries(e.geometries)
  46239. , n = this.parseImages(e.images, function() {
  46240. void 0 !== t && t(a)
  46241. })
  46242. , r = this.parseTextures(e.textures, n)
  46243. , o = this.parseMaterials(e.materials, r)
  46244. , a = this.parseObject(e.object, i, o);
  46245. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  46246. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  46247. a
  46248. },
  46249. parseGeometries: function(e) {
  46250. var t = {};
  46251. if (void 0 !== e)
  46252. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  46253. var a, s = e[r];
  46254. switch (s.type) {
  46255. case "PlaneGeometry":
  46256. case "PlaneBufferGeometry":
  46257. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  46258. break;
  46259. case "BoxGeometry":
  46260. case "BoxBufferGeometry":
  46261. case "CubeGeometry":
  46262. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  46263. break;
  46264. case "CircleGeometry":
  46265. case "CircleBufferGeometry":
  46266. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  46267. break;
  46268. case "CylinderGeometry":
  46269. case "CylinderBufferGeometry":
  46270. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  46271. break;
  46272. case "SphereGeometry":
  46273. case "SphereBufferGeometry":
  46274. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  46275. break;
  46276. case "DodecahedronGeometry":
  46277. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  46278. break;
  46279. case "IcosahedronGeometry":
  46280. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  46281. break;
  46282. case "OctahedronGeometry":
  46283. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  46284. break;
  46285. case "TetrahedronGeometry":
  46286. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  46287. break;
  46288. case "RingGeometry":
  46289. case "RingBufferGeometry":
  46290. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  46291. break;
  46292. case "TorusGeometry":
  46293. case "TorusBufferGeometry":
  46294. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  46295. break;
  46296. case "TorusKnotGeometry":
  46297. case "TorusKnotBufferGeometry":
  46298. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  46299. break;
  46300. case "LatheGeometry":
  46301. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  46302. break;
  46303. case "BufferGeometry":
  46304. a = n.parse(s);
  46305. break;
  46306. case "Geometry":
  46307. a = i.parse(s.data, this.texturePath).geometry;
  46308. break;
  46309. default:
  46310. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  46311. continue
  46312. }
  46313. a.uuid = s.uuid,
  46314. void 0 !== s.name && (a.name = s.name),
  46315. t[s.uuid] = a
  46316. }
  46317. return t
  46318. },
  46319. parseMaterials: function(e, t) {
  46320. var i = {};
  46321. if (void 0 !== e) {
  46322. var n = new Ci.MaterialLoader;
  46323. n.setTextures(t);
  46324. for (var r = 0, o = e.length; r < o; r++) {
  46325. var a = n.parse(e[r]);
  46326. i[a.uuid] = a
  46327. }
  46328. }
  46329. return i
  46330. },
  46331. parseAnimations: function(e) {
  46332. for (var t = [], i = 0; i < e.length; i++) {
  46333. var n = Ci.AnimationClip.parse(e[i]);
  46334. t.push(n)
  46335. }
  46336. return t
  46337. },
  46338. parseImages: function(e, t) {
  46339. function i(e) {
  46340. return n.manager.itemStart(e),
  46341. a.load(e, function() {
  46342. n.manager.itemEnd(e)
  46343. })
  46344. }
  46345. var n = this
  46346. , r = {};
  46347. if (void 0 !== e && 0 < e.length) {
  46348. var o = new Ci.LoadingManager(t)
  46349. , a = new Ci.ImageLoader(o);
  46350. a.setCrossOrigin(this.crossOrigin);
  46351. for (var s = 0, l = e.length; s < l; s++) {
  46352. var c = e[s]
  46353. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  46354. r[c.uuid] = i(h)
  46355. }
  46356. }
  46357. return r
  46358. },
  46359. parseTextures: function(e, t) {
  46360. function i(e) {
  46361. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  46362. Ci[e])
  46363. }
  46364. var n = {};
  46365. if (void 0 !== e)
  46366. for (var r = 0, o = e.length; r < o; r++) {
  46367. var a = e[r];
  46368. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  46369. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  46370. var s = new Ci.Texture(t[a.image]);
  46371. s.needsUpdate = !0,
  46372. s.uuid = a.uuid,
  46373. void 0 !== a.name && (s.name = a.name),
  46374. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  46375. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  46376. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  46377. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  46378. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  46379. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  46380. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  46381. s.wrapT = i(a.wrap[1])),
  46382. n[a.uuid] = s
  46383. }
  46384. return n
  46385. },
  46386. parseObject: (ke = new Ci.Matrix4,
  46387. function(e, t, i) {
  46388. function n(e) {
  46389. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  46390. t[e]
  46391. }
  46392. function r(e) {
  46393. if (void 0 !== e)
  46394. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  46395. i[e]
  46396. }
  46397. var o;
  46398. switch (e.type) {
  46399. case "Scene":
  46400. o = new Ci.Scene;
  46401. break;
  46402. case "PerspectiveCamera":
  46403. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  46404. break;
  46405. case "OrthographicCamera":
  46406. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  46407. break;
  46408. case "AmbientLight":
  46409. o = new Ci.AmbientLight(e.color,e.intensity);
  46410. break;
  46411. case "DirectionalLight":
  46412. o = new Ci.DirectionalLight(e.color,e.intensity);
  46413. break;
  46414. case "PointLight":
  46415. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  46416. break;
  46417. case "SpotLight":
  46418. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  46419. break;
  46420. case "HemisphereLight":
  46421. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  46422. break;
  46423. case "Mesh":
  46424. var a = n(e.geometry)
  46425. , s = r(e.material);
  46426. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  46427. break;
  46428. case "LOD":
  46429. o = new Ci.LOD;
  46430. break;
  46431. case "Line":
  46432. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  46433. break;
  46434. case "PointCloud":
  46435. case "Points":
  46436. o = new Ci.Points(n(e.geometry),r(e.material));
  46437. break;
  46438. case "Sprite":
  46439. o = new Ci.Sprite(r(e.material));
  46440. break;
  46441. case "Group":
  46442. o = new Ci.Group;
  46443. break;
  46444. default:
  46445. o = new Ci.Object3D
  46446. }
  46447. if (o.uuid = e.uuid,
  46448. void 0 !== e.name && (o.name = e.name),
  46449. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  46450. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  46451. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  46452. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  46453. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  46454. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  46455. void 0 !== e.visible && (o.visible = e.visible),
  46456. void 0 !== e.userData && (o.userData = e.userData),
  46457. void 0 !== e.children)
  46458. for (var l in e.children)
  46459. o.add(this.parseObject(e.children[l], t, i));
  46460. if ("LOD" === e.type)
  46461. for (var c = e.levels, h = 0; h < c.length; h++) {
  46462. var u = c[h];
  46463. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  46464. }
  46465. return o
  46466. }
  46467. )
  46468. },
  46469. Ci.TextureLoader = function(e) {
  46470. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46471. }
  46472. ,
  46473. Ci.TextureLoader.prototype = {
  46474. constructor: Ci.TextureLoader,
  46475. load: function(e, t, i, n) {
  46476. var r = new Ci.Texture
  46477. , o = new Ci.ImageLoader(this.manager);
  46478. return o.setCrossOrigin(this.crossOrigin),
  46479. o.setPath(this.path),
  46480. o.load(e, function(e) {
  46481. r.image = e,
  46482. r.needsUpdate = !0,
  46483. void 0 !== t && t(r)
  46484. }, i, n),
  46485. r
  46486. },
  46487. setCrossOrigin: function(e) {
  46488. this.crossOrigin = e
  46489. },
  46490. setPath: function(e) {
  46491. this.path = e
  46492. }
  46493. },
  46494. Ci.CubeTextureLoader = function(e) {
  46495. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46496. }
  46497. ,
  46498. Ci.CubeTextureLoader.prototype = {
  46499. constructor: Ci.CubeTextureLoader,
  46500. load: function(e, i, t, n) {
  46501. function r(t) {
  46502. a.load(e[t], function(e) {
  46503. o.images[t] = e,
  46504. 6 === ++s && (o.needsUpdate = !0,
  46505. i && i(o))
  46506. }, void 0, n)
  46507. }
  46508. var o = new Ci.CubeTexture
  46509. , a = new Ci.ImageLoader(this.manager);
  46510. a.setCrossOrigin(this.crossOrigin),
  46511. a.setPath(this.path);
  46512. for (var s = 0, l = 0; l < e.length; ++l)
  46513. r(l);
  46514. return o
  46515. },
  46516. setCrossOrigin: function(e) {
  46517. this.crossOrigin = e
  46518. },
  46519. setPath: function(e) {
  46520. this.path = e
  46521. }
  46522. },
  46523. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  46524. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46525. this._parser = null
  46526. }
  46527. ,
  46528. Ci.BinaryTextureLoader.prototype = {
  46529. constructor: Ci.BinaryTextureLoader,
  46530. load: function(e, i, t, n) {
  46531. var r = this
  46532. , o = new Ci.DataTexture
  46533. , a = new Ci.XHRLoader(this.manager);
  46534. return a.setResponseType("arraybuffer"),
  46535. a.load(e, function(e) {
  46536. var t = r._parser(e);
  46537. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  46538. o.image.height = t.height,
  46539. o.image.data = t.data),
  46540. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  46541. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  46542. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  46543. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  46544. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  46545. void 0 !== t.format && (o.format = t.format),
  46546. void 0 !== t.type && (o.type = t.type),
  46547. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  46548. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  46549. o.needsUpdate = !0,
  46550. i && i(o, t))
  46551. }, t, n),
  46552. o
  46553. }
  46554. },
  46555. Ci.CompressedTextureLoader = function(e) {
  46556. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46557. this._parser = null
  46558. }
  46559. ,
  46560. Ci.CompressedTextureLoader.prototype = {
  46561. constructor: Ci.CompressedTextureLoader,
  46562. load: function(e, o, t, n) {
  46563. function i(i) {
  46564. r.load(e[i], function(e) {
  46565. var t = a._parser(e, !0);
  46566. s[i] = {
  46567. width: t.width,
  46568. height: t.height,
  46569. format: t.format,
  46570. mipmaps: t.mipmaps
  46571. },
  46572. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46573. l.format = t.format,
  46574. l.needsUpdate = !0,
  46575. o && o(l))
  46576. }, t, n)
  46577. }
  46578. var a = this
  46579. , s = []
  46580. , l = new Ci.CompressedTexture;
  46581. l.image = s;
  46582. var r = new Ci.XHRLoader(this.manager);
  46583. if (r.setPath(this.path),
  46584. r.setResponseType("arraybuffer"),
  46585. Array.isArray(e))
  46586. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  46587. i(h);
  46588. else
  46589. r.load(e, function(e) {
  46590. var t = a._parser(e, !0);
  46591. if (t.isCubemap)
  46592. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  46593. s[n] = {
  46594. mipmaps: []
  46595. };
  46596. for (var r = 0; r < t.mipmapCount; r++)
  46597. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  46598. s[n].format = t.format,
  46599. s[n].width = t.width,
  46600. s[n].height = t.height
  46601. }
  46602. else
  46603. l.image.width = t.width,
  46604. l.image.height = t.height,
  46605. l.mipmaps = t.mipmaps;
  46606. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46607. l.format = t.format,
  46608. l.needsUpdate = !0,
  46609. o && o(l)
  46610. }, t, n);
  46611. return l
  46612. },
  46613. setPath: function(e) {
  46614. this.path = e
  46615. }
  46616. },
  46617. Ci.Material = function() {
  46618. Object.defineProperty(this, "id", {
  46619. value: Ci.MaterialIdCount++
  46620. }),
  46621. this.uuid = Ci.Math.generateUUID(),
  46622. this.name = "",
  46623. this.type = "Material",
  46624. this.side = Ci.FrontSide,
  46625. this.opacity = 1,
  46626. this.transparent = !1,
  46627. this.blending = Ci.NormalBlending,
  46628. this.blendSrc = Ci.SrcAlphaFactor,
  46629. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  46630. this.blendEquation = Ci.AddEquation,
  46631. this.blendSrcAlpha = null,
  46632. this.blendDstAlpha = null,
  46633. this.blendEquationAlpha = null,
  46634. this.depthFunc = Ci.LessEqualDepth,
  46635. this.depthTest = !0,
  46636. this.depthWrite = !0,
  46637. this.colorWrite = !0,
  46638. this.precision = null,
  46639. this.polygonOffset = !1,
  46640. this.polygonOffsetFactor = 0,
  46641. this.polygonOffsetUnits = 0,
  46642. this.alphaTest = 0,
  46643. this.premultipliedAlpha = !1,
  46644. this.overdraw = 0,
  46645. this.visible = !0,
  46646. this._needsUpdate = !0
  46647. }
  46648. ,
  46649. Ci.Material.prototype = {
  46650. constructor: Ci.Material,
  46651. get needsUpdate() {
  46652. return this._needsUpdate
  46653. },
  46654. set needsUpdate(e) {
  46655. !0 === e && this.update(),
  46656. this._needsUpdate = e
  46657. },
  46658. setValues: function(e) {
  46659. if (void 0 !== e)
  46660. for (var t in e) {
  46661. var i = e[t];
  46662. if (void 0 !== i) {
  46663. var n = this[t];
  46664. void 0 !== n ? n instanceof Ci.Color ? n.set(i) : n instanceof Ci.Vector3 && i instanceof Ci.Vector3 ? n.copy(i) : this[t] = "overdraw" === t ? Number(i) : i : console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.")
  46665. } else
  46666. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46667. }
  46668. },
  46669. toJSON: function(e) {
  46670. function t(e) {
  46671. var t = [];
  46672. for (var i in e) {
  46673. var n = e[i];
  46674. delete n.metadata,
  46675. t.push(n)
  46676. }
  46677. return t
  46678. }
  46679. var i = void 0 === e;
  46680. i && (e = {
  46681. textures: {},
  46682. images: {}
  46683. });
  46684. var n = {
  46685. metadata: {
  46686. version: 4.4,
  46687. type: "Material",
  46688. generator: "Material.toJSON"
  46689. }
  46690. };
  46691. if (n.uuid = this.uuid,
  46692. n.type = this.type,
  46693. "" !== this.name && (n.name = this.name),
  46694. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  46695. .5 !== this.roughness && (n.roughness = this.roughness),
  46696. .5 !== this.metalness && (n.metalness = this.metalness),
  46697. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  46698. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  46699. void 0 !== this.shininess && (n.shininess = this.shininess),
  46700. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  46701. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  46702. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  46703. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  46704. n.bumpScale = this.bumpScale),
  46705. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  46706. n.normalScale = this.normalScale.toArray()),
  46707. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  46708. n.displacementScale = this.displacementScale,
  46709. n.displacementBias = this.displacementBias),
  46710. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46711. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46712. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46713. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  46714. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  46715. n.reflectivity = this.reflectivity),
  46716. void 0 !== this.size && (n.size = this.size),
  46717. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  46718. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  46719. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  46720. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  46721. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  46722. this.opacity < 1 && (n.opacity = this.opacity),
  46723. !0 === this.transparent && (n.transparent = this.transparent),
  46724. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  46725. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  46726. !0 === this.wireframe && (n.wireframe = this.wireframe),
  46727. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  46728. i) {
  46729. var r = t(e.textures)
  46730. , o = t(e.images);
  46731. 0 < r.length && (n.textures = r),
  46732. 0 < o.length && (n.images = o)
  46733. }
  46734. return n
  46735. },
  46736. clone: function() {
  46737. return (new this.constructor).copy(this)
  46738. },
  46739. copy: function(e) {
  46740. return this.name = e.name,
  46741. this.side = e.side,
  46742. this.opacity = e.opacity,
  46743. this.transparent = e.transparent,
  46744. this.blending = e.blending,
  46745. this.blendSrc = e.blendSrc,
  46746. this.blendDst = e.blendDst,
  46747. this.blendEquation = e.blendEquation,
  46748. this.blendSrcAlpha = e.blendSrcAlpha,
  46749. this.blendDstAlpha = e.blendDstAlpha,
  46750. this.blendEquationAlpha = e.blendEquationAlpha,
  46751. this.depthFunc = e.depthFunc,
  46752. this.depthTest = e.depthTest,
  46753. this.depthWrite = e.depthWrite,
  46754. this.colorWrite = e.colorWrite,
  46755. this.precision = e.precision,
  46756. this.polygonOffset = e.polygonOffset,
  46757. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46758. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46759. this.alphaTest = e.alphaTest,
  46760. this.premultipliedAlpha = e.premultipliedAlpha,
  46761. this.overdraw = e.overdraw,
  46762. this.visible = e.visible,
  46763. this
  46764. },
  46765. update: function() {
  46766. this.dispatchEvent({
  46767. type: "update"
  46768. })
  46769. },
  46770. dispose: function() {
  46771. this.dispatchEvent({
  46772. type: "dispose"
  46773. })
  46774. }
  46775. },
  46776. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  46777. Ci.MaterialIdCount = 0,
  46778. Ci.LineBasicMaterial = function(e) {
  46779. Ci.Material.call(this),
  46780. this.type = "LineBasicMaterial",
  46781. this.color = new Ci.Color(16777215),
  46782. this.linewidth = 1,
  46783. this.linecap = "round",
  46784. this.linejoin = "round",
  46785. this.blending = Ci.NormalBlending,
  46786. this.vertexColors = Ci.NoColors,
  46787. this.fog = !0,
  46788. this.setValues(e)
  46789. }
  46790. ,
  46791. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46792. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46793. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46794. return Ci.Material.prototype.copy.call(this, e),
  46795. this.color.copy(e.color),
  46796. this.linewidth = e.linewidth,
  46797. this.linecap = e.linecap,
  46798. this.linejoin = e.linejoin,
  46799. this.vertexColors = e.vertexColors,
  46800. this.fog = e.fog,
  46801. this
  46802. }
  46803. ,
  46804. Ci.LineDashedMaterial = function(e) {
  46805. Ci.Material.call(this),
  46806. this.type = "LineDashedMaterial",
  46807. this.color = new Ci.Color(16777215),
  46808. this.linewidth = 1,
  46809. this.scale = 1,
  46810. this.dashSize = 3,
  46811. this.gapSize = 1,
  46812. this.blending = Ci.NormalBlending,
  46813. this.vertexColors = Ci.NoColors,
  46814. this.fog = !0,
  46815. this.setValues(e)
  46816. }
  46817. ,
  46818. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46819. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46820. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46821. return Ci.Material.prototype.copy.call(this, e),
  46822. this.color.copy(e.color),
  46823. this.linewidth = e.linewidth,
  46824. this.scale = e.scale,
  46825. this.dashSize = e.dashSize,
  46826. this.gapSize = e.gapSize,
  46827. this.vertexColors = e.vertexColors,
  46828. this.fog = e.fog,
  46829. this
  46830. }
  46831. ,
  46832. Ci.MeshBasicMaterial = function(e) {
  46833. Ci.Material.call(this),
  46834. this.type = "MeshBasicMaterial",
  46835. this.color = new Ci.Color(16777215),
  46836. this.map = null,
  46837. this.aoMap = null,
  46838. this.aoMapIntensity = 1,
  46839. this.specularMap = null,
  46840. this.alphaMap = null,
  46841. this.envMap = null,
  46842. this.combine = Ci.MultiplyOperation,
  46843. this.reflectivity = 1,
  46844. this.refractionRatio = .98,
  46845. this.fog = !0,
  46846. this.shading = Ci.SmoothShading,
  46847. this.blending = Ci.NormalBlending,
  46848. this.wireframe = !1,
  46849. this.wireframeLinewidth = 1,
  46850. this.wireframeLinecap = "round",
  46851. this.wireframeLinejoin = "round",
  46852. this.vertexColors = Ci.NoColors,
  46853. this.skinning = !1,
  46854. this.morphTargets = !1,
  46855. this.setValues(e)
  46856. }
  46857. ,
  46858. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46859. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46860. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46861. return Ci.Material.prototype.copy.call(this, e),
  46862. this.color.copy(e.color),
  46863. this.map = e.map,
  46864. this.aoMap = e.aoMap,
  46865. this.aoMapIntensity = e.aoMapIntensity,
  46866. this.specularMap = e.specularMap,
  46867. this.alphaMap = e.alphaMap,
  46868. this.envMap = e.envMap,
  46869. this.combine = e.combine,
  46870. this.reflectivity = e.reflectivity,
  46871. this.refractionRatio = e.refractionRatio,
  46872. this.fog = e.fog,
  46873. this.shading = e.shading,
  46874. this.wireframe = e.wireframe,
  46875. this.wireframeLinewidth = e.wireframeLinewidth,
  46876. this.wireframeLinecap = e.wireframeLinecap,
  46877. this.wireframeLinejoin = e.wireframeLinejoin,
  46878. this.vertexColors = e.vertexColors,
  46879. this.skinning = e.skinning,
  46880. this.morphTargets = e.morphTargets,
  46881. this
  46882. }
  46883. ,
  46884. Ci.MeshLambertMaterial = function(e) {
  46885. Ci.Material.call(this),
  46886. this.type = "MeshLambertMaterial",
  46887. this.color = new Ci.Color(16777215),
  46888. this.map = null,
  46889. this.lightMap = null,
  46890. this.lightMapIntensity = 1,
  46891. this.aoMap = null,
  46892. this.aoMapIntensity = 1,
  46893. this.emissive = new Ci.Color(0),
  46894. this.emissiveIntensity = 1,
  46895. this.emissiveMap = null,
  46896. this.specularMap = null,
  46897. this.alphaMap = null,
  46898. this.envMap = null,
  46899. this.combine = Ci.MultiplyOperation,
  46900. this.reflectivity = 1,
  46901. this.refractionRatio = .98,
  46902. this.fog = !0,
  46903. this.blending = Ci.NormalBlending,
  46904. this.wireframe = !1,
  46905. this.wireframeLinewidth = 1,
  46906. this.wireframeLinecap = "round",
  46907. this.wireframeLinejoin = "round",
  46908. this.vertexColors = Ci.NoColors,
  46909. this.skinning = !1,
  46910. this.morphTargets = !1,
  46911. this.morphNormals = !1,
  46912. this.setValues(e)
  46913. }
  46914. ,
  46915. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46916. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46917. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46918. return Ci.Material.prototype.copy.call(this, e),
  46919. this.color.copy(e.color),
  46920. this.map = e.map,
  46921. this.lightMap = e.lightMap,
  46922. this.lightMapIntensity = e.lightMapIntensity,
  46923. this.aoMap = e.aoMap,
  46924. this.aoMapIntensity = e.aoMapIntensity,
  46925. this.emissive.copy(e.emissive),
  46926. this.emissiveMap = e.emissiveMap,
  46927. this.emissiveIntensity = e.emissiveIntensity,
  46928. this.specularMap = e.specularMap,
  46929. this.alphaMap = e.alphaMap,
  46930. this.envMap = e.envMap,
  46931. this.combine = e.combine,
  46932. this.reflectivity = e.reflectivity,
  46933. this.refractionRatio = e.refractionRatio,
  46934. this.fog = e.fog,
  46935. this.wireframe = e.wireframe,
  46936. this.wireframeLinewidth = e.wireframeLinewidth,
  46937. this.wireframeLinecap = e.wireframeLinecap,
  46938. this.wireframeLinejoin = e.wireframeLinejoin,
  46939. this.vertexColors = e.vertexColors,
  46940. this.skinning = e.skinning,
  46941. this.morphTargets = e.morphTargets,
  46942. this.morphNormals = e.morphNormals,
  46943. this
  46944. }
  46945. ,
  46946. Ci.MeshPhongMaterial = function(e) {
  46947. Ci.Material.call(this),
  46948. this.type = "MeshPhongMaterial",
  46949. this.color = new Ci.Color(16777215),
  46950. this.specular = new Ci.Color(1118481),
  46951. this.shininess = 30,
  46952. this.map = null,
  46953. this.lightMap = null,
  46954. this.lightMapIntensity = 1,
  46955. this.aoMap = null,
  46956. this.aoMapIntensity = 1,
  46957. this.emissive = new Ci.Color(0),
  46958. this.emissiveIntensity = 1,
  46959. this.emissiveMap = null,
  46960. this.bumpMap = null,
  46961. this.bumpScale = 1,
  46962. this.normalMap = null,
  46963. this.normalScale = new Ci.Vector2(1,1),
  46964. this.displacementMap = null,
  46965. this.displacementScale = 1,
  46966. this.displacementBias = 0,
  46967. this.specularMap = null,
  46968. this.alphaMap = null,
  46969. this.envMap = null,
  46970. this.combine = Ci.MultiplyOperation,
  46971. this.reflectivity = 1,
  46972. this.refractionRatio = .98,
  46973. this.fog = !0,
  46974. this.shading = Ci.SmoothShading,
  46975. this.blending = Ci.NormalBlending,
  46976. this.wireframe = !1,
  46977. this.wireframeLinewidth = 1,
  46978. this.wireframeLinecap = "round",
  46979. this.wireframeLinejoin = "round",
  46980. this.vertexColors = Ci.NoColors,
  46981. this.skinning = !1,
  46982. this.morphTargets = !1,
  46983. this.morphNormals = !1,
  46984. this.setValues(e)
  46985. }
  46986. ,
  46987. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  46988. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  46989. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  46990. return Ci.Material.prototype.copy.call(this, e),
  46991. this.color.copy(e.color),
  46992. this.specular.copy(e.specular),
  46993. this.shininess = e.shininess,
  46994. this.map = e.map,
  46995. this.lightMap = e.lightMap,
  46996. this.lightMapIntensity = e.lightMapIntensity,
  46997. this.aoMap = e.aoMap,
  46998. this.aoMapIntensity = e.aoMapIntensity,
  46999. this.emissive.copy(e.emissive),
  47000. this.emissiveMap = e.emissiveMap,
  47001. this.emissiveIntensity = e.emissiveIntensity,
  47002. this.bumpMap = e.bumpMap,
  47003. this.bumpScale = e.bumpScale,
  47004. this.normalMap = e.normalMap,
  47005. this.normalScale.copy(e.normalScale),
  47006. this.displacementMap = e.displacementMap,
  47007. this.displacementScale = e.displacementScale,
  47008. this.displacementBias = e.displacementBias,
  47009. this.specularMap = e.specularMap,
  47010. this.alphaMap = e.alphaMap,
  47011. this.envMap = e.envMap,
  47012. this.combine = e.combine,
  47013. this.reflectivity = e.reflectivity,
  47014. this.refractionRatio = e.refractionRatio,
  47015. this.fog = e.fog,
  47016. this.shading = e.shading,
  47017. this.wireframe = e.wireframe,
  47018. this.wireframeLinewidth = e.wireframeLinewidth,
  47019. this.wireframeLinecap = e.wireframeLinecap,
  47020. this.wireframeLinejoin = e.wireframeLinejoin,
  47021. this.vertexColors = e.vertexColors,
  47022. this.skinning = e.skinning,
  47023. this.morphTargets = e.morphTargets,
  47024. this.morphNormals = e.morphNormals,
  47025. this
  47026. }
  47027. ,
  47028. Ci.MeshStandardMaterial = function(e) {
  47029. Ci.Material.call(this),
  47030. this.type = "MeshStandardMaterial",
  47031. this.color = new Ci.Color(16777215),
  47032. this.roughness = .5,
  47033. this.metalness = .5,
  47034. this.map = null,
  47035. this.lightMap = null,
  47036. this.lightMapIntensity = 1,
  47037. this.aoMap = null,
  47038. this.aoMapIntensity = 1,
  47039. this.emissive = new Ci.Color(0),
  47040. this.emissiveIntensity = 1,
  47041. this.emissiveMap = null,
  47042. this.bumpMap = null,
  47043. this.bumpScale = 1,
  47044. this.normalMap = null,
  47045. this.normalScale = new Ci.Vector2(1,1),
  47046. this.displacementMap = null,
  47047. this.displacementScale = 1,
  47048. this.displacementBias = 0,
  47049. this.roughnessMap = null,
  47050. this.metalnessMap = null,
  47051. this.alphaMap = null,
  47052. this.envMap = null,
  47053. this.envMapIntensity = 1,
  47054. this.refractionRatio = .98,
  47055. this.fog = !0,
  47056. this.shading = Ci.SmoothShading,
  47057. this.blending = Ci.NormalBlending,
  47058. this.wireframe = !1,
  47059. this.wireframeLinewidth = 1,
  47060. this.wireframeLinecap = "round",
  47061. this.wireframeLinejoin = "round",
  47062. this.vertexColors = Ci.NoColors,
  47063. this.skinning = !1,
  47064. this.morphTargets = !1,
  47065. this.morphNormals = !1,
  47066. this.setValues(e)
  47067. }
  47068. ,
  47069. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  47070. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  47071. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  47072. return Ci.Material.prototype.copy.call(this, e),
  47073. this.color.copy(e.color),
  47074. this.roughness = e.roughness,
  47075. this.metalness = e.metalness,
  47076. this.map = e.map,
  47077. this.lightMap = e.lightMap,
  47078. this.lightMapIntensity = e.lightMapIntensity,
  47079. this.aoMap = e.aoMap,
  47080. this.aoMapIntensity = e.aoMapIntensity,
  47081. this.emissive.copy(e.emissive),
  47082. this.emissiveMap = e.emissiveMap,
  47083. this.emissiveIntensity = e.emissiveIntensity,
  47084. this.bumpMap = e.bumpMap,
  47085. this.bumpScale = e.bumpScale,
  47086. this.normalMap = e.normalMap,
  47087. this.normalScale.copy(e.normalScale),
  47088. this.displacementMap = e.displacementMap,
  47089. this.displacementScale = e.displacementScale,
  47090. this.displacementBias = e.displacementBias,
  47091. this.roughnessMap = e.roughnessMap,
  47092. this.metalnessMap = e.metalnessMap,
  47093. this.alphaMap = e.alphaMap,
  47094. this.envMap = e.envMap,
  47095. this.envMapIntensity = e.envMapIntensity,
  47096. this.refractionRatio = e.refractionRatio,
  47097. this.fog = e.fog,
  47098. this.shading = e.shading,
  47099. this.wireframe = e.wireframe,
  47100. this.wireframeLinewidth = e.wireframeLinewidth,
  47101. this.wireframeLinecap = e.wireframeLinecap,
  47102. this.wireframeLinejoin = e.wireframeLinejoin,
  47103. this.vertexColors = e.vertexColors,
  47104. this.skinning = e.skinning,
  47105. this.morphTargets = e.morphTargets,
  47106. this.morphNormals = e.morphNormals,
  47107. this
  47108. }
  47109. ,
  47110. Ci.MeshDepthMaterial = function(e) {
  47111. Ci.Material.call(this),
  47112. this.type = "MeshDepthMaterial",
  47113. this.morphTargets = !1,
  47114. this.wireframe = !1,
  47115. this.wireframeLinewidth = 1,
  47116. this.setValues(e)
  47117. }
  47118. ,
  47119. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  47120. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  47121. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  47122. return Ci.Material.prototype.copy.call(this, e),
  47123. this.wireframe = e.wireframe,
  47124. this.wireframeLinewidth = e.wireframeLinewidth,
  47125. this
  47126. }
  47127. ,
  47128. Ci.MeshNormalMaterial = function(e) {
  47129. Ci.Material.call(this, e),
  47130. this.type = "MeshNormalMaterial",
  47131. this.wireframe = !1,
  47132. this.wireframeLinewidth = 1,
  47133. this.morphTargets = !1,
  47134. this.setValues(e)
  47135. }
  47136. ,
  47137. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  47138. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  47139. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  47140. return Ci.Material.prototype.copy.call(this, e),
  47141. this.wireframe = e.wireframe,
  47142. this.wireframeLinewidth = e.wireframeLinewidth,
  47143. this
  47144. }
  47145. ,
  47146. Ci.MultiMaterial = function(e) {
  47147. this.uuid = Ci.Math.generateUUID(),
  47148. this.type = "MultiMaterial",
  47149. this.materials = e instanceof Array ? e : [],
  47150. this.visible = !0
  47151. }
  47152. ,
  47153. Ci.MultiMaterial.prototype = {
  47154. constructor: Ci.MultiMaterial,
  47155. toJSON: function(e) {
  47156. for (var t = {
  47157. metadata: {
  47158. version: 4.2,
  47159. type: "material",
  47160. generator: "MaterialExporter"
  47161. },
  47162. uuid: this.uuid,
  47163. type: this.type,
  47164. materials: []
  47165. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  47166. var o = i[n].toJSON(e);
  47167. delete o.metadata,
  47168. t.materials.push(o)
  47169. }
  47170. return t.visible = this.visible,
  47171. t
  47172. },
  47173. clone: function() {
  47174. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  47175. e.materials.push(this.materials[t].clone());
  47176. return e.visible = this.visible,
  47177. e
  47178. }
  47179. },
  47180. Ci.PointsMaterial = function(e) {
  47181. Ci.Material.call(this),
  47182. this.type = "PointsMaterial",
  47183. this.color = new Ci.Color(16777215),
  47184. this.map = null,
  47185. this.size = 1,
  47186. this.sizeAttenuation = !0,
  47187. this.blending = Ci.NormalBlending,
  47188. this.vertexColors = Ci.NoColors,
  47189. this.fog = !0,
  47190. this.setValues(e)
  47191. }
  47192. ,
  47193. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  47194. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  47195. Ci.PointsMaterial.prototype.copy = function(e) {
  47196. return Ci.Material.prototype.copy.call(this, e),
  47197. this.color.copy(e.color),
  47198. this.map = e.map,
  47199. this.size = e.size,
  47200. this.sizeAttenuation = e.sizeAttenuation,
  47201. this.vertexColors = e.vertexColors,
  47202. this.fog = e.fog,
  47203. this
  47204. }
  47205. ,
  47206. Ci.ShaderMaterial = function(e) {
  47207. Ci.Material.call(this),
  47208. this.type = "ShaderMaterial",
  47209. this.defines = {},
  47210. this.uniforms = {},
  47211. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  47212. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  47213. this.shading = Ci.SmoothShading,
  47214. this.linewidth = 1,
  47215. this.wireframe = !1,
  47216. this.wireframeLinewidth = 1,
  47217. this.fog = !1,
  47218. this.lights = !1,
  47219. this.vertexColors = Ci.NoColors,
  47220. this.skinning = !1,
  47221. this.morphTargets = !1,
  47222. this.morphNormals = !1,
  47223. this.extensions = {
  47224. derivatives: !1,
  47225. fragDepth: !1,
  47226. drawBuffers: !1,
  47227. shaderTextureLOD: !1
  47228. },
  47229. this.defaultAttributeValues = {
  47230. color: [1, 1, 1],
  47231. uv: [0, 0],
  47232. uv2: [0, 0]
  47233. },
  47234. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  47235. this.setValues(e))
  47236. }
  47237. ,
  47238. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  47239. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  47240. Ci.ShaderMaterial.prototype.copy = function(e) {
  47241. return Ci.Material.prototype.copy.call(this, e),
  47242. this.fragmentShader = e.fragmentShader,
  47243. this.vertexShader = e.vertexShader,
  47244. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  47245. this.defines = e.defines,
  47246. this.shading = e.shading,
  47247. this.wireframe = e.wireframe,
  47248. this.wireframeLinewidth = e.wireframeLinewidth,
  47249. this.fog = e.fog,
  47250. this.lights = e.lights,
  47251. this.vertexColors = e.vertexColors,
  47252. this.skinning = e.skinning,
  47253. this.morphTargets = e.morphTargets,
  47254. this.morphNormals = e.morphNormals,
  47255. this.extensions = e.extensions,
  47256. this
  47257. }
  47258. ,
  47259. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  47260. var t = Ci.Material.prototype.toJSON.call(this, e);
  47261. return t.uniforms = this.uniforms,
  47262. t.vertexShader = this.vertexShader,
  47263. t.fragmentShader = this.fragmentShader,
  47264. t
  47265. }
  47266. ,
  47267. Ci.RawShaderMaterial = function(e) {
  47268. Ci.ShaderMaterial.call(this, e),
  47269. this.type = "RawShaderMaterial"
  47270. }
  47271. ,
  47272. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  47273. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  47274. Ci.SpriteMaterial = function(e) {
  47275. Ci.Material.call(this),
  47276. this.type = "SpriteMaterial",
  47277. this.color = new Ci.Color(16777215),
  47278. this.map = null,
  47279. this.rotation = 0,
  47280. this.fog = !1,
  47281. this.setValues(e)
  47282. }
  47283. ,
  47284. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  47285. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  47286. Ci.SpriteMaterial.prototype.copy = function(e) {
  47287. return Ci.Material.prototype.copy.call(this, e),
  47288. this.color.copy(e.color),
  47289. this.map = e.map,
  47290. this.rotation = e.rotation,
  47291. this.fog = e.fog,
  47292. this
  47293. }
  47294. ,
  47295. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  47296. Object.defineProperty(this, "id", {
  47297. value: Ci.TextureIdCount++
  47298. }),
  47299. this.uuid = Ci.Math.generateUUID(),
  47300. this.name = "",
  47301. this.sourceFile = "",
  47302. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  47303. this.mipmaps = [],
  47304. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  47305. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  47306. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  47307. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  47308. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  47309. this.anisotropy = void 0 !== l ? l : 1,
  47310. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  47311. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  47312. this.offset = new Ci.Vector2(0,0),
  47313. this.repeat = new Ci.Vector2(1,1),
  47314. this.generateMipmaps = !0,
  47315. this.premultiplyAlpha = !1,
  47316. this.flipY = !0,
  47317. this.unpackAlignment = 4,
  47318. this.encoding = Ci.LinearEncoding,
  47319. this.version = 0,
  47320. this.onUpdate = null
  47321. }
  47322. ,
  47323. Ci.Texture.DEFAULT_IMAGE = void 0,
  47324. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  47325. Ci.Texture.prototype = {
  47326. constructor: Ci.Texture,
  47327. set needsUpdate(e) {
  47328. !0 === e && this.version++
  47329. },
  47330. clone: function() {
  47331. return (new this.constructor).copy(this)
  47332. },
  47333. copy: function(e) {
  47334. return this.image = e.image,
  47335. this.mipmaps = e.mipmaps.slice(0),
  47336. this.mapping = e.mapping,
  47337. this.wrapS = e.wrapS,
  47338. this.wrapT = e.wrapT,
  47339. this.magFilter = e.magFilter,
  47340. this.minFilter = e.minFilter,
  47341. this.anisotropy = e.anisotropy,
  47342. this.format = e.format,
  47343. this.type = e.type,
  47344. this.offset.copy(e.offset),
  47345. this.repeat.copy(e.repeat),
  47346. this.generateMipmaps = e.generateMipmaps,
  47347. this.premultiplyAlpha = e.premultiplyAlpha,
  47348. this.flipY = e.flipY,
  47349. this.unpackAlignment = e.unpackAlignment,
  47350. this.encoding = e.encoding,
  47351. this
  47352. },
  47353. toJSON: function(e) {
  47354. if (void 0 !== e.textures[this.uuid])
  47355. return e.textures[this.uuid];
  47356. var t, i, n = {
  47357. metadata: {
  47358. version: 4.4,
  47359. type: "Texture",
  47360. generator: "Texture.toJSON"
  47361. },
  47362. uuid: this.uuid,
  47363. name: this.name,
  47364. mapping: this.mapping,
  47365. repeat: [this.repeat.x, this.repeat.y],
  47366. offset: [this.offset.x, this.offset.y],
  47367. wrap: [this.wrapS, this.wrapT],
  47368. minFilter: this.minFilter,
  47369. magFilter: this.magFilter,
  47370. anisotropy: this.anisotropy
  47371. };
  47372. if (void 0 !== this.image) {
  47373. var r = this.image;
  47374. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  47375. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  47376. uuid: r.uuid,
  47377. url: (t = r,
  47378. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  47379. i.height = t.height,
  47380. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  47381. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  47382. }),
  47383. n.image = r.uuid
  47384. }
  47385. return e.textures[this.uuid] = n
  47386. },
  47387. dispose: function() {
  47388. this.dispatchEvent({
  47389. type: "dispose"
  47390. })
  47391. },
  47392. transformUv: function(e) {
  47393. if (this.mapping === Ci.UVMapping) {
  47394. if (e.multiply(this.repeat),
  47395. e.add(this.offset),
  47396. e.x < 0 || 1 < e.x)
  47397. switch (this.wrapS) {
  47398. case Ci.RepeatWrapping:
  47399. e.x = e.x - Math.floor(e.x);
  47400. break;
  47401. case Ci.ClampToEdgeWrapping:
  47402. e.x = e.x < 0 ? 0 : 1;
  47403. break;
  47404. case Ci.MirroredRepeatWrapping:
  47405. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  47406. }
  47407. if (e.y < 0 || 1 < e.y)
  47408. switch (this.wrapT) {
  47409. case Ci.RepeatWrapping:
  47410. e.y = e.y - Math.floor(e.y);
  47411. break;
  47412. case Ci.ClampToEdgeWrapping:
  47413. e.y = e.y < 0 ? 0 : 1;
  47414. break;
  47415. case Ci.MirroredRepeatWrapping:
  47416. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  47417. }
  47418. this.flipY && (e.y = 1 - e.y)
  47419. }
  47420. }
  47421. },
  47422. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  47423. Ci.TextureIdCount = 0,
  47424. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  47425. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47426. this.needsUpdate = !0
  47427. }
  47428. ,
  47429. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  47430. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  47431. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  47432. e = void 0 !== e ? e : [],
  47433. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  47434. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47435. this.flipY = !1
  47436. }
  47437. ,
  47438. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  47439. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  47440. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  47441. get: function() {
  47442. return this.image
  47443. },
  47444. set: function(e) {
  47445. this.image = e
  47446. }
  47447. }),
  47448. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47449. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47450. this.image = {
  47451. width: t,
  47452. height: i
  47453. },
  47454. this.mipmaps = e,
  47455. this.flipY = !1,
  47456. this.generateMipmaps = !1
  47457. }
  47458. ,
  47459. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  47460. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  47461. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47462. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47463. this.image = {
  47464. data: e,
  47465. width: t,
  47466. height: i
  47467. },
  47468. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  47469. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  47470. this.flipY = !1,
  47471. this.generateMipmaps = !1
  47472. }
  47473. ,
  47474. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  47475. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  47476. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  47477. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  47478. this.generateMipmaps = !1;
  47479. var c = this;
  47480. !function e() {
  47481. requestAnimationFrame(e),
  47482. !t.paused && t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  47483. }()
  47484. }
  47485. ,
  47486. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  47487. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  47488. Ci.Group = function() {
  47489. Ci.Object3D.call(this),
  47490. this.type = "Group"
  47491. }
  47492. ,
  47493. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  47494. Ci.Group.prototype.constructor = Ci.Group,
  47495. Ci.Points = function(e, t) {
  47496. Ci.Object3D.call(this),
  47497. this.type = "Points",
  47498. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47499. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  47500. color: 16777215 * Math.random()
  47501. })
  47502. }
  47503. ,
  47504. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  47505. Ci.Points.prototype.constructor = Ci.Points,
  47506. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  47507. jt = new Ci.Ray,
  47508. Yt = new Ci.Sphere,
  47509. function(o, a) {
  47510. function e(e, t) {
  47511. var i = jt.distanceSqToPoint(e);
  47512. if (i < c) {
  47513. var n = jt.closestPointToPoint(e);
  47514. n.applyMatrix4(l);
  47515. var r = o.ray.origin.distanceTo(n);
  47516. if (r < o.near || r > o.far)
  47517. return;
  47518. a.push({
  47519. distance: r,
  47520. distanceToRay: Math.sqrt(i),
  47521. point: n.clone(),
  47522. index: t,
  47523. face: null,
  47524. object: s
  47525. })
  47526. }
  47527. }
  47528. var s = this
  47529. , t = this.geometry
  47530. , l = this.matrixWorld
  47531. , i = o.params.Points.threshold;
  47532. if (null === t.boundingSphere && t.computeBoundingSphere(),
  47533. Yt.copy(t.boundingSphere),
  47534. Yt.applyMatrix4(l),
  47535. !1 !== o.ray.intersectsSphere(Yt)) {
  47536. Wt.getInverse(l),
  47537. jt.copy(o.ray).applyMatrix4(Wt);
  47538. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47539. , c = n * n
  47540. , r = new Ci.Vector3;
  47541. if (t instanceof Ci.BufferGeometry) {
  47542. var h = t.index
  47543. , u = t.attributes.position.array;
  47544. if (null !== h)
  47545. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  47546. var g = d[p];
  47547. r.fromArray(u, 3 * g),
  47548. e(r, g)
  47549. }
  47550. else {
  47551. p = 0;
  47552. for (var m = u.length / 3; p < m; p++)
  47553. r.fromArray(u, 3 * p),
  47554. e(r, p)
  47555. }
  47556. } else {
  47557. var v = t.vertices;
  47558. for (p = 0,
  47559. m = v.length; p < m; p++)
  47560. e(v[p], p)
  47561. }
  47562. }
  47563. }
  47564. ),
  47565. Ci.Points.prototype.clone = function() {
  47566. return new this.constructor(this.geometry,this.material).copy(this)
  47567. }
  47568. ,
  47569. Ci.Line = function(e, t, i) {
  47570. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47571. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  47572. this.type = "Line",
  47573. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47574. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  47575. color: 16777215 * Math.random()
  47576. })))
  47577. }
  47578. ,
  47579. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  47580. Ci.Line.prototype.constructor = Ci.Line,
  47581. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  47582. zt = new Ci.Ray,
  47583. Gt = new Ci.Sphere,
  47584. function(e, t) {
  47585. var i = e.linePrecision
  47586. , n = i * i
  47587. , r = this.geometry
  47588. , o = this.matrixWorld;
  47589. if (null === r.boundingSphere && r.computeBoundingSphere(),
  47590. Gt.copy(r.boundingSphere),
  47591. Gt.applyMatrix4(o),
  47592. !1 !== e.ray.intersectsSphere(Gt)) {
  47593. Ht.getInverse(o),
  47594. zt.copy(e.ray).applyMatrix4(Ht);
  47595. var a = new Ci.Vector3
  47596. , s = new Ci.Vector3
  47597. , l = new Ci.Vector3
  47598. , c = new Ci.Vector3
  47599. , h = this instanceof Ci.LineSegments ? 2 : 1;
  47600. if (r instanceof Ci.BufferGeometry) {
  47601. var u = r.index
  47602. , d = r.attributes.position.array;
  47603. if (null !== u)
  47604. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  47605. var m = p[f]
  47606. , v = p[f + 1];
  47607. a.fromArray(d, 3 * m),
  47608. s.fromArray(d, 3 * v),
  47609. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47610. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47611. distance: C,
  47612. point: l.clone().applyMatrix4(this.matrixWorld),
  47613. index: f,
  47614. face: null,
  47615. faceIndex: null,
  47616. object: this
  47617. }))
  47618. }
  47619. else
  47620. for (f = 0,
  47621. g = d.length / 3 - 1; f < g; f += h)
  47622. a.fromArray(d, 3 * f),
  47623. s.fromArray(d, 3 * f + 3),
  47624. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47625. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47626. distance: C,
  47627. point: l.clone().applyMatrix4(this.matrixWorld),
  47628. index: f,
  47629. face: null,
  47630. faceIndex: null,
  47631. object: this
  47632. }))
  47633. } else if (r instanceof Ci.Geometry) {
  47634. var y = r.vertices
  47635. , A = y.length;
  47636. for (f = 0; f < A - 1; f += h) {
  47637. var C;
  47638. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  47639. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47640. distance: C,
  47641. point: l.clone().applyMatrix4(this.matrixWorld),
  47642. index: f,
  47643. face: null,
  47644. faceIndex: null,
  47645. object: this
  47646. }))
  47647. }
  47648. }
  47649. }
  47650. }
  47651. ),
  47652. Ci.Line.prototype.clone = function() {
  47653. return new this.constructor(this.geometry,this.material).copy(this)
  47654. }
  47655. ,
  47656. Ci.LineStrip = 0,
  47657. Ci.LinePieces = 1,
  47658. Ci.LineSegments = function(e, t) {
  47659. Ci.Line.call(this, e, t),
  47660. this.type = "LineSegments"
  47661. }
  47662. ,
  47663. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  47664. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  47665. Ci.Mesh = function(e, t) {
  47666. Ci.Object3D.call(this),
  47667. this.type = "Mesh",
  47668. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47669. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  47670. color: 16777215 * Math.random()
  47671. }),
  47672. this.drawMode = Ci.TrianglesDrawMode,
  47673. this.updateMorphTargets()
  47674. }
  47675. ,
  47676. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  47677. Ci.Mesh.prototype.constructor = Ci.Mesh,
  47678. Ci.Mesh.prototype.setDrawMode = function(e) {
  47679. this.drawMode = e
  47680. }
  47681. ,
  47682. Ci.Mesh.prototype.updateMorphTargets = function() {
  47683. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  47684. this.morphTargetBase = -1,
  47685. this.morphTargetInfluences = [],
  47686. this.morphTargetDictionary = {};
  47687. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47688. this.morphTargetInfluences.push(0),
  47689. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47690. }
  47691. }
  47692. ,
  47693. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47694. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47695. 0)
  47696. }
  47697. ,
  47698. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  47699. xt = new Ci.Ray,
  47700. St = new Ci.Sphere,
  47701. Mt = new Ci.Vector3,
  47702. Rt = new Ci.Vector3,
  47703. Pt = new Ci.Vector3,
  47704. Ot = new Ci.Vector3,
  47705. Lt = new Ci.Vector3,
  47706. Dt = new Ci.Vector3,
  47707. Nt = new Ci.Vector2,
  47708. Ft = new Ci.Vector2,
  47709. Bt = new Ci.Vector2,
  47710. Vt = new Ci.Vector3,
  47711. kt = new Ci.Vector3,
  47712. Ut = new Ci.Vector3,
  47713. function(e, t) {
  47714. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  47715. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  47716. St.copy(r.boundingSphere),
  47717. St.applyMatrix4(a),
  47718. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  47719. xt.copy(e.ray).applyMatrix4(Tt),
  47720. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  47721. if (r instanceof Ci.BufferGeometry) {
  47722. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  47723. if (void 0 !== u.uv && (i = u.uv.array),
  47724. null !== h)
  47725. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  47726. s = p[f],
  47727. l = p[f + 1],
  47728. c = p[f + 2],
  47729. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  47730. t.push(n));
  47731. else
  47732. for (f = 0,
  47733. g = d.length; f < g; f += 9)
  47734. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  47735. t.push(n))
  47736. } else if (r instanceof Ci.Geometry) {
  47737. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  47738. 0 < _.length && (i = _);
  47739. for (var b = 0, w = E.length; b < w; b++) {
  47740. var T = E[b]
  47741. , x = 1 == A ? C[T.materialIndex] : o;
  47742. if (void 0 !== x) {
  47743. if (m = I[T.a],
  47744. v = I[T.b],
  47745. y = I[T.c],
  47746. !0 === x.morphTargets) {
  47747. var S = r.morphTargets
  47748. , M = this.morphTargetInfluences;
  47749. Mt.set(0, 0, 0),
  47750. Rt.set(0, 0, 0),
  47751. Pt.set(0, 0, 0);
  47752. for (var R = 0, P = S.length; R < P; R++) {
  47753. var O = M[R];
  47754. if (0 !== O) {
  47755. var L = S[R].vertices;
  47756. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  47757. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  47758. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  47759. }
  47760. }
  47761. Mt.add(m),
  47762. Rt.add(v),
  47763. Pt.add(y),
  47764. m = Mt,
  47765. v = Rt,
  47766. y = Pt
  47767. }
  47768. if (n = wi(this, e, xt, m, v, y, kt)) {
  47769. if (i) {
  47770. var D = i[b];
  47771. Nt.copy(D[0]),
  47772. Ft.copy(D[1]),
  47773. Bt.copy(D[2]),
  47774. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  47775. }
  47776. n.face = T,
  47777. n.faceIndex = b,
  47778. t.push(n)
  47779. }
  47780. }
  47781. }
  47782. }
  47783. }
  47784. ),
  47785. Ci.Mesh.prototype.clone = function() {
  47786. return new this.constructor(this.geometry,this.material).copy(this)
  47787. }
  47788. ,
  47789. Ci.Bone = function(e) {
  47790. Ci.Object3D.call(this),
  47791. this.type = "Bone",
  47792. this.skin = e
  47793. }
  47794. ,
  47795. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47796. Ci.Bone.prototype.constructor = Ci.Bone,
  47797. Ci.Bone.prototype.copy = function(e) {
  47798. return Ci.Object3D.prototype.copy.call(this, e),
  47799. this.skin = e.skin,
  47800. this
  47801. }
  47802. ,
  47803. Ci.Skeleton = function(e, t, i) {
  47804. if (this.useVertexTexture = void 0 === i || i,
  47805. this.identityMatrix = new Ci.Matrix4,
  47806. e = e || [],
  47807. this.bones = e.slice(0),
  47808. this.useVertexTexture) {
  47809. var n = Math.sqrt(4 * this.bones.length);
  47810. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47811. n = Math.max(n, 4),
  47812. this.boneTextureWidth = n,
  47813. this.boneTextureHeight = n,
  47814. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47815. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47816. } else
  47817. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47818. if (void 0 === t)
  47819. this.calculateInverses();
  47820. else if (this.bones.length === t.length)
  47821. this.boneInverses = t.slice(0);
  47822. else {
  47823. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47824. this.boneInverses = [];
  47825. for (var r = 0, o = this.bones.length; r < o; r++)
  47826. this.boneInverses.push(new Ci.Matrix4)
  47827. }
  47828. }
  47829. ,
  47830. Ci.Skeleton.prototype.calculateInverses = function() {
  47831. this.boneInverses = [];
  47832. for (var e = 0, t = this.bones.length; e < t; e++) {
  47833. var i = new Ci.Matrix4;
  47834. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47835. this.boneInverses.push(i)
  47836. }
  47837. }
  47838. ,
  47839. Ci.Skeleton.prototype.pose = function() {
  47840. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47841. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47842. for (t = 0,
  47843. i = this.bones.length; t < i; t++)
  47844. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47845. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47846. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47847. }
  47848. ,
  47849. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47850. function() {
  47851. for (var e = 0, t = this.bones.length; e < t; e++) {
  47852. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47853. wt.multiplyMatrices(i, this.boneInverses[e]),
  47854. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47855. }
  47856. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47857. }
  47858. ),
  47859. Ci.Skeleton.prototype.clone = function() {
  47860. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47861. }
  47862. ,
  47863. Ci.SkinnedMesh = function(e, t, i) {
  47864. Ci.Mesh.call(this, e, t),
  47865. this.type = "SkinnedMesh",
  47866. this.bindMode = "attached",
  47867. this.bindMatrix = new Ci.Matrix4,
  47868. this.bindMatrixInverse = new Ci.Matrix4;
  47869. var n = [];
  47870. if (this.geometry && void 0 !== this.geometry.bones) {
  47871. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47872. o = this.geometry.bones[a],
  47873. r = new Ci.Bone(this),
  47874. n.push(r),
  47875. r.name = o.name,
  47876. r.position.fromArray(o.pos),
  47877. r.quaternion.fromArray(o.rotq),
  47878. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47879. for (a = 0,
  47880. s = this.geometry.bones.length; a < s; ++a)
  47881. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47882. }
  47883. this.normalizeSkinWeights(),
  47884. this.updateMatrixWorld(!0),
  47885. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47886. }
  47887. ,
  47888. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47889. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47890. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47891. this.skeleton = e,
  47892. void 0 === t && (this.updateMatrixWorld(!0),
  47893. this.skeleton.calculateInverses(),
  47894. t = this.matrixWorld),
  47895. this.bindMatrix.copy(t),
  47896. this.bindMatrixInverse.getInverse(t)
  47897. }
  47898. ,
  47899. Ci.SkinnedMesh.prototype.pose = function() {
  47900. this.skeleton.pose()
  47901. }
  47902. ,
  47903. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47904. if (this.geometry instanceof Ci.Geometry)
  47905. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47906. var t = this.geometry.skinWeights[e];
  47907. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47908. }
  47909. else if (this.geometry instanceof Ci.BufferGeometry) {
  47910. var i = new Ci.Vector4
  47911. , n = this.geometry.attributes.skinWeight;
  47912. for (e = 0; e < n.count; e++) {
  47913. var r;
  47914. i.x = n.getX(e),
  47915. i.y = n.getY(e),
  47916. i.z = n.getZ(e),
  47917. i.w = n.getW(e),
  47918. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47919. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47920. }
  47921. }
  47922. }
  47923. ,
  47924. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47925. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47926. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47927. }
  47928. ,
  47929. Ci.SkinnedMesh.prototype.clone = function() {
  47930. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47931. }
  47932. ,
  47933. Ci.LOD = function() {
  47934. Ci.Object3D.call(this),
  47935. this.type = "LOD",
  47936. Object.defineProperties(this, {
  47937. levels: {
  47938. enumerable: !0,
  47939. value: []
  47940. },
  47941. objects: {
  47942. get: function() {
  47943. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47944. this.levels
  47945. }
  47946. }
  47947. })
  47948. }
  47949. ,
  47950. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  47951. Ci.LOD.prototype.constructor = Ci.LOD,
  47952. Ci.LOD.prototype.addLevel = function(e, t) {
  47953. void 0 === t && (t = 0),
  47954. t = Math.abs(t);
  47955. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47956. ;
  47957. i.splice(n, 0, {
  47958. distance: t,
  47959. object: e
  47960. }),
  47961. this.add(e)
  47962. }
  47963. ,
  47964. Ci.LOD.prototype.getObjectForDistance = function(e) {
  47965. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47966. ;
  47967. return t[i - 1].object
  47968. }
  47969. ,
  47970. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  47971. function(e, t) {
  47972. bt.setFromMatrixPosition(this.matrixWorld);
  47973. var i = e.ray.origin.distanceTo(bt);
  47974. this.getObjectForDistance(i).raycast(e, t)
  47975. }
  47976. ),
  47977. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  47978. _t = new Ci.Vector3,
  47979. function(e) {
  47980. var t = this.levels;
  47981. if (1 < t.length) {
  47982. Et.setFromMatrixPosition(e.matrixWorld),
  47983. _t.setFromMatrixPosition(this.matrixWorld);
  47984. var i = Et.distanceTo(_t);
  47985. t[0].object.visible = !0;
  47986. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  47987. t[n - 1].object.visible = !1,
  47988. t[n].object.visible = !0;
  47989. for (; n < r; n++)
  47990. t[n].object.visible = !1
  47991. }
  47992. }
  47993. ),
  47994. Ci.LOD.prototype.copy = function(e) {
  47995. Ci.Object3D.prototype.copy.call(this, e, !1);
  47996. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  47997. var r = t[i];
  47998. this.addLevel(r.object.clone(), r.distance)
  47999. }
  48000. return this
  48001. }
  48002. ,
  48003. Ci.LOD.prototype.toJSON = function(e) {
  48004. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  48005. t.object.levels = [];
  48006. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  48007. var o = i[n];
  48008. t.object.levels.push({
  48009. object: o.object.uuid,
  48010. distance: o.distance
  48011. })
  48012. }
  48013. return t
  48014. }
  48015. ,
  48016. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  48017. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  48018. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  48019. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  48020. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  48021. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  48022. function(e) {
  48023. Ci.Object3D.call(this),
  48024. this.type = "Sprite",
  48025. this.geometry = It,
  48026. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  48027. }
  48028. ),
  48029. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  48030. Ci.Sprite.prototype.constructor = Ci.Sprite,
  48031. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  48032. function(e, t) {
  48033. vt.setFromMatrixPosition(this.matrixWorld);
  48034. var i = e.ray.distanceSqToPoint(vt);
  48035. this.scale.x * this.scale.y < i || t.push({
  48036. distance: Math.sqrt(i),
  48037. point: this.position,
  48038. face: null,
  48039. object: this
  48040. })
  48041. }
  48042. ),
  48043. Ci.Sprite.prototype.clone = function() {
  48044. return new this.constructor(this.material).copy(this)
  48045. }
  48046. ,
  48047. Ci.Particle = Ci.Sprite,
  48048. Ci.LensFlare = function(e, t, i, n, r) {
  48049. Ci.Object3D.call(this),
  48050. this.lensFlares = [],
  48051. this.positionScreen = new Ci.Vector3,
  48052. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  48053. }
  48054. ,
  48055. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  48056. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  48057. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  48058. void 0 === t && (t = -1),
  48059. void 0 === i && (i = 0),
  48060. void 0 === o && (o = 1),
  48061. void 0 === r && (r = new Ci.Color(16777215)),
  48062. void 0 === n && (n = Ci.NormalBlending),
  48063. i = Math.min(i, Math.max(0, i)),
  48064. this.lensFlares.push({
  48065. texture: e,
  48066. size: t,
  48067. distance: i,
  48068. x: 0,
  48069. y: 0,
  48070. z: 0,
  48071. scale: 1,
  48072. rotation: 0,
  48073. opacity: o,
  48074. color: r,
  48075. blending: n
  48076. })
  48077. }
  48078. ,
  48079. Ci.LensFlare.prototype.updateLensFlares = function() {
  48080. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  48081. for (e = 0; e < i; e++)
  48082. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  48083. t.y = this.positionScreen.y + r * t.distance,
  48084. t.wantedRotation = t.x * Math.PI * .25,
  48085. t.rotation += .25 * (t.wantedRotation - t.rotation)
  48086. }
  48087. ,
  48088. Ci.LensFlare.prototype.copy = function(e) {
  48089. Ci.Object3D.prototype.copy.call(this, e),
  48090. this.positionScreen.copy(e.positionScreen),
  48091. this.customUpdateCallback = e.customUpdateCallback;
  48092. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  48093. this.lensFlares.push(e.lensFlares[t]);
  48094. return this
  48095. }
  48096. ,
  48097. Ci.Scene = function() {
  48098. Ci.Object3D.call(this),
  48099. this.type = "Scene",
  48100. this.fog = null,
  48101. this.overrideMaterial = null,
  48102. this.autoUpdate = !0
  48103. }
  48104. ,
  48105. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  48106. Ci.Scene.prototype.constructor = Ci.Scene,
  48107. Ci.Scene.prototype.copy = function(e, t) {
  48108. return Ci.Object3D.prototype.copy.call(this, e, t),
  48109. null !== e.fog && (this.fog = e.fog.clone()),
  48110. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  48111. this.autoUpdate = e.autoUpdate,
  48112. this.matrixAutoUpdate = e.matrixAutoUpdate,
  48113. this
  48114. }
  48115. ,
  48116. Ci.Fog = function(e, t, i) {
  48117. this.name = "",
  48118. this.color = new Ci.Color(e),
  48119. this.near = void 0 !== t ? t : 1,
  48120. this.far = void 0 !== i ? i : 1e3
  48121. }
  48122. ,
  48123. Ci.Fog.prototype.clone = function() {
  48124. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  48125. }
  48126. ,
  48127. Ci.FogExp2 = function(e, t) {
  48128. this.name = "",
  48129. this.color = new Ci.Color(e),
  48130. this.density = void 0 !== t ? t : 25e-5
  48131. }
  48132. ,
  48133. Ci.FogExp2.prototype.clone = function() {
  48134. return new Ci.FogExp2(this.color.getHex(),this.density)
  48135. }
  48136. ,
  48137. Ci.ShaderChunk = {},
  48138. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  48139. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  48140. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  48141. Ci.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",
  48142. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  48143. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  48144. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  48145. Ci.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",
  48146. Ci.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",
  48147. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  48148. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  48149. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  48150. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  48151. Ci.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",
  48152. Ci.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",
  48153. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  48154. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  48155. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  48156. Ci.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",
  48157. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  48158. Ci.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",
  48159. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  48160. Ci.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",
  48161. Ci.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",
  48162. Ci.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",
  48163. Ci.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",
  48164. Ci.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",
  48165. Ci.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",
  48166. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  48167. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  48168. Ci.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",
  48169. Ci.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",
  48170. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  48171. Ci.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",
  48172. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  48173. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  48174. Ci.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",
  48175. Ci.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",
  48176. Ci.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",
  48177. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  48178. Ci.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",
  48179. Ci.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",
  48180. Ci.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",
  48181. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  48182. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  48183. Ci.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",
  48184. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  48185. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  48186. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  48187. Ci.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",
  48188. Ci.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",
  48189. Ci.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",
  48190. Ci.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",
  48191. Ci.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",
  48192. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  48193. Ci.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",
  48194. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  48195. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  48196. Ci.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",
  48197. Ci.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",
  48198. Ci.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",
  48199. Ci.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",
  48200. Ci.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",
  48201. Ci.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",
  48202. Ci.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",
  48203. Ci.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",
  48204. Ci.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",
  48205. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  48206. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  48207. Ci.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",
  48208. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  48209. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  48210. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  48211. Ci.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",
  48212. Ci.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",
  48213. Ci.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",
  48214. Ci.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",
  48215. Ci.UniformsUtils = {
  48216. merge: function(e) {
  48217. for (var t = {}, i = 0; i < e.length; i++) {
  48218. var n = this.clone(e[i]);
  48219. for (var r in n)
  48220. t[r] = n[r]
  48221. }
  48222. return t
  48223. },
  48224. clone: function(e) {
  48225. var t = {};
  48226. for (var i in e)
  48227. for (var n in t[i] = {},
  48228. e[i]) {
  48229. var r = e[i][n];
  48230. r instanceof Ci.Color || r instanceof Ci.Vector2 || r instanceof Ci.Vector3 || r instanceof Ci.Vector4 || r instanceof Ci.Matrix3 || r instanceof Ci.Matrix4 || r instanceof Ci.Texture ? t[i][n] = r.clone() : Array.isArray(r) ? t[i][n] = r.slice() : t[i][n] = r
  48231. }
  48232. return t
  48233. }
  48234. },
  48235. Ci.UniformsLib = {
  48236. common: {
  48237. diffuse: {
  48238. type: "c",
  48239. value: new Ci.Color(15658734)
  48240. },
  48241. opacity: {
  48242. type: "f",
  48243. value: 1
  48244. },
  48245. map: {
  48246. type: "t",
  48247. value: null
  48248. },
  48249. offsetRepeat: {
  48250. type: "v4",
  48251. value: new Ci.Vector4(0,0,1,1)
  48252. },
  48253. specularMap: {
  48254. type: "t",
  48255. value: null
  48256. },
  48257. alphaMap: {
  48258. type: "t",
  48259. value: null
  48260. },
  48261. envMap: {
  48262. type: "t",
  48263. value: null
  48264. },
  48265. flipEnvMap: {
  48266. type: "f",
  48267. value: -1
  48268. },
  48269. reflectivity: {
  48270. type: "f",
  48271. value: 1
  48272. },
  48273. refractionRatio: {
  48274. type: "f",
  48275. value: .98
  48276. }
  48277. },
  48278. aomap: {
  48279. aoMap: {
  48280. type: "t",
  48281. value: null
  48282. },
  48283. aoMapIntensity: {
  48284. type: "f",
  48285. value: 1
  48286. }
  48287. },
  48288. lightmap: {
  48289. lightMap: {
  48290. type: "t",
  48291. value: null
  48292. },
  48293. lightMapIntensity: {
  48294. type: "f",
  48295. value: 1
  48296. }
  48297. },
  48298. emissivemap: {
  48299. emissiveMap: {
  48300. type: "t",
  48301. value: null
  48302. }
  48303. },
  48304. bumpmap: {
  48305. bumpMap: {
  48306. type: "t",
  48307. value: null
  48308. },
  48309. bumpScale: {
  48310. type: "f",
  48311. value: 1
  48312. }
  48313. },
  48314. normalmap: {
  48315. normalMap: {
  48316. type: "t",
  48317. value: null
  48318. },
  48319. normalScale: {
  48320. type: "v2",
  48321. value: new Ci.Vector2(1,1)
  48322. }
  48323. },
  48324. displacementmap: {
  48325. displacementMap: {
  48326. type: "t",
  48327. value: null
  48328. },
  48329. displacementScale: {
  48330. type: "f",
  48331. value: 1
  48332. },
  48333. displacementBias: {
  48334. type: "f",
  48335. value: 0
  48336. }
  48337. },
  48338. roughnessmap: {
  48339. roughnessMap: {
  48340. type: "t",
  48341. value: null
  48342. }
  48343. },
  48344. metalnessmap: {
  48345. metalnessMap: {
  48346. type: "t",
  48347. value: null
  48348. }
  48349. },
  48350. fog: {
  48351. fogDensity: {
  48352. type: "f",
  48353. value: 25e-5
  48354. },
  48355. fogNear: {
  48356. type: "f",
  48357. value: 1
  48358. },
  48359. fogFar: {
  48360. type: "f",
  48361. value: 2e3
  48362. },
  48363. fogColor: {
  48364. type: "c",
  48365. value: new Ci.Color(16777215)
  48366. }
  48367. },
  48368. lights: {
  48369. ambientLightColor: {
  48370. type: "fv",
  48371. value: []
  48372. },
  48373. directionalLights: {
  48374. type: "sa",
  48375. value: [],
  48376. properties: {
  48377. direction: {
  48378. type: "v3"
  48379. },
  48380. color: {
  48381. type: "c"
  48382. },
  48383. shadow: {
  48384. type: "i"
  48385. },
  48386. shadowBias: {
  48387. type: "f"
  48388. },
  48389. shadowRadius: {
  48390. type: "f"
  48391. },
  48392. shadowMapSize: {
  48393. type: "v2"
  48394. }
  48395. }
  48396. },
  48397. directionalShadowMap: {
  48398. type: "tv",
  48399. value: []
  48400. },
  48401. directionalShadowMatrix: {
  48402. type: "m4v",
  48403. value: []
  48404. },
  48405. spotLights: {
  48406. type: "sa",
  48407. value: [],
  48408. properties: {
  48409. color: {
  48410. type: "c"
  48411. },
  48412. position: {
  48413. type: "v3"
  48414. },
  48415. direction: {
  48416. type: "v3"
  48417. },
  48418. distance: {
  48419. type: "f"
  48420. },
  48421. coneCos: {
  48422. type: "f"
  48423. },
  48424. penumbraCos: {
  48425. type: "f"
  48426. },
  48427. decay: {
  48428. type: "f"
  48429. },
  48430. shadow: {
  48431. type: "i"
  48432. },
  48433. shadowBias: {
  48434. type: "f"
  48435. },
  48436. shadowRadius: {
  48437. type: "f"
  48438. },
  48439. shadowMapSize: {
  48440. type: "v2"
  48441. }
  48442. }
  48443. },
  48444. spotShadowMap: {
  48445. type: "tv",
  48446. value: []
  48447. },
  48448. spotShadowMatrix: {
  48449. type: "m4v",
  48450. value: []
  48451. },
  48452. pointLights: {
  48453. type: "sa",
  48454. value: [],
  48455. properties: {
  48456. color: {
  48457. type: "c"
  48458. },
  48459. position: {
  48460. type: "v3"
  48461. },
  48462. decay: {
  48463. type: "f"
  48464. },
  48465. distance: {
  48466. type: "f"
  48467. },
  48468. shadow: {
  48469. type: "i"
  48470. },
  48471. shadowBias: {
  48472. type: "f"
  48473. },
  48474. shadowRadius: {
  48475. type: "f"
  48476. },
  48477. shadowMapSize: {
  48478. type: "v2"
  48479. }
  48480. }
  48481. },
  48482. pointShadowMap: {
  48483. type: "tv",
  48484. value: []
  48485. },
  48486. pointShadowMatrix: {
  48487. type: "m4v",
  48488. value: []
  48489. },
  48490. hemisphereLights: {
  48491. type: "sa",
  48492. value: [],
  48493. properties: {
  48494. direction: {
  48495. type: "v3"
  48496. },
  48497. skyColor: {
  48498. type: "c"
  48499. },
  48500. groundColor: {
  48501. type: "c"
  48502. }
  48503. }
  48504. }
  48505. },
  48506. points: {
  48507. diffuse: {
  48508. type: "c",
  48509. value: new Ci.Color(15658734)
  48510. },
  48511. opacity: {
  48512. type: "f",
  48513. value: 1
  48514. },
  48515. size: {
  48516. type: "f",
  48517. value: 1
  48518. },
  48519. scale: {
  48520. type: "f",
  48521. value: 1
  48522. },
  48523. map: {
  48524. type: "t",
  48525. value: null
  48526. },
  48527. offsetRepeat: {
  48528. type: "v4",
  48529. value: new Ci.Vector4(0,0,1,1)
  48530. }
  48531. }
  48532. },
  48533. Ci.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",
  48534. Ci.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",
  48535. Ci.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",
  48536. Ci.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",
  48537. Ci.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",
  48538. Ci.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",
  48539. Ci.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",
  48540. Ci.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",
  48541. Ci.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",
  48542. Ci.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",
  48543. Ci.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",
  48544. Ci.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",
  48545. Ci.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",
  48546. Ci.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",
  48547. Ci.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",
  48548. Ci.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",
  48549. Ci.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",
  48550. Ci.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",
  48551. Ci.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",
  48552. Ci.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",
  48553. Ci.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",
  48554. Ci.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",
  48555. Ci.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",
  48556. Ci.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",
  48557. Ci.ShaderLib = {
  48558. basic: {
  48559. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  48560. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  48561. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  48562. },
  48563. lambert: {
  48564. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48565. emissive: {
  48566. type: "c",
  48567. value: new Ci.Color(0)
  48568. }
  48569. }]),
  48570. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  48571. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  48572. },
  48573. phong: {
  48574. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.bumpmap, Ci.UniformsLib.normalmap, Ci.UniformsLib.displacementmap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48575. emissive: {
  48576. type: "c",
  48577. value: new Ci.Color(0)
  48578. },
  48579. specular: {
  48580. type: "c",
  48581. value: new Ci.Color(1118481)
  48582. },
  48583. shininess: {
  48584. type: "f",
  48585. value: 30
  48586. }
  48587. }]),
  48588. vertexShader: Ci.ShaderChunk.meshphong_vert,
  48589. fragmentShader: Ci.ShaderChunk.meshphong_frag
  48590. },
  48591. standard: {
  48592. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.bumpmap, Ci.UniformsLib.normalmap, Ci.UniformsLib.displacementmap, Ci.UniformsLib.roughnessmap, Ci.UniformsLib.metalnessmap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48593. emissive: {
  48594. type: "c",
  48595. value: new Ci.Color(0)
  48596. },
  48597. roughness: {
  48598. type: "f",
  48599. value: .5
  48600. },
  48601. metalness: {
  48602. type: "f",
  48603. value: 0
  48604. },
  48605. envMapIntensity: {
  48606. type: "f",
  48607. value: 1
  48608. }
  48609. }]),
  48610. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  48611. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  48612. },
  48613. points: {
  48614. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  48615. vertexShader: Ci.ShaderChunk.points_vert,
  48616. fragmentShader: Ci.ShaderChunk.points_frag
  48617. },
  48618. dashed: {
  48619. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  48620. scale: {
  48621. type: "f",
  48622. value: 1
  48623. },
  48624. dashSize: {
  48625. type: "f",
  48626. value: 1
  48627. },
  48628. totalSize: {
  48629. type: "f",
  48630. value: 2
  48631. }
  48632. }]),
  48633. vertexShader: Ci.ShaderChunk.linedashed_vert,
  48634. fragmentShader: Ci.ShaderChunk.linedashed_frag
  48635. },
  48636. depth: {
  48637. uniforms: {
  48638. mNear: {
  48639. type: "f",
  48640. value: 1
  48641. },
  48642. mFar: {
  48643. type: "f",
  48644. value: 2e3
  48645. },
  48646. opacity: {
  48647. type: "f",
  48648. value: 1
  48649. }
  48650. },
  48651. vertexShader: Ci.ShaderChunk.depth_vert,
  48652. fragmentShader: Ci.ShaderChunk.depth_frag
  48653. },
  48654. normal: {
  48655. uniforms: {
  48656. opacity: {
  48657. type: "f",
  48658. value: 1
  48659. }
  48660. },
  48661. vertexShader: Ci.ShaderChunk.normal_vert,
  48662. fragmentShader: Ci.ShaderChunk.normal_frag
  48663. },
  48664. cube: {
  48665. uniforms: {
  48666. tCube: {
  48667. type: "t",
  48668. value: null
  48669. },
  48670. tFlip: {
  48671. type: "f",
  48672. value: -1
  48673. }
  48674. },
  48675. vertexShader: Ci.ShaderChunk.cube_vert,
  48676. fragmentShader: Ci.ShaderChunk.cube_frag
  48677. },
  48678. equirect: {
  48679. uniforms: {
  48680. tEquirect: {
  48681. type: "t",
  48682. value: null
  48683. },
  48684. tFlip: {
  48685. type: "f",
  48686. value: -1
  48687. }
  48688. },
  48689. vertexShader: Ci.ShaderChunk.equirect_vert,
  48690. fragmentShader: Ci.ShaderChunk.equirect_frag
  48691. },
  48692. depthRGBA: {
  48693. uniforms: {},
  48694. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  48695. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  48696. },
  48697. distanceRGBA: {
  48698. uniforms: {
  48699. lightPos: {
  48700. type: "v3",
  48701. value: new Ci.Vector3(0,0,0)
  48702. }
  48703. },
  48704. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  48705. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  48706. }
  48707. },
  48708. Ci.WebGLRenderer = function(e) {
  48709. function S() {
  48710. return null === Q ? he : 1
  48711. }
  48712. function i(e, t, i, n) {
  48713. !0 === V && (e *= n,
  48714. t *= n,
  48715. i *= n),
  48716. _e.clearColor(e, t, i, n)
  48717. }
  48718. function t() {
  48719. _e.init(),
  48720. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  48721. _e.viewport(re.copy(pe).multiplyScalar(he)),
  48722. i(ae.r, ae.g, ae.b, se)
  48723. }
  48724. function n() {
  48725. te = K = null,
  48726. ee = "",
  48727. $ = -1,
  48728. _e.reset()
  48729. }
  48730. function r(e) {
  48731. e.preventDefault(),
  48732. n(),
  48733. t(),
  48734. be.clear()
  48735. }
  48736. function f(e) {
  48737. var t = e.target;
  48738. t.removeEventListener("dispose", f),
  48739. function(e) {
  48740. var t = be.get(e);
  48741. if (e.image && t.__image__webglTextureCube)
  48742. X.deleteTexture(t.__image__webglTextureCube);
  48743. else {
  48744. if (void 0 === t.__webglInit)
  48745. return;
  48746. X.deleteTexture(t.__webglTexture)
  48747. }
  48748. be.delete(e)
  48749. }(t),
  48750. ye.textures--
  48751. }
  48752. function a(e) {
  48753. var t = e.target;
  48754. t.removeEventListener("dispose", a),
  48755. function(e) {
  48756. var t = be.get(e)
  48757. , i = be.get(e.texture);
  48758. if (e && void 0 !== i.__webglTexture) {
  48759. if (X.deleteTexture(i.__webglTexture),
  48760. e instanceof Ci.WebGLRenderTargetCube)
  48761. for (var n = 0; n < 6; n++)
  48762. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  48763. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  48764. else
  48765. X.deleteFramebuffer(t.__webglFramebuffer),
  48766. X.deleteRenderbuffer(t.__webglDepthbuffer);
  48767. be.delete(e.texture),
  48768. be.delete(e)
  48769. }
  48770. }(t),
  48771. ye.textures--
  48772. }
  48773. function v(e) {
  48774. var t = e.target;
  48775. t.removeEventListener("dispose", v),
  48776. function(e) {
  48777. y(e),
  48778. be.delete(e)
  48779. }(t)
  48780. }
  48781. function y(e) {
  48782. var t = be.get(e).program;
  48783. (e.program = void 0) !== t && Te.releaseProgram(t)
  48784. }
  48785. function M(e, t) {
  48786. return Math.abs(t[0]) - Math.abs(e[0])
  48787. }
  48788. function s(e, t) {
  48789. 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
  48790. }
  48791. function l(e, t) {
  48792. 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
  48793. }
  48794. function d(e, t, i, n, r) {
  48795. var o, a;
  48796. a = i.transparent ? (o = G,
  48797. ++W) : (o = H,
  48798. ++z);
  48799. var s = o[a];
  48800. void 0 !== s ? (s.id = e.id,
  48801. s.object = e,
  48802. s.geometry = t,
  48803. s.material = i,
  48804. s.z = me.z,
  48805. s.group = r) : (s = {
  48806. id: e.id,
  48807. object: e,
  48808. geometry: t,
  48809. material: i,
  48810. z: me.z,
  48811. group: r
  48812. },
  48813. o.push(s))
  48814. }
  48815. function c(e, t, i, n) {
  48816. for (var r = 0, o = e.length; r < o; r++) {
  48817. var a = e[r]
  48818. , s = a.object
  48819. , l = a.geometry
  48820. , c = void 0 === n ? a.material : n
  48821. , h = a.group;
  48822. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48823. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48824. s instanceof Ci.ImmediateRenderObject) {
  48825. R(c);
  48826. var u = P(t, i, c, s);
  48827. ee = "",
  48828. s.render(function(e) {
  48829. Z.renderBufferImmediate(e, u, c)
  48830. })
  48831. } else
  48832. Z.renderBufferDirect(t, i, l, c, s, h)
  48833. }
  48834. }
  48835. function R(e) {
  48836. (function(e) {
  48837. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48838. _e.setFlipSided(e.side === Ci.BackSide)
  48839. }
  48840. )(e),
  48841. !0 === e.transparent ? _e.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha) : _e.setBlending(Ci.NoBlending),
  48842. _e.setDepthFunc(e.depthFunc),
  48843. _e.setDepthTest(e.depthTest),
  48844. _e.setDepthWrite(e.depthWrite),
  48845. _e.setColorWrite(e.colorWrite),
  48846. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48847. }
  48848. function P(e, t, i, n) {
  48849. oe = 0;
  48850. var r = be.get(i);
  48851. void 0 === r.program && (i.needsUpdate = !0),
  48852. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48853. i.needsUpdate && (function(e, t, i) {
  48854. var n = be.get(e)
  48855. , r = Te.getParameters(e, ve, t, i)
  48856. , o = Te.getProgramCode(e, r)
  48857. , a = n.program
  48858. , s = !0;
  48859. if (void 0 === a)
  48860. e.addEventListener("dispose", v);
  48861. else if (a.code !== o)
  48862. y(e);
  48863. else {
  48864. if (void 0 !== r.shaderID)
  48865. return;
  48866. s = !1
  48867. }
  48868. if (s) {
  48869. if (r.shaderID) {
  48870. var l = Ci.ShaderLib[r.shaderID];
  48871. n.__webglShader = {
  48872. name: e.type,
  48873. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48874. vertexShader: l.vertexShader,
  48875. fragmentShader: l.fragmentShader
  48876. }
  48877. } else
  48878. n.__webglShader = {
  48879. name: e.type,
  48880. uniforms: e.uniforms,
  48881. vertexShader: e.vertexShader,
  48882. fragmentShader: e.fragmentShader
  48883. };
  48884. e.__webglShader = n.__webglShader,
  48885. a = Te.acquireProgram(e, r, o),
  48886. n.program = a,
  48887. e.program = a
  48888. }
  48889. var c = a.getAttributes();
  48890. if (e.morphTargets)
  48891. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48892. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48893. if (e.morphNormals)
  48894. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48895. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48896. n.uniformsList = [];
  48897. var u = n.__webglShader.uniforms
  48898. , d = n.program.getUniforms();
  48899. for (var p in u) {
  48900. var f = d[p];
  48901. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48902. }
  48903. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48904. u.ambientLightColor.value = ve.ambient,
  48905. u.directionalLights.value = ve.directional,
  48906. u.spotLights.value = ve.spot,
  48907. u.pointLights.value = ve.point,
  48908. u.hemisphereLights.value = ve.hemi,
  48909. u.directionalShadowMap.value = ve.directionalShadowMap,
  48910. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48911. u.spotShadowMap.value = ve.spotShadowMap,
  48912. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48913. u.pointShadowMap.value = ve.pointShadowMap,
  48914. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48915. n.hasDynamicUniforms = !1;
  48916. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48917. if (!0 === n.uniformsList[g][0].dynamic) {
  48918. n.hasDynamicUniforms = !0;
  48919. break
  48920. }
  48921. }
  48922. }(i, t, n),
  48923. i.needsUpdate = !1);
  48924. var o = !1
  48925. , a = !1
  48926. , s = !1
  48927. , l = r.program
  48928. , c = l.getUniforms()
  48929. , h = r.__webglShader.uniforms;
  48930. if (l.id !== K && (X.useProgram(l.program),
  48931. K = l.id,
  48932. s = a = o = !0),
  48933. i.id !== $ && ($ = i.id,
  48934. a = !0),
  48935. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  48936. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48937. e !== te && (te = e,
  48938. s = a = !0),
  48939. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  48940. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  48941. (i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshStandardMaterial || i instanceof Ci.ShaderMaterial || i.skinning) && void 0 !== c.viewMatrix && X.uniformMatrix4fv(c.viewMatrix, !1, e.matrixWorldInverse.elements),
  48942. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  48943. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  48944. i.skinning)
  48945. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  48946. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  48947. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  48948. if (void 0 !== c.boneTexture) {
  48949. var u = A();
  48950. X.uniform1i(c.boneTexture, u),
  48951. Z.setTexture(n.skeleton.boneTexture, u)
  48952. }
  48953. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  48954. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  48955. } else
  48956. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  48957. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  48958. e.ambientLightColor.needsUpdate = t,
  48959. e.directionalLights.needsUpdate = t,
  48960. e.pointLights.needsUpdate = t,
  48961. e.spotLights.needsUpdate = t,
  48962. e.hemisphereLights.needsUpdate = t
  48963. }(h, s),
  48964. t && i.fog && function(e, t) {
  48965. e.fogColor.value = t.color,
  48966. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  48967. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  48968. }(h, t),
  48969. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  48970. var i;
  48971. if (e.opacity.value = t.opacity,
  48972. e.diffuse.value = t.color,
  48973. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48974. e.map.value = t.map,
  48975. e.specularMap.value = t.specularMap,
  48976. e.alphaMap.value = t.alphaMap,
  48977. t.aoMap && (e.aoMap.value = t.aoMap,
  48978. e.aoMapIntensity.value = t.aoMapIntensity),
  48979. 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),
  48980. void 0 !== i) {
  48981. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  48982. var n = i.offset
  48983. , r = i.repeat;
  48984. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  48985. }
  48986. e.envMap.value = t.envMap,
  48987. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  48988. e.reflectivity.value = t.reflectivity,
  48989. e.refractionRatio.value = t.refractionRatio
  48990. }(h, i),
  48991. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  48992. function(e, t) {
  48993. e.dashSize.value = t.dashSize,
  48994. e.totalSize.value = t.dashSize + t.gapSize,
  48995. e.scale.value = t.scale
  48996. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  48997. if (e.diffuse.value = t.color,
  48998. e.opacity.value = t.opacity,
  48999. e.size.value = t.size * he,
  49000. e.scale.value = O.clientHeight / 2,
  49001. e.map.value = t.map,
  49002. null !== t.map) {
  49003. var i = t.map.offset
  49004. , n = t.map.repeat;
  49005. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  49006. }
  49007. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  49008. t.lightMap && (e.lightMap.value = t.lightMap,
  49009. e.lightMapIntensity.value = t.lightMapIntensity),
  49010. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  49011. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  49012. e.specular.value = t.specular,
  49013. e.shininess.value = Math.max(t.shininess, 1e-4),
  49014. t.lightMap && (e.lightMap.value = t.lightMap,
  49015. e.lightMapIntensity.value = t.lightMapIntensity),
  49016. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  49017. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  49018. e.bumpScale.value = t.bumpScale),
  49019. t.normalMap && (e.normalMap.value = t.normalMap,
  49020. e.normalScale.value.copy(t.normalScale)),
  49021. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  49022. e.displacementScale.value = t.displacementScale,
  49023. e.displacementBias.value = t.displacementBias)
  49024. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  49025. e.roughness.value = t.roughness,
  49026. e.metalness.value = t.metalness,
  49027. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  49028. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  49029. t.lightMap && (e.lightMap.value = t.lightMap,
  49030. e.lightMapIntensity.value = t.lightMapIntensity),
  49031. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  49032. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  49033. e.bumpScale.value = t.bumpScale),
  49034. t.normalMap && (e.normalMap.value = t.normalMap,
  49035. e.normalScale.value.copy(t.normalScale)),
  49036. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  49037. e.displacementScale.value = t.displacementScale,
  49038. e.displacementBias.value = t.displacementBias),
  49039. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  49040. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  49041. h.mFar.value = e.far,
  49042. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  49043. g(r.uniformsList)),
  49044. function(e, t) {
  49045. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  49046. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  49047. }(c, n),
  49048. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  49049. !0 === r.hasDynamicUniforms && function(e, t, i) {
  49050. for (var n = [], r = 0, o = e.length; r < o; r++) {
  49051. var a = e[r][0]
  49052. , s = a.onUpdateCallback;
  49053. void 0 !== s && (s.bind(a)(t, i),
  49054. n.push(e[r]))
  49055. }
  49056. g(n)
  49057. }(r.uniformsList, n, e),
  49058. l
  49059. }
  49060. function p(e, t) {
  49061. e.diffuse.value = t.color,
  49062. e.opacity.value = t.opacity
  49063. }
  49064. function A() {
  49065. var e = oe;
  49066. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  49067. oe += 1,
  49068. e
  49069. }
  49070. function C(e, t, i, n) {
  49071. var r, o;
  49072. if ("1i" === t)
  49073. X.uniform1i(i, n);
  49074. else if ("1f" === t)
  49075. X.uniform1f(i, n);
  49076. else if ("2f" === t)
  49077. X.uniform2f(i, n[0], n[1]);
  49078. else if ("3f" === t)
  49079. X.uniform3f(i, n[0], n[1], n[2]);
  49080. else if ("4f" === t)
  49081. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  49082. else if ("1iv" === t)
  49083. X.uniform1iv(i, n);
  49084. else if ("3iv" === t)
  49085. X.uniform3iv(i, n);
  49086. else if ("1fv" === t)
  49087. X.uniform1fv(i, n);
  49088. else if ("2fv" === t)
  49089. X.uniform2fv(i, n);
  49090. else if ("3fv" === t)
  49091. X.uniform3fv(i, n);
  49092. else if ("4fv" === t)
  49093. X.uniform4fv(i, n);
  49094. else if ("Matrix2fv" === t)
  49095. X.uniformMatrix2fv(i, !1, n);
  49096. else if ("Matrix3fv" === t)
  49097. X.uniformMatrix3fv(i, !1, n);
  49098. else if ("Matrix4fv" === t)
  49099. X.uniformMatrix4fv(i, !1, n);
  49100. else if ("i" === t)
  49101. X.uniform1i(i, n);
  49102. else if ("f" === t)
  49103. X.uniform1f(i, n);
  49104. else if ("v2" === t)
  49105. X.uniform2f(i, n.x, n.y);
  49106. else if ("v3" === t)
  49107. X.uniform3f(i, n.x, n.y, n.z);
  49108. else if ("v4" === t)
  49109. X.uniform4f(i, n.x, n.y, n.z, n.w);
  49110. else if ("c" === t)
  49111. X.uniform3f(i, n.r, n.g, n.b);
  49112. else if ("s" === t) {
  49113. var a = e.properties;
  49114. for (var s in a) {
  49115. var l = a[s]
  49116. , c = i[s]
  49117. , h = n[s];
  49118. C(l, l.type, c, h)
  49119. }
  49120. } else if ("sa" === t) {
  49121. a = e.properties;
  49122. for (var u = 0, d = n.length; u < d; u++)
  49123. for (var s in a) {
  49124. l = a[s],
  49125. c = i[u][s],
  49126. h = n[u][s];
  49127. C(l, l.type, c, h)
  49128. }
  49129. } else if ("iv1" === t)
  49130. X.uniform1iv(i, n);
  49131. else if ("iv" === t)
  49132. X.uniform3iv(i, n);
  49133. else if ("fv1" === t)
  49134. X.uniform1fv(i, n);
  49135. else if ("fv" === t)
  49136. X.uniform3fv(i, n);
  49137. else if ("v2v" === t) {
  49138. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  49139. u = 0;
  49140. for (var p = 0, f = n.length; u < f; u++,
  49141. p += 2)
  49142. e._array[p + 0] = n[u].x,
  49143. e._array[p + 1] = n[u].y;
  49144. X.uniform2fv(i, e._array)
  49145. } else if ("v3v" === t) {
  49146. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  49147. u = 0;
  49148. var g = 0;
  49149. for (f = n.length; u < f; u++,
  49150. g += 3)
  49151. e._array[g + 0] = n[u].x,
  49152. e._array[g + 1] = n[u].y,
  49153. e._array[g + 2] = n[u].z;
  49154. X.uniform3fv(i, e._array)
  49155. } else if ("v4v" === t) {
  49156. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  49157. u = 0;
  49158. var m = 0;
  49159. for (f = n.length; u < f; u++,
  49160. m += 4)
  49161. e._array[m + 0] = n[u].x,
  49162. e._array[m + 1] = n[u].y,
  49163. e._array[m + 2] = n[u].z,
  49164. e._array[m + 3] = n[u].w;
  49165. X.uniform4fv(i, e._array)
  49166. } else if ("m2" === t)
  49167. X.uniformMatrix2fv(i, !1, n.elements);
  49168. else if ("m3" === t)
  49169. X.uniformMatrix3fv(i, !1, n.elements);
  49170. else if ("m3v" === t) {
  49171. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  49172. for (u = 0,
  49173. f = n.length; u < f; u++)
  49174. n[u].flattenToArrayOffset(e._array, 9 * u);
  49175. X.uniformMatrix3fv(i, !1, e._array)
  49176. } else if ("m4" === t)
  49177. X.uniformMatrix4fv(i, !1, n.elements);
  49178. else if ("m4v" === t) {
  49179. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  49180. for (u = 0,
  49181. f = n.length; u < f; u++)
  49182. n[u].flattenToArrayOffset(e._array, 16 * u);
  49183. X.uniformMatrix4fv(i, !1, e._array)
  49184. } else if ("t" === t) {
  49185. if (r = n,
  49186. o = A(),
  49187. X.uniform1i(i, o),
  49188. !r)
  49189. return;
  49190. r instanceof Ci.CubeTexture || Array.isArray(r.image) && 6 === r.image.length ? _(r, o) : r instanceof Ci.WebGLRenderTargetCube ? b(r.texture, o) : r instanceof Ci.WebGLRenderTarget ? Z.setTexture(r.texture, o) : Z.setTexture(r, o)
  49191. } else if ("tv" === t) {
  49192. void 0 === e._array && (e._array = []);
  49193. for (u = 0,
  49194. f = e.value.length; u < f; u++)
  49195. e._array[u] = A();
  49196. X.uniform1iv(i, e._array);
  49197. for (u = 0,
  49198. f = e.value.length; u < f; u++)
  49199. r = e.value[u],
  49200. o = e._array[u],
  49201. r && (r instanceof Ci.CubeTexture || r.image instanceof Array && 6 === r.image.length ? _(r, o) : r instanceof Ci.WebGLRenderTarget ? Z.setTexture(r.texture, o) : r instanceof Ci.WebGLRenderTargetCube ? b(r.texture, o) : Z.setTexture(r, o))
  49202. } else
  49203. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  49204. }
  49205. function g(e) {
  49206. for (var t = 0, i = e.length; t < i; t++) {
  49207. var n = e[t][0];
  49208. if (!1 !== n.needsUpdate)
  49209. C(n, n.type, e[t][1], n.value)
  49210. }
  49211. }
  49212. function m(e, t, i) {
  49213. var n;
  49214. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  49215. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  49216. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  49217. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  49218. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  49219. t.wrapS === Ci.ClampToEdgeWrapping && t.wrapT === Ci.ClampToEdgeWrapping || console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.", t),
  49220. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  49221. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  49222. t.minFilter !== Ci.NearestFilter && t.minFilter !== Ci.LinearFilter && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.", t)),
  49223. n = Ie.get("EXT_texture_filter_anisotropic")) {
  49224. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  49225. return;
  49226. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  49227. return;
  49228. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  49229. be.get(t).__currentAnisotropy = t.anisotropy)
  49230. }
  49231. }
  49232. function o(e, t, i) {
  49233. void 0 === e.__webglInit && (e.__webglInit = !0,
  49234. t.addEventListener("dispose", f),
  49235. e.__webglTexture = X.createTexture(),
  49236. ye.textures++),
  49237. _e.activeTexture(X.TEXTURE0 + i),
  49238. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  49239. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  49240. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  49241. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  49242. var n = I(t.image, Ee.maxTextureSize);
  49243. !function(e) {
  49244. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  49245. }(t) || !1 !== E(n) || (n = function(e) {
  49246. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  49247. var t = document.createElement("canvas");
  49248. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  49249. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  49250. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  49251. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  49252. t
  49253. }
  49254. return e
  49255. }(n));
  49256. var r = E(n)
  49257. , o = x(t.format)
  49258. , a = x(t.type);
  49259. m(X.TEXTURE_2D, t, r);
  49260. var s, l = t.mipmaps;
  49261. if (t instanceof Ci.DataTexture)
  49262. if (0 < l.length && r) {
  49263. for (var c = 0, h = l.length; c < h; c++)
  49264. s = l[c],
  49265. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  49266. t.generateMipmaps = !1
  49267. } else
  49268. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  49269. else if (t instanceof Ci.CompressedTexture)
  49270. for (c = 0,
  49271. h = l.length; c < h; c++)
  49272. s = l[c],
  49273. t.format !== Ci.RGBAFormat && t.format !== Ci.RGBFormat ? -1 < _e.getCompressedTextureFormats().indexOf(o) ? _e.compressedTexImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, s.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  49274. else if (0 < l.length && r) {
  49275. for (c = 0,
  49276. h = l.length; c < h; c++)
  49277. s = l[c],
  49278. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  49279. t.generateMipmaps = !1
  49280. } else
  49281. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  49282. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  49283. e.__version = t.version,
  49284. t.onUpdate && t.onUpdate(t)
  49285. }
  49286. function I(e, t) {
  49287. if (e.width > t || e.height > t) {
  49288. var i = t / Math.max(e.width, e.height)
  49289. , n = document.createElement("canvas");
  49290. return n.width = Math.floor(e.width * i),
  49291. n.height = Math.floor(e.height * i),
  49292. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  49293. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  49294. n
  49295. }
  49296. return e
  49297. }
  49298. function E(e) {
  49299. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  49300. }
  49301. function _(e, t) {
  49302. var i = be.get(e);
  49303. if (6 === e.image.length)
  49304. if (0 < e.version && i.__version !== e.version) {
  49305. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  49306. i.__image__webglTextureCube = X.createTexture(),
  49307. ye.textures++),
  49308. _e.activeTexture(X.TEXTURE0 + t),
  49309. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  49310. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  49311. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  49312. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  49313. var s = E(o[0])
  49314. , l = x(e.format)
  49315. , c = x(e.type);
  49316. m(X.TEXTURE_CUBE_MAP, e, s);
  49317. for (a = 0; a < 6; a++)
  49318. if (n)
  49319. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  49320. h = u[d],
  49321. e.format !== Ci.RGBAFormat && e.format !== Ci.RGBFormat ? -1 < _e.getCompressedTextureFormats().indexOf(l) ? _e.compressedTexImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, h.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()") : _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, l, c, h.data);
  49322. else
  49323. r ? _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, l, o[a].width, o[a].height, 0, l, c, o[a].data) : _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, l, l, c, o[a]);
  49324. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49325. i.__version = e.version,
  49326. e.onUpdate && e.onUpdate(e)
  49327. } else
  49328. _e.activeTexture(X.TEXTURE0 + t),
  49329. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  49330. }
  49331. function b(e, t) {
  49332. _e.activeTexture(X.TEXTURE0 + t),
  49333. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  49334. }
  49335. function h(e, t, i, n) {
  49336. var r = x(t.texture.format)
  49337. , o = x(t.texture.type);
  49338. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  49339. X.bindFramebuffer(X.FRAMEBUFFER, e),
  49340. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  49341. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49342. }
  49343. function u(e, t) {
  49344. X.bindRenderbuffer(X.RENDERBUFFER, e),
  49345. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  49346. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_ATTACHMENT, X.RENDERBUFFER, e)) : t.depthBuffer && t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_STENCIL, t.width, t.height),
  49347. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  49348. X.bindRenderbuffer(X.RENDERBUFFER, null)
  49349. }
  49350. function w(e) {
  49351. var t = be.get(e)
  49352. , i = be.get(e.texture);
  49353. e.addEventListener("dispose", a),
  49354. i.__webglTexture = X.createTexture(),
  49355. ye.textures++;
  49356. var n = e instanceof Ci.WebGLRenderTargetCube
  49357. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  49358. if (n) {
  49359. t.__webglFramebuffer = [];
  49360. for (var o = 0; o < 6; o++)
  49361. t.__webglFramebuffer[o] = X.createFramebuffer()
  49362. } else
  49363. t.__webglFramebuffer = X.createFramebuffer();
  49364. if (n) {
  49365. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  49366. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  49367. for (o = 0; o < 6; o++)
  49368. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  49369. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49370. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  49371. } else
  49372. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  49373. m(X.TEXTURE_2D, e.texture, r),
  49374. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  49375. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  49376. _e.bindTexture(X.TEXTURE_2D, null);
  49377. e.depthBuffer && function(e) {
  49378. var t = be.get(e);
  49379. if (e instanceof Ci.WebGLRenderTargetCube) {
  49380. t.__webglDepthbuffer = [];
  49381. for (var i = 0; i < 6; i++)
  49382. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  49383. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  49384. u(t.__webglDepthbuffer[i], e)
  49385. } else
  49386. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  49387. t.__webglDepthbuffer = X.createRenderbuffer(),
  49388. u(t.__webglDepthbuffer, e);
  49389. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49390. }(e)
  49391. }
  49392. function T(e) {
  49393. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  49394. }
  49395. function x(e) {
  49396. var t;
  49397. if (e === Ci.RepeatWrapping)
  49398. return X.REPEAT;
  49399. if (e === Ci.ClampToEdgeWrapping)
  49400. return X.CLAMP_TO_EDGE;
  49401. if (e === Ci.MirroredRepeatWrapping)
  49402. return X.MIRRORED_REPEAT;
  49403. if (e === Ci.NearestFilter)
  49404. return X.NEAREST;
  49405. if (e === Ci.NearestMipMapNearestFilter)
  49406. return X.NEAREST_MIPMAP_NEAREST;
  49407. if (e === Ci.NearestMipMapLinearFilter)
  49408. return X.NEAREST_MIPMAP_LINEAR;
  49409. if (e === Ci.LinearFilter)
  49410. return X.LINEAR;
  49411. if (e === Ci.LinearMipMapNearestFilter)
  49412. return X.LINEAR_MIPMAP_NEAREST;
  49413. if (e === Ci.LinearMipMapLinearFilter)
  49414. return X.LINEAR_MIPMAP_LINEAR;
  49415. if (e === Ci.UnsignedByteType)
  49416. return X.UNSIGNED_BYTE;
  49417. if (e === Ci.UnsignedShort4444Type)
  49418. return X.UNSIGNED_SHORT_4_4_4_4;
  49419. if (e === Ci.UnsignedShort5551Type)
  49420. return X.UNSIGNED_SHORT_5_5_5_1;
  49421. if (e === Ci.UnsignedShort565Type)
  49422. return X.UNSIGNED_SHORT_5_6_5;
  49423. if (e === Ci.ByteType)
  49424. return X.BYTE;
  49425. if (e === Ci.ShortType)
  49426. return X.SHORT;
  49427. if (e === Ci.UnsignedShortType)
  49428. return X.UNSIGNED_SHORT;
  49429. if (e === Ci.IntType)
  49430. return X.INT;
  49431. if (e === Ci.UnsignedIntType)
  49432. return X.UNSIGNED_INT;
  49433. if (e === Ci.FloatType)
  49434. return X.FLOAT;
  49435. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  49436. return t.HALF_FLOAT_OES;
  49437. if (e === Ci.AlphaFormat)
  49438. return X.ALPHA;
  49439. if (e === Ci.RGBFormat)
  49440. return X.RGB;
  49441. if (e === Ci.RGBAFormat)
  49442. return X.RGBA;
  49443. if (e === Ci.LuminanceFormat)
  49444. return X.LUMINANCE;
  49445. if (e === Ci.LuminanceAlphaFormat)
  49446. return X.LUMINANCE_ALPHA;
  49447. if (e === Ci.AddEquation)
  49448. return X.FUNC_ADD;
  49449. if (e === Ci.SubtractEquation)
  49450. return X.FUNC_SUBTRACT;
  49451. if (e === Ci.ReverseSubtractEquation)
  49452. return X.FUNC_REVERSE_SUBTRACT;
  49453. if (e === Ci.ZeroFactor)
  49454. return X.ZERO;
  49455. if (e === Ci.OneFactor)
  49456. return X.ONE;
  49457. if (e === Ci.SrcColorFactor)
  49458. return X.SRC_COLOR;
  49459. if (e === Ci.OneMinusSrcColorFactor)
  49460. return X.ONE_MINUS_SRC_COLOR;
  49461. if (e === Ci.SrcAlphaFactor)
  49462. return X.SRC_ALPHA;
  49463. if (e === Ci.OneMinusSrcAlphaFactor)
  49464. return X.ONE_MINUS_SRC_ALPHA;
  49465. if (e === Ci.DstAlphaFactor)
  49466. return X.DST_ALPHA;
  49467. if (e === Ci.OneMinusDstAlphaFactor)
  49468. return X.ONE_MINUS_DST_ALPHA;
  49469. if (e === Ci.DstColorFactor)
  49470. return X.DST_COLOR;
  49471. if (e === Ci.OneMinusDstColorFactor)
  49472. return X.ONE_MINUS_DST_COLOR;
  49473. if (e === Ci.SrcAlphaSaturateFactor)
  49474. return X.SRC_ALPHA_SATURATE;
  49475. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  49476. if (e === Ci.RGB_S3TC_DXT1_Format)
  49477. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49478. if (e === Ci.RGBA_S3TC_DXT1_Format)
  49479. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49480. if (e === Ci.RGBA_S3TC_DXT3_Format)
  49481. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49482. if (e === Ci.RGBA_S3TC_DXT5_Format)
  49483. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49484. }
  49485. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  49486. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  49487. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49488. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  49489. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49490. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  49491. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49492. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  49493. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49494. }
  49495. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  49496. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49497. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  49498. if (e === Ci.MinEquation)
  49499. return t.MIN_EXT;
  49500. if (e === Ci.MaxEquation)
  49501. return t.MAX_EXT
  49502. }
  49503. return 0
  49504. }
  49505. console.log("THREE.WebGLRenderer", Ci.REVISION);
  49506. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  49507. , L = void 0 !== e.context ? e.context : null
  49508. , D = void 0 !== e.alpha && e.alpha
  49509. , N = void 0 === e.depth || e.depth
  49510. , F = void 0 === e.stencil || e.stencil
  49511. , B = void 0 !== e.antialias && e.antialias
  49512. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49513. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49514. , U = []
  49515. , H = []
  49516. , z = -1
  49517. , G = []
  49518. , W = -1
  49519. , j = new Float32Array(8)
  49520. , Y = []
  49521. , q = [];
  49522. this.domElement = O,
  49523. this.context = null,
  49524. this.autoClear = !0,
  49525. this.autoClearColor = !0,
  49526. this.autoClearDepth = !0,
  49527. this.autoClearStencil = !0,
  49528. this.sortObjects = !0,
  49529. this.gammaFactor = 2,
  49530. this.gammaInput = !1,
  49531. this.gammaOutput = !1,
  49532. this.physicallyCorrectLights = !1,
  49533. this.toneMapping = Ci.LinearToneMapping,
  49534. this.toneMappingExposure = 1,
  49535. this.toneMappingWhitePoint = 1,
  49536. this.maxMorphTargets = 8,
  49537. this.maxMorphNormals = 4,
  49538. this.autoScaleCubemaps = !0;
  49539. var X, Z = this, K = null, Q = null, J = null, $ = -1, ee = "", te = null, ie = new Ci.Vector4, ne = null, re = new Ci.Vector4, oe = 0, ae = new Ci.Color(0), se = 0, le = O.width, ce = O.height, he = 1, ue = new Ci.Vector4(0,0,le,ce), de = !1, pe = new Ci.Vector4(0,0,le,ce), fe = new Ci.Frustum, ge = new Ci.Matrix4, me = new Ci.Vector3, ve = {
  49540. hash: "",
  49541. ambient: [0, 0, 0],
  49542. directional: [],
  49543. directionalShadowMap: [],
  49544. directionalShadowMatrix: [],
  49545. spot: [],
  49546. spotShadowMap: [],
  49547. spotShadowMatrix: [],
  49548. point: [],
  49549. pointShadowMap: [],
  49550. pointShadowMatrix: [],
  49551. hemi: [],
  49552. shadows: [],
  49553. shadowsPointLight: 0
  49554. }, ye = {
  49555. geometries: 0,
  49556. textures: 0
  49557. }, Ae = {
  49558. calls: 0,
  49559. vertices: 0,
  49560. faces: 0,
  49561. points: 0
  49562. };
  49563. this.info = {
  49564. render: Ae,
  49565. memory: ye,
  49566. programs: null
  49567. };
  49568. try {
  49569. var Ce = {
  49570. alpha: D,
  49571. depth: N,
  49572. stencil: F,
  49573. antialias: B,
  49574. premultipliedAlpha: V,
  49575. preserveDrawingBuffer: k
  49576. };
  49577. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  49578. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49579. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  49580. return {
  49581. rangeMin: 1,
  49582. rangeMax: 1,
  49583. precision: 1
  49584. }
  49585. }
  49586. ),
  49587. O.addEventListener("webglcontextlost", r, !1)
  49588. } catch (e) {
  49589. console.error("THREE.WebGLRenderer: " + e)
  49590. }
  49591. var Ie = new Ci.WebGLExtensions(X);
  49592. Ie.get("OES_texture_float"),
  49593. Ie.get("OES_texture_float_linear"),
  49594. Ie.get("OES_texture_half_float"),
  49595. Ie.get("OES_texture_half_float_linear"),
  49596. Ie.get("OES_standard_derivatives"),
  49597. Ie.get("ANGLE_instanced_arrays"),
  49598. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  49599. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  49600. , _e = new Ci.WebGLState(X,Ie,x)
  49601. , be = new Ci.WebGLProperties
  49602. , we = new Ci.WebGLObjects(X,be,this.info)
  49603. , Te = new Ci.WebGLPrograms(this,Ee)
  49604. , xe = new Ci.WebGLLights;
  49605. this.info.programs = Te.programs;
  49606. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  49607. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  49608. t(),
  49609. this.context = X,
  49610. this.capabilities = Ee,
  49611. this.extensions = Ie,
  49612. this.properties = be,
  49613. this.state = _e;
  49614. var Re = new Ci.WebGLShadowMap(this,ve,we);
  49615. this.shadowMap = Re;
  49616. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  49617. this.getContext = function() {
  49618. return X
  49619. }
  49620. ,
  49621. this.getContextAttributes = function() {
  49622. return X.getContextAttributes()
  49623. }
  49624. ,
  49625. this.forceContextLoss = function() {
  49626. Ie.get("WEBGL_lose_context").loseContext()
  49627. }
  49628. ,
  49629. this.getMaxAnisotropy = function() {
  49630. if (void 0 !== Pe)
  49631. return Pe;
  49632. var e = Ie.get("EXT_texture_filter_anisotropic");
  49633. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49634. }
  49635. ,
  49636. this.getPrecision = function() {
  49637. return Ee.precision
  49638. }
  49639. ,
  49640. this.getPixelRatio = function() {
  49641. return he
  49642. }
  49643. ,
  49644. this.setPixelRatio = function(e) {
  49645. void 0 !== e && (he = e,
  49646. this.setSize(pe.z, pe.w, !1))
  49647. }
  49648. ,
  49649. this.getSize = function() {
  49650. return {
  49651. width: le,
  49652. height: ce
  49653. }
  49654. }
  49655. ,
  49656. this.setSize = function(e, t, i, n) {
  49657. null != n && (he = n),
  49658. le = e,
  49659. ce = t,
  49660. O.width = e * he,
  49661. O.height = t * he,
  49662. !1 !== i && (O.style.width = e + "px",
  49663. O.style.height = t + "px"),
  49664. this.setViewport(0, 0, e, t)
  49665. }
  49666. ,
  49667. this.setViewport = function(e, t, i, n) {
  49668. _e.viewport(pe.set(e, t, i, n))
  49669. }
  49670. ,
  49671. this.setScissor = function(e, t, i, n) {
  49672. _e.scissor(ue.set(e, t, i, n))
  49673. }
  49674. ,
  49675. this.setScissorTest = function(e) {
  49676. _e.setScissorTest(de = e)
  49677. }
  49678. ,
  49679. this.getClearColor = function() {
  49680. return ae
  49681. }
  49682. ,
  49683. this.setClearColor = function(e, t) {
  49684. ae.set(e),
  49685. se = void 0 !== t ? t : 1,
  49686. i(ae.r, ae.g, ae.b, se)
  49687. }
  49688. ,
  49689. this.getClearAlpha = function() {
  49690. return se
  49691. }
  49692. ,
  49693. this.setClearAlpha = function(e) {
  49694. se = e,
  49695. i(ae.r, ae.g, ae.b, se)
  49696. }
  49697. ,
  49698. this.clear = function(e, t, i) {
  49699. var n = 0;
  49700. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  49701. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  49702. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  49703. X.clear(n)
  49704. }
  49705. ,
  49706. this.clearColor = function() {
  49707. this.clear(!0, !1, !1)
  49708. }
  49709. ,
  49710. this.clearDepth = function() {
  49711. this.clear(!1, !0, !1)
  49712. }
  49713. ,
  49714. this.clearStencil = function() {
  49715. this.clear(!1, !1, !0)
  49716. }
  49717. ,
  49718. this.clearTarget = function(e, t, i, n) {
  49719. this.setRenderTarget(e),
  49720. this.clear(t, i, n)
  49721. }
  49722. ,
  49723. this.resetGLState = n,
  49724. this.dispose = function() {
  49725. O.removeEventListener("webglcontextlost", r, !1)
  49726. }
  49727. ,
  49728. this.renderBufferImmediate = function(e, t, i) {
  49729. _e.initAttributes();
  49730. var n = be.get(e);
  49731. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  49732. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  49733. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  49734. e.hasColors && !n.color && (n.color = X.createBuffer());
  49735. var r = t.getAttributes();
  49736. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  49737. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  49738. _e.enableAttribute(r.position),
  49739. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  49740. e.hasNormals) {
  49741. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  49742. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  49743. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  49744. var s = e.normalArray
  49745. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  49746. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  49747. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  49748. s[o + 0] = l,
  49749. s[o + 1] = c,
  49750. s[o + 2] = h,
  49751. s[o + 3] = l,
  49752. s[o + 4] = c,
  49753. s[o + 5] = h,
  49754. s[o + 6] = l,
  49755. s[o + 7] = c,
  49756. s[o + 8] = h
  49757. }
  49758. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  49759. _e.enableAttribute(r.normal),
  49760. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  49761. }
  49762. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  49763. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  49764. _e.enableAttribute(r.uv),
  49765. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  49766. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  49767. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  49768. _e.enableAttribute(r.color),
  49769. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  49770. _e.disableUnusedAttributes(),
  49771. X.drawArrays(X.TRIANGLES, 0, e.count),
  49772. e.count = 0
  49773. }
  49774. ,
  49775. this.renderBufferDirect = function(e, t, i, n, r, o) {
  49776. R(n);
  49777. var a = P(e, t, n, r)
  49778. , s = !1
  49779. , l = i.id + "_" + a.id + "_" + n.wireframe;
  49780. l !== ee && (ee = l,
  49781. s = !0);
  49782. var c = r.morphTargetInfluences;
  49783. if (void 0 !== c) {
  49784. for (var h = [], u = 0, d = c.length; u < d; u++) {
  49785. var p = c[u];
  49786. h.push([p, u])
  49787. }
  49788. h.sort(M),
  49789. 8 < h.length && (h.length = 8);
  49790. var f = i.morphAttributes;
  49791. for (u = 0,
  49792. d = h.length; u < d; u++) {
  49793. p = h[u];
  49794. if (j[u] = p[0],
  49795. 0 !== p[0]) {
  49796. var g = p[1];
  49797. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49798. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49799. } else
  49800. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49801. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49802. }
  49803. var m = a.getUniforms();
  49804. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49805. s = !0
  49806. }
  49807. g = i.index;
  49808. var v, y = i.attributes.position;
  49809. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49810. null !== g ? (v = Me).setIndex(g) : v = Se,
  49811. s && (function(e, t, i, n) {
  49812. var r;
  49813. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49814. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49815. else {
  49816. void 0 === n && (n = 0),
  49817. _e.initAttributes();
  49818. var o = i.attributes
  49819. , a = t.getAttributes()
  49820. , s = e.defaultAttributeValues;
  49821. for (var l in a) {
  49822. var c = a[l];
  49823. if (0 <= c) {
  49824. var h = o[l];
  49825. if (void 0 !== h) {
  49826. var u = h.itemSize
  49827. , d = we.getAttributeBuffer(h);
  49828. if (h instanceof Ci.InterleavedBufferAttribute) {
  49829. var p = h.data
  49830. , f = p.stride
  49831. , g = h.offset;
  49832. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49833. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49834. X.bindBuffer(X.ARRAY_BUFFER, d),
  49835. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49836. } else
  49837. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49838. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49839. X.bindBuffer(X.ARRAY_BUFFER, d),
  49840. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49841. } else if (void 0 !== s) {
  49842. var m = s[l];
  49843. if (void 0 !== m)
  49844. switch (m.length) {
  49845. case 2:
  49846. X.vertexAttrib2fv(c, m);
  49847. break;
  49848. case 3:
  49849. X.vertexAttrib3fv(c, m);
  49850. break;
  49851. case 4:
  49852. X.vertexAttrib4fv(c, m);
  49853. break;
  49854. default:
  49855. X.vertexAttrib1fv(c, m)
  49856. }
  49857. }
  49858. }
  49859. }
  49860. _e.disableUnusedAttributes()
  49861. }
  49862. }(n, a, i),
  49863. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49864. var A = 1 / 0;
  49865. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49866. var C = i.drawRange.start
  49867. , I = i.drawRange.count
  49868. , E = null !== o ? o.start : 0
  49869. , _ = null !== o ? o.count : 1 / 0
  49870. , b = Math.max(0, C, E)
  49871. , w = Math.min(0 + A, C + I, E + _) - 1
  49872. , T = Math.max(0, w - b + 1);
  49873. if (r instanceof Ci.Mesh)
  49874. if (!0 === n.wireframe)
  49875. _e.setLineWidth(n.wireframeLinewidth * S()),
  49876. v.setMode(X.LINES);
  49877. else
  49878. switch (r.drawMode) {
  49879. case Ci.TrianglesDrawMode:
  49880. v.setMode(X.TRIANGLES);
  49881. break;
  49882. case Ci.TriangleStripDrawMode:
  49883. v.setMode(X.TRIANGLE_STRIP);
  49884. break;
  49885. case Ci.TriangleFanDrawMode:
  49886. v.setMode(X.TRIANGLE_FAN)
  49887. }
  49888. else if (r instanceof Ci.Line) {
  49889. var x = n.linewidth;
  49890. void 0 === x && (x = 1),
  49891. _e.setLineWidth(x * S()),
  49892. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49893. } else
  49894. r instanceof Ci.Points && v.setMode(X.POINTS);
  49895. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49896. }
  49897. ,
  49898. this.render = function(e, t, i, n) {
  49899. if (t instanceof Ci.Camera != 0) {
  49900. var r = e.fog;
  49901. if (ee = "",
  49902. $ = -1,
  49903. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49904. null === t.parent && t.updateMatrixWorld(),
  49905. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49906. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49907. fe.setFromMatrix(ge),
  49908. U.length = 0,
  49909. W = z = -1,
  49910. Y.length = 0,
  49911. q.length = 0,
  49912. function e(t, i) {
  49913. if (!1 !== t.visible) {
  49914. if (t.layers.test(i.layers))
  49915. if (t instanceof Ci.Light)
  49916. U.push(t);
  49917. else if (t instanceof Ci.Sprite)
  49918. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49919. else if (t instanceof Ci.LensFlare)
  49920. q.push(t);
  49921. else if (t instanceof Ci.ImmediateRenderObject)
  49922. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49923. me.applyProjection(ge)),
  49924. d(t, null, t.material, me.z, null);
  49925. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49926. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49927. var n = t.material;
  49928. if (!0 === n.visible) {
  49929. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49930. me.applyProjection(ge));
  49931. var r = we.update(t);
  49932. if (n instanceof Ci.MultiMaterial)
  49933. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49934. var c = o[s]
  49935. , h = a[c.materialIndex];
  49936. !0 === h.visible && d(t, r, h, me.z, c)
  49937. }
  49938. else
  49939. d(t, r, n, me.z, null)
  49940. }
  49941. }
  49942. var u = t.children;
  49943. for (s = 0,
  49944. l = u.length; s < l; s++)
  49945. e(u[s], i)
  49946. }
  49947. }(e, t),
  49948. H.length = z + 1,
  49949. G.length = W + 1,
  49950. !0 === Z.sortObjects && (H.sort(s),
  49951. G.sort(l)),
  49952. function(e, t) {
  49953. var i, n, r, o, a, s, l = 0, c = 0, h = 0, u = t.matrixWorldInverse, d = 0, p = 0, f = 0, g = 0, m = 0;
  49954. for (i = ve.shadowsPointLight = 0,
  49955. n = e.length; i < n; i++)
  49956. if (o = (r = e[i]).color,
  49957. a = r.intensity,
  49958. s = r.distance,
  49959. r instanceof Ci.AmbientLight)
  49960. l += o.r * a,
  49961. c += o.g * a,
  49962. h += o.b * a;
  49963. else if (r instanceof Ci.DirectionalLight) {
  49964. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  49965. v.direction.setFromMatrixPosition(r.matrixWorld),
  49966. me.setFromMatrixPosition(r.target.matrixWorld),
  49967. v.direction.sub(me),
  49968. v.direction.transformDirection(u),
  49969. v.shadow = r.castShadow,
  49970. r.castShadow && (v.shadowBias = r.shadow.bias,
  49971. v.shadowRadius = r.shadow.radius,
  49972. v.shadowMapSize = r.shadow.mapSize,
  49973. ve.shadows[m++] = r),
  49974. ve.directionalShadowMap[d] = r.shadow.map,
  49975. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  49976. ve.directional[d++] = v
  49977. } else if (r instanceof Ci.SpotLight) {
  49978. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49979. v.position.applyMatrix4(u),
  49980. v.color.copy(o).multiplyScalar(a),
  49981. v.distance = s,
  49982. v.direction.setFromMatrixPosition(r.matrixWorld),
  49983. me.setFromMatrixPosition(r.target.matrixWorld),
  49984. v.direction.sub(me),
  49985. v.direction.transformDirection(u),
  49986. v.coneCos = Math.cos(r.angle),
  49987. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  49988. v.decay = 0 === r.distance ? 0 : r.decay,
  49989. v.shadow = r.castShadow,
  49990. r.castShadow && (v.shadowBias = r.shadow.bias,
  49991. v.shadowRadius = r.shadow.radius,
  49992. v.shadowMapSize = r.shadow.mapSize,
  49993. ve.shadows[m++] = r),
  49994. ve.spotShadowMap[f] = r.shadow.map,
  49995. ve.spotShadowMatrix[f] = r.shadow.matrix,
  49996. ve.spot[f++] = v
  49997. } else if (r instanceof Ci.PointLight) {
  49998. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49999. v.position.applyMatrix4(u),
  50000. v.color.copy(r.color).multiplyScalar(r.intensity),
  50001. v.distance = r.distance,
  50002. v.decay = 0 === r.distance ? 0 : r.decay,
  50003. v.shadow = r.castShadow,
  50004. r.castShadow && (v.shadowBias = r.shadow.bias,
  50005. v.shadowRadius = r.shadow.radius,
  50006. v.shadowMapSize = r.shadow.mapSize,
  50007. ve.shadows[m++] = r),
  50008. ve.pointShadowMap[p] = r.shadow.map,
  50009. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  50010. me.setFromMatrixPosition(r.matrixWorld).negate(),
  50011. ve.pointShadowMatrix[p].identity().setPosition(me),
  50012. ve.point[p++] = v
  50013. } else if (r instanceof Ci.HemisphereLight) {
  50014. var v;
  50015. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  50016. v.direction.transformDirection(u),
  50017. v.direction.normalize(),
  50018. v.skyColor.copy(r.color).multiplyScalar(a),
  50019. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  50020. ve.hemi[g++] = v
  50021. }
  50022. ve.ambient[0] = l,
  50023. ve.ambient[1] = c,
  50024. ve.ambient[2] = h,
  50025. ve.directional.length = d,
  50026. ve.spot.length = f,
  50027. ve.point.length = p,
  50028. ve.hemi.length = g,
  50029. ve.shadows.length = m,
  50030. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  50031. }(U, t),
  50032. Re.render(e, t),
  50033. Ae.calls = 0,
  50034. Ae.vertices = 0,
  50035. Ae.faces = 0,
  50036. void (Ae.points = 0) === i && (i = null),
  50037. this.setRenderTarget(i),
  50038. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  50039. e.overrideMaterial) {
  50040. var o = e.overrideMaterial;
  50041. c(H, t, r, o),
  50042. c(G, t, r, o)
  50043. } else
  50044. _e.setBlending(Ci.NoBlending),
  50045. c(H, t, r),
  50046. c(G, t, r);
  50047. if (Oe.render(e, t),
  50048. Le.render(e, t, re),
  50049. i) {
  50050. var a = i.texture;
  50051. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  50052. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  50053. , i = be.get(e.texture).__webglTexture;
  50054. _e.bindTexture(t, i),
  50055. X.generateMipmap(t),
  50056. _e.bindTexture(t, null)
  50057. }(i)
  50058. }
  50059. _e.setDepthTest(!0),
  50060. _e.setDepthWrite(!0),
  50061. _e.setColorWrite(!0)
  50062. } else
  50063. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  50064. }
  50065. ,
  50066. this.setFaceCulling = function(e, t) {
  50067. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  50068. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  50069. _e.enable(X.CULL_FACE))
  50070. }
  50071. ,
  50072. this.setTexture = function(e, t) {
  50073. var i = be.get(e);
  50074. if (0 < e.version && i.__version !== e.version) {
  50075. var n = e.image;
  50076. return void 0 === n ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined", e) : !1 === n.complete ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", e) : void o(i, e, t)
  50077. }
  50078. _e.activeTexture(X.TEXTURE0 + t),
  50079. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  50080. }
  50081. ,
  50082. this.getCurrentRenderTarget = function() {
  50083. return Q
  50084. }
  50085. ,
  50086. this.setRenderTarget = function(e) {
  50087. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  50088. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  50089. if (e) {
  50090. var n = be.get(e);
  50091. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  50092. ie.copy(e.scissor),
  50093. ne = e.scissorTest,
  50094. re.copy(e.viewport)
  50095. } else
  50096. t = null,
  50097. ie.copy(ue).multiplyScalar(he),
  50098. ne = de,
  50099. re.copy(pe).multiplyScalar(he);
  50100. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  50101. J = t),
  50102. _e.scissor(ie),
  50103. _e.setScissorTest(ne),
  50104. _e.viewport(re),
  50105. i) {
  50106. var r = be.get(e.texture);
  50107. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  50108. }
  50109. }
  50110. ,
  50111. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  50112. if (e instanceof Ci.WebGLRenderTarget != 0) {
  50113. var a = be.get(e).__webglFramebuffer;
  50114. if (a) {
  50115. var s = !1;
  50116. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  50117. s = !0);
  50118. try {
  50119. var l = e.texture;
  50120. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  50121. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  50122. if (!(l.type === Ci.UnsignedByteType || x(l.type) === X.getParameter(X.IMPLEMENTATION_COLOR_READ_TYPE) || l.type === Ci.FloatType && Ie.get("WEBGL_color_buffer_float") || l.type === Ci.HalfFloatType && Ie.get("EXT_color_buffer_half_float")))
  50123. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  50124. X.checkFramebufferStatus(X.FRAMEBUFFER) === X.FRAMEBUFFER_COMPLETE ? X.readPixels(t, i, n, r, x(l.format), x(l.type), o) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")
  50125. } finally {
  50126. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  50127. }
  50128. }
  50129. } else
  50130. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  50131. }
  50132. }
  50133. ,
  50134. Ci.WebGLRenderTarget = function(e, t, i) {
  50135. this.uuid = Ci.Math.generateUUID(),
  50136. this.width = e,
  50137. this.height = t,
  50138. this.scissor = new Ci.Vector4(0,0,e,t),
  50139. this.scissorTest = !1,
  50140. this.viewport = new Ci.Vector4(0,0,e,t),
  50141. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  50142. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  50143. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  50144. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  50145. }
  50146. ,
  50147. Ci.WebGLRenderTarget.prototype = {
  50148. constructor: Ci.WebGLRenderTarget,
  50149. setSize: function(e, t) {
  50150. this.width === e && this.height === t || (this.width = e,
  50151. this.height = t,
  50152. this.dispose()),
  50153. this.viewport.set(0, 0, e, t),
  50154. this.scissor.set(0, 0, e, t)
  50155. },
  50156. clone: function() {
  50157. return (new this.constructor).copy(this)
  50158. },
  50159. copy: function(e) {
  50160. return this.width = e.width,
  50161. this.height = e.height,
  50162. this.viewport.copy(e.viewport),
  50163. this.texture = e.texture.clone(),
  50164. this.depthBuffer = e.depthBuffer,
  50165. this.stencilBuffer = e.stencilBuffer,
  50166. this
  50167. },
  50168. dispose: function() {
  50169. this.dispatchEvent({
  50170. type: "dispose"
  50171. })
  50172. }
  50173. },
  50174. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  50175. Ci.WebGLRenderTargetCube = function(e, t, i) {
  50176. Ci.WebGLRenderTarget.call(this, e, t, i),
  50177. this.activeCubeFace = 0,
  50178. this.activeMipMapLevel = 0
  50179. }
  50180. ,
  50181. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  50182. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  50183. Ci.WebGLBufferRenderer = function(r, o, a) {
  50184. var s;
  50185. this.setMode = function(e) {
  50186. s = e
  50187. }
  50188. ,
  50189. this.render = function(e, t) {
  50190. r.drawArrays(s, e, t),
  50191. a.calls++,
  50192. a.vertices += t,
  50193. s === r.TRIANGLES && (a.faces += t / 3)
  50194. }
  50195. ,
  50196. this.renderInstances = function(e) {
  50197. var t = o.get("ANGLE_instanced_arrays");
  50198. if (null !== t) {
  50199. var i = e.attributes.position
  50200. , n = 0;
  50201. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  50202. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  50203. a.calls++,
  50204. a.vertices += n * e.maxInstancedCount,
  50205. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  50206. } else
  50207. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  50208. }
  50209. }
  50210. ,
  50211. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  50212. var s, l, c;
  50213. this.setMode = function(e) {
  50214. s = e
  50215. }
  50216. ,
  50217. this.setIndex = function(e) {
  50218. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  50219. 4) : (l = r.UNSIGNED_SHORT,
  50220. 2)
  50221. }
  50222. ,
  50223. this.render = function(e, t) {
  50224. r.drawElements(s, t, l, e * c),
  50225. a.calls++,
  50226. a.vertices += t,
  50227. s === r.TRIANGLES && (a.faces += t / 3)
  50228. }
  50229. ,
  50230. this.renderInstances = function(e, t, i) {
  50231. var n = o.get("ANGLE_instanced_arrays");
  50232. return null === n ? void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.") : (n.drawElementsInstancedANGLE(s, i, l, t * c, e.maxInstancedCount),
  50233. a.calls++,
  50234. a.vertices += i * e.maxInstancedCount,
  50235. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  50236. }
  50237. }
  50238. ,
  50239. Ci.WebGLExtensions = function(i) {
  50240. var n = {};
  50241. this.get = function(e) {
  50242. if (void 0 !== n[e])
  50243. return n[e];
  50244. var t;
  50245. switch (e) {
  50246. case "EXT_texture_filter_anisotropic":
  50247. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  50248. break;
  50249. case "WEBGL_compressed_texture_s3tc":
  50250. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  50251. break;
  50252. case "WEBGL_compressed_texture_pvrtc":
  50253. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  50254. break;
  50255. case "WEBGL_compressed_texture_etc1":
  50256. t = i.getExtension("WEBGL_compressed_texture_etc1");
  50257. break;
  50258. default:
  50259. t = i.getExtension(e)
  50260. }
  50261. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  50262. n[e] = t
  50263. }
  50264. }
  50265. ,
  50266. Ci.WebGLCapabilities = function(t, e, i) {
  50267. function n(e) {
  50268. if ("highp" === e) {
  50269. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  50270. return "highp";
  50271. e = "mediump"
  50272. }
  50273. return "mediump" === e && 0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.MEDIUM_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.MEDIUM_FLOAT).precision ? "mediump" : "lowp"
  50274. }
  50275. this.getMaxPrecision = n,
  50276. this.precision = void 0 !== i.precision ? i.precision : "highp",
  50277. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  50278. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  50279. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  50280. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  50281. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  50282. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  50283. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  50284. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  50285. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  50286. this.vertexTextures = 0 < this.maxVertexTextures,
  50287. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  50288. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  50289. var r = n(this.precision);
  50290. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  50291. this.precision = r),
  50292. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  50293. }
  50294. ,
  50295. Ci.WebGLGeometries = function(i, o, a) {
  50296. function s(e) {
  50297. var t = e.target
  50298. , i = c[t.id];
  50299. null !== i.index && l(i.index),
  50300. function(e) {
  50301. for (var t in e)
  50302. l(e[t])
  50303. }(i.attributes),
  50304. t.removeEventListener("dispose", s),
  50305. delete c[t.id];
  50306. var n = o.get(t);
  50307. n.wireframe && l(n.wireframe),
  50308. o.delete(t);
  50309. var r = o.get(i);
  50310. r.wireframe && l(r.wireframe),
  50311. o.delete(i),
  50312. a.memory.geometries--
  50313. }
  50314. function l(e) {
  50315. var t = function(e) {
  50316. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  50317. }(e);
  50318. void 0 !== t && (i.deleteBuffer(t),
  50319. function(e) {
  50320. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  50321. }(e))
  50322. }
  50323. var c = {};
  50324. this.get = function(e) {
  50325. var t, i = e.geometry;
  50326. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  50327. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  50328. t = i._bufferGeometry),
  50329. c[i.id] = t,
  50330. a.memory.geometries++,
  50331. t)
  50332. }
  50333. }
  50334. ,
  50335. Ci.WebGLLights = function() {
  50336. var i = {};
  50337. this.get = function(e) {
  50338. if (void 0 !== i[e.id])
  50339. return i[e.id];
  50340. var t;
  50341. switch (e.type) {
  50342. case "DirectionalLight":
  50343. t = {
  50344. direction: new Ci.Vector3,
  50345. color: new Ci.Color,
  50346. shadow: !1,
  50347. shadowBias: 0,
  50348. shadowRadius: 1,
  50349. shadowMapSize: new Ci.Vector2
  50350. };
  50351. break;
  50352. case "SpotLight":
  50353. t = {
  50354. position: new Ci.Vector3,
  50355. direction: new Ci.Vector3,
  50356. color: new Ci.Color,
  50357. distance: 0,
  50358. coneCos: 0,
  50359. penumbraCos: 0,
  50360. decay: 0,
  50361. shadow: !1,
  50362. shadowBias: 0,
  50363. shadowRadius: 1,
  50364. shadowMapSize: new Ci.Vector2
  50365. };
  50366. break;
  50367. case "PointLight":
  50368. t = {
  50369. position: new Ci.Vector3,
  50370. color: new Ci.Color,
  50371. distance: 0,
  50372. decay: 0,
  50373. shadow: !1,
  50374. shadowBias: 0,
  50375. shadowRadius: 1,
  50376. shadowMapSize: new Ci.Vector2
  50377. };
  50378. break;
  50379. case "HemisphereLight":
  50380. t = {
  50381. direction: new Ci.Vector3,
  50382. skyColor: new Ci.Color,
  50383. groundColor: new Ci.Color
  50384. }
  50385. }
  50386. return i[e.id] = t
  50387. }
  50388. }
  50389. ,
  50390. Ci.WebGLObjects = function(g, m, e) {
  50391. function v(e, t) {
  50392. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  50393. , n = m.get(i);
  50394. void 0 === n.__webglBuffer ? function(e, t, i) {
  50395. e.__webglBuffer = g.createBuffer(),
  50396. g.bindBuffer(i, e.__webglBuffer);
  50397. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  50398. g.bufferData(i, t.array, n),
  50399. e.version = t.version
  50400. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  50401. g.bindBuffer(i, e.__webglBuffer),
  50402. !1 === t.dynamic || -1 === t.updateRange.count ? g.bufferSubData(i, 0, t.array) : 0 === t.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.") : (g.bufferSubData(i, t.updateRange.offset * t.array.BYTES_PER_ELEMENT, t.array.subarray(t.updateRange.offset, t.updateRange.offset + t.updateRange.count)),
  50403. t.updateRange.count = 0),
  50404. e.version = t.version
  50405. }(n, i, t)
  50406. }
  50407. function y(e, t, i) {
  50408. if (i < t) {
  50409. var n = t;
  50410. t = i,
  50411. i = n
  50412. }
  50413. var r = e[t];
  50414. return void 0 === r ? (e[t] = [i],
  50415. !0) : -1 === r.indexOf(i) && (r.push(i),
  50416. !0)
  50417. }
  50418. var c = new Ci.WebGLGeometries(g,m,e);
  50419. this.getAttributeBuffer = function(e) {
  50420. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  50421. }
  50422. ,
  50423. this.getWireframeAttribute = function(e) {
  50424. var t = m.get(e);
  50425. if (void 0 !== t.wireframe)
  50426. return t.wireframe;
  50427. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  50428. if (null !== r)
  50429. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  50430. var h = i[l + 0]
  50431. , u = i[l + 1]
  50432. , d = i[l + 2];
  50433. y(s, h, u) && n.push(h, u),
  50434. y(s, u, d) && n.push(u, d),
  50435. y(s, d, h) && n.push(d, h)
  50436. }
  50437. else
  50438. for (l = 0,
  50439. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  50440. h = l + 0,
  50441. u = l + 1,
  50442. d = l + 2;
  50443. n.push(h, u, u, d, d, h)
  50444. }
  50445. var p = 65535 < a.count ? Uint32Array : Uint16Array
  50446. , f = new Ci.BufferAttribute(new p(n),1);
  50447. return v(f, g.ELEMENT_ARRAY_BUFFER),
  50448. t.wireframe = f
  50449. }
  50450. ,
  50451. this.update = function(e) {
  50452. var t = c.get(e);
  50453. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  50454. var i = t.index
  50455. , n = t.attributes;
  50456. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  50457. n)
  50458. v(n[r], g.ARRAY_BUFFER);
  50459. var o = t.morphAttributes;
  50460. for (var r in o)
  50461. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  50462. v(a[s], g.ARRAY_BUFFER);
  50463. return t
  50464. }
  50465. }
  50466. ,
  50467. Ci.WebGLProgram = (Qt = 0,
  50468. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  50469. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  50470. ei = /^([\w\d_]+)\[0\]$/,
  50471. function(e, t, i, n) {
  50472. var r = e.context
  50473. , o = i.extensions
  50474. , a = i.defines
  50475. , s = i.__webglShader.vertexShader
  50476. , l = i.__webglShader.fragmentShader
  50477. , c = "SHADOWMAP_TYPE_BASIC";
  50478. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  50479. var h = "ENVMAP_TYPE_CUBE"
  50480. , u = "ENVMAP_MODE_REFLECTION"
  50481. , d = "ENVMAP_BLENDING_MULTIPLY";
  50482. if (n.envMap) {
  50483. switch (i.envMap.mapping) {
  50484. case Ci.CubeReflectionMapping:
  50485. case Ci.CubeRefractionMapping:
  50486. h = "ENVMAP_TYPE_CUBE";
  50487. break;
  50488. case Ci.CubeUVReflectionMapping:
  50489. case Ci.CubeUVRefractionMapping:
  50490. h = "ENVMAP_TYPE_CUBE_UV";
  50491. break;
  50492. case Ci.EquirectangularReflectionMapping:
  50493. case Ci.EquirectangularRefractionMapping:
  50494. h = "ENVMAP_TYPE_EQUIREC";
  50495. break;
  50496. case Ci.SphericalReflectionMapping:
  50497. h = "ENVMAP_TYPE_SPHERE"
  50498. }
  50499. switch (i.envMap.mapping) {
  50500. case Ci.CubeRefractionMapping:
  50501. case Ci.EquirectangularRefractionMapping:
  50502. u = "ENVMAP_MODE_REFRACTION"
  50503. }
  50504. switch (i.combine) {
  50505. case Ci.MultiplyOperation:
  50506. d = "ENVMAP_BLENDING_MULTIPLY";
  50507. break;
  50508. case Ci.MixOperation:
  50509. d = "ENVMAP_BLENDING_MIX";
  50510. break;
  50511. case Ci.AddOperation:
  50512. d = "ENVMAP_BLENDING_ADD"
  50513. }
  50514. }
  50515. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  50516. return [(e = 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" : ""].filter(Pi).join("\n")
  50517. }(o, n, e.extensions), v = function(e) {
  50518. var t = [];
  50519. for (var i in e) {
  50520. var n = e[i];
  50521. !1 !== n && t.push("#define " + i + " " + n)
  50522. }
  50523. return t.join("\n")
  50524. }(a), y = r.createProgram();
  50525. f = i instanceof Ci.RawShaderMaterial ? p = "" : (p = ["precision " + n.precision + " float;", "precision " + n.precision + " int;", "#define SHADER_NAME " + i.__webglShader.name, v, n.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + g, "#define MAX_BONES " + n.maxBones, n.map ? "#define USE_MAP" : "", n.envMap ? "#define USE_ENVMAP" : "", n.envMap ? "#define " + u : "", n.lightMap ? "#define USE_LIGHTMAP" : "", n.aoMap ? "#define USE_AOMAP" : "", n.emissiveMap ? "#define USE_EMISSIVEMAP" : "", n.bumpMap ? "#define USE_BUMPMAP" : "", n.normalMap ? "#define USE_NORMALMAP" : "", n.displacementMap && n.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", n.specularMap ? "#define USE_SPECULARMAP" : "", n.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", n.metalnessMap ? "#define USE_METALNESSMAP" : "", n.alphaMap ? "#define USE_ALPHAMAP" : "", n.vertexColors ? "#define USE_COLOR" : "", n.flatShading ? "#define FLAT_SHADED" : "", n.skinning ? "#define USE_SKINNING" : "", n.useVertexTexture ? "#define BONE_TEXTURE" : "", n.morphTargets ? "#define USE_MORPHTARGETS" : "", n.morphNormals && !1 === n.flatShading ? "#define USE_MORPHNORMALS" : "", n.doubleSided ? "#define DOUBLE_SIDED" : "", n.flipSided ? "#define FLIP_SIDED" : "", n.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", n.shadowMapEnabled ? "#define " + c : "", 0 < n.pointLightShadows ? "#define POINT_LIGHT_SHADOWS" : "", n.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", n.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", n.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(Pi).join("\n"),
  50526. [m, "precision " + n.precision + " float;", "precision " + n.precision + " int;", "#define SHADER_NAME " + i.__webglShader.name, v, n.alphaTest ? "#define ALPHATEST " + n.alphaTest : "", "#define GAMMA_FACTOR " + g, n.useFog && n.fog ? "#define USE_FOG" : "", n.useFog && n.fogExp ? "#define FOG_EXP2" : "", n.map ? "#define USE_MAP" : "", n.envMap ? "#define USE_ENVMAP" : "", n.envMap ? "#define " + h : "", n.envMap ? "#define " + u : "", n.envMap ? "#define " + d : "", n.lightMap ? "#define USE_LIGHTMAP" : "", n.aoMap ? "#define USE_AOMAP" : "", n.emissiveMap ? "#define USE_EMISSIVEMAP" : "", n.bumpMap ? "#define USE_BUMPMAP" : "", n.normalMap ? "#define USE_NORMALMAP" : "", n.specularMap ? "#define USE_SPECULARMAP" : "", n.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", n.metalnessMap ? "#define USE_METALNESSMAP" : "", n.alphaMap ? "#define USE_ALPHAMAP" : "", n.vertexColors ? "#define USE_COLOR" : "", n.flatShading ? "#define FLAT_SHADED" : "", n.doubleSided ? "#define DOUBLE_SIDED" : "", n.flipSided ? "#define FLIP_SIDED" : "", n.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", n.shadowMapEnabled ? "#define " + c : "", 0 < n.pointLightShadows ? "#define POINT_LIGHT_SHADOWS" : "", n.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", n.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", n.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", n.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", n.envMap && e.extensions.get("EXT_shader_texture_lod") ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", n.toneMapping !== Ci.NoToneMapping ? "#define TONE_MAPPING" : "", n.toneMapping !== Ci.NoToneMapping ? Ci.ShaderChunk.tonemapping_pars_fragment : "", n.toneMapping !== Ci.NoToneMapping ? function(e, t) {
  50527. var i;
  50528. switch (t) {
  50529. case Ci.LinearToneMapping:
  50530. i = "Linear";
  50531. break;
  50532. case Ci.ReinhardToneMapping:
  50533. i = "Reinhard";
  50534. break;
  50535. case Ci.Uncharted2ToneMapping:
  50536. i = "Uncharted2";
  50537. break;
  50538. case Ci.CineonToneMapping:
  50539. i = "OptimizedCineon";
  50540. break;
  50541. default:
  50542. throw new Error("unsupported toneMapping: " + t)
  50543. }
  50544. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50545. }("toneMapping", n.toneMapping) : "", n.outputEncoding || n.mapEncoding || n.envMapEncoding || n.emissiveMapEncoding ? Ci.ShaderChunk.encodings_pars_fragment : "", n.mapEncoding ? Ri("mapTexelToLinear", n.mapEncoding) : "", n.envMapEncoding ? Ri("envMapTexelToLinear", n.envMapEncoding) : "", n.emissiveMapEncoding ? Ri("emissiveMapTexelToLinear", n.emissiveMapEncoding) : "", n.outputEncoding ? function(e, t) {
  50546. var i = Mi(t);
  50547. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  50548. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  50549. s = Oi(s = Li(s), n),
  50550. l = Oi(l = Li(l), n),
  50551. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  50552. l = Di(l));
  50553. var A = p + s
  50554. , C = f + l
  50555. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  50556. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  50557. r.attachShader(y, I),
  50558. r.attachShader(y, E),
  50559. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  50560. r.linkProgram(y);
  50561. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  50562. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  50563. console.error("THREE.WebGLProgram: shader error: ", r.getError(), "gl.VALIDATE_STATUS", r.getProgramParameter(y, r.VALIDATE_STATUS), "gl.getProgramInfoLog", w, T, x)) : "" !== w ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", w) : "" !== T && "" !== x || (M = !1),
  50564. M && (this.diagnostics = {
  50565. runnable: S,
  50566. material: i,
  50567. programLog: w,
  50568. vertexShader: {
  50569. log: T,
  50570. prefix: p
  50571. },
  50572. fragmentShader: {
  50573. log: x,
  50574. prefix: f
  50575. }
  50576. }),
  50577. r.deleteShader(I),
  50578. r.deleteShader(E),
  50579. this.getUniforms = function() {
  50580. return void 0 === _ && (_ = function(e, t) {
  50581. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  50582. var o = e.getActiveUniform(t, r).name
  50583. , a = e.getUniformLocation(t, o)
  50584. , s = Jt.exec(o);
  50585. if (s) {
  50586. var l = s[1]
  50587. , c = s[2]
  50588. , h = i[l];
  50589. (h = h || (i[l] = {}))[c] = a
  50590. } else if (s = $t.exec(o)) {
  50591. var u = s[1]
  50592. , d = s[2]
  50593. , p = s[3]
  50594. , f = i[u]
  50595. , g = (f = f || (i[u] = []))[d];
  50596. (g = g || (f[d] = {}))[p] = a
  50597. } else
  50598. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  50599. }
  50600. return i
  50601. }(r, y)),
  50602. _
  50603. }
  50604. ,
  50605. this.getAttributes = function() {
  50606. return void 0 === b && (b = function(e, t) {
  50607. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  50608. var o = e.getActiveAttrib(t, r).name;
  50609. i[o] = e.getAttribLocation(t, o)
  50610. }
  50611. return i
  50612. }(r, y)),
  50613. b
  50614. }
  50615. ,
  50616. this.destroy = function() {
  50617. r.deleteProgram(y),
  50618. this.program = void 0
  50619. }
  50620. ,
  50621. Object.defineProperties(this, {
  50622. uniforms: {
  50623. get: function() {
  50624. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50625. this.getUniforms()
  50626. }
  50627. },
  50628. attributes: {
  50629. get: function() {
  50630. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50631. this.getAttributes()
  50632. }
  50633. }
  50634. }),
  50635. this.id = Qt++,
  50636. this.code = t,
  50637. this.usedTimes = 1,
  50638. this.program = y,
  50639. this.vertexShader = I,
  50640. this.fragmentShader = E,
  50641. this
  50642. }
  50643. ),
  50644. Ci.WebGLPrograms = function(s, l) {
  50645. function c(e, t) {
  50646. var i;
  50647. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  50648. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  50649. i
  50650. }
  50651. var h = []
  50652. , u = {
  50653. MeshDepthMaterial: "depth",
  50654. MeshNormalMaterial: "normal",
  50655. MeshBasicMaterial: "basic",
  50656. MeshLambertMaterial: "lambert",
  50657. MeshPhongMaterial: "phong",
  50658. MeshStandardMaterial: "standard",
  50659. LineBasicMaterial: "basic",
  50660. LineDashedMaterial: "dashed",
  50661. PointsMaterial: "points"
  50662. }
  50663. , a = ["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"];
  50664. this.getParameters = function(e, t, i, n) {
  50665. var r = u[e.type]
  50666. , o = function(e) {
  50667. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50668. return 1024;
  50669. var t = l.maxVertexUniforms
  50670. , i = Math.floor((t - 20) / 4);
  50671. return void 0 !== e && e instanceof Ci.SkinnedMesh && ((i = Math.min(e.skeleton.bones.length, i)) < e.skeleton.bones.length && console.warn("WebGLRenderer: too many bones - " + e.skeleton.bones.length + ", this GPU supports just " + i + " (try OpenGL instead of ANGLE)")),
  50672. i
  50673. }(n)
  50674. , a = s.getPrecision();
  50675. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  50676. {
  50677. shaderID: r,
  50678. precision: a,
  50679. supportsVertexTextures: l.vertexTextures,
  50680. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  50681. map: !!e.map,
  50682. mapEncoding: c(e.map, s.gammaInput),
  50683. envMap: !!e.envMap,
  50684. envMapMode: e.envMap && e.envMap.mapping,
  50685. envMapEncoding: c(e.envMap, s.gammaInput),
  50686. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  50687. lightMap: !!e.lightMap,
  50688. aoMap: !!e.aoMap,
  50689. emissiveMap: !!e.emissiveMap,
  50690. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  50691. bumpMap: !!e.bumpMap,
  50692. normalMap: !!e.normalMap,
  50693. displacementMap: !!e.displacementMap,
  50694. roughnessMap: !!e.roughnessMap,
  50695. metalnessMap: !!e.metalnessMap,
  50696. specularMap: !!e.specularMap,
  50697. alphaMap: !!e.alphaMap,
  50698. combine: e.combine,
  50699. vertexColors: e.vertexColors,
  50700. fog: i,
  50701. useFog: e.fog,
  50702. fogExp: i instanceof Ci.FogExp2,
  50703. flatShading: e.shading === Ci.FlatShading,
  50704. sizeAttenuation: e.sizeAttenuation,
  50705. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  50706. skinning: e.skinning,
  50707. maxBones: o,
  50708. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  50709. morphTargets: e.morphTargets,
  50710. morphNormals: e.morphNormals,
  50711. maxMorphTargets: s.maxMorphTargets,
  50712. maxMorphNormals: s.maxMorphNormals,
  50713. numDirLights: t.directional.length,
  50714. numPointLights: t.point.length,
  50715. numSpotLights: t.spot.length,
  50716. numHemiLights: t.hemi.length,
  50717. pointLightShadows: t.shadowsPointLight,
  50718. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  50719. shadowMapType: s.shadowMap.type,
  50720. toneMapping: s.toneMapping,
  50721. physicallyCorrectLights: s.physicallyCorrectLights,
  50722. premultipliedAlpha: e.premultipliedAlpha,
  50723. alphaTest: e.alphaTest,
  50724. doubleSided: e.side === Ci.DoubleSide,
  50725. flipSided: e.side === Ci.BackSide
  50726. }
  50727. }
  50728. ,
  50729. this.getProgramCode = function(e, t) {
  50730. var i = [];
  50731. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50732. i.push(e.vertexShader)),
  50733. void 0 !== e.defines)
  50734. for (var n in e.defines)
  50735. i.push(n),
  50736. i.push(e.defines[n]);
  50737. for (var r = 0; r < a.length; r++) {
  50738. var o = a[r];
  50739. i.push(o),
  50740. i.push(t[o])
  50741. }
  50742. return i.join()
  50743. }
  50744. ,
  50745. this.acquireProgram = function(e, t, i) {
  50746. for (var n, r = 0, o = h.length; r < o; r++) {
  50747. var a = h[r];
  50748. if (a.code === i) {
  50749. ++(n = a).usedTimes;
  50750. break
  50751. }
  50752. }
  50753. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  50754. h.push(n)),
  50755. n
  50756. }
  50757. ,
  50758. this.releaseProgram = function(e) {
  50759. if (0 == --e.usedTimes) {
  50760. var t = h.indexOf(e);
  50761. h[t] = h[h.length - 1],
  50762. h.pop(),
  50763. e.destroy()
  50764. }
  50765. }
  50766. ,
  50767. this.programs = h
  50768. }
  50769. ,
  50770. Ci.WebGLProperties = function() {
  50771. var n = {};
  50772. this.get = function(e) {
  50773. var t = e.uuid
  50774. , i = n[t];
  50775. return void 0 === i && (i = {},
  50776. n[t] = i),
  50777. i
  50778. }
  50779. ,
  50780. this.delete = function(e) {
  50781. delete n[e.uuid]
  50782. }
  50783. ,
  50784. this.clear = function() {
  50785. n = {}
  50786. }
  50787. }
  50788. ,
  50789. Ci.WebGLShader = function(e, t, i) {
  50790. var n = e.createShader(t);
  50791. return e.shaderSource(n, i),
  50792. e.compileShader(n),
  50793. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50794. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50795. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50796. t[i] = i + 1 + ": " + t[i];
  50797. return t.join("\n")
  50798. }(i)),
  50799. n
  50800. }
  50801. ,
  50802. Ci.WebGLShadowMap = function(P, O, L) {
  50803. function D(e, t, i, n) {
  50804. var r = e.geometry
  50805. , o = null
  50806. , a = p
  50807. , s = e.customDepthMaterial;
  50808. if (i && (a = f,
  50809. s = e.customDistanceMaterial),
  50810. s)
  50811. o = s;
  50812. else {
  50813. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50814. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50815. , h = 0;
  50816. l && (h |= u),
  50817. c && (h |= d),
  50818. o = a[h]
  50819. }
  50820. return o.visible = t.visible,
  50821. o.wireframe = t.wireframe,
  50822. o.wireframeLinewidth = t.wireframeLinewidth,
  50823. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50824. o
  50825. }
  50826. function N(e, t, i) {
  50827. if (!1 !== e.visible) {
  50828. if (e.layers.test(t.layers) && (e instanceof Ci.Mesh || e instanceof Ci.Line || e instanceof Ci.Points) && e.castShadow && (!1 === e.frustumCulled || !0 === V.intersectsObject(e)))
  50829. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50830. G.push(e));
  50831. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50832. N(n[r], t, i)
  50833. }
  50834. }
  50835. for (var F = P.context, B = P.state, V = new Ci.Frustum, k = new Ci.Matrix4, U = new Ci.Vector2, H = new Ci.Vector3, z = new Ci.Vector3, G = [], u = 1, d = 2, e = 1 + (u | d), p = new Array(e), f = new Array(e), W = [new Ci.Vector3(1,0,0), new Ci.Vector3(-1,0,0), new Ci.Vector3(0,0,1), new Ci.Vector3(0,0,-1), new Ci.Vector3(0,1,0), new Ci.Vector3(0,-1,0)], j = [new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,0,1), new Ci.Vector3(0,0,-1)], Y = [new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4], t = Ci.ShaderLib.depthRGBA, i = Ci.UniformsUtils.clone(t.uniforms), n = Ci.ShaderLib.distanceRGBA, r = Ci.UniformsUtils.clone(n.uniforms), o = 0; o !== e; ++o) {
  50836. var a = 0 != (o & u)
  50837. , s = 0 != (o & d)
  50838. , l = new Ci.ShaderMaterial({
  50839. uniforms: i,
  50840. vertexShader: t.vertexShader,
  50841. fragmentShader: t.fragmentShader,
  50842. morphTargets: a,
  50843. skinning: s
  50844. });
  50845. p[o] = l;
  50846. var c = new Ci.ShaderMaterial({
  50847. defines: {
  50848. USE_SHADOWMAP: ""
  50849. },
  50850. uniforms: r,
  50851. vertexShader: n.vertexShader,
  50852. fragmentShader: n.fragmentShader,
  50853. morphTargets: a,
  50854. skinning: s
  50855. });
  50856. f[o] = c
  50857. }
  50858. var q = this;
  50859. this.enabled = !1,
  50860. this.autoUpdate = !0,
  50861. this.needsUpdate = !1,
  50862. this.type = Ci.PCFShadowMap,
  50863. this.cullFace = Ci.CullFaceFront,
  50864. this.render = function(e, t) {
  50865. var i, n, r = O.shadows;
  50866. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50867. B.clearColor(1, 1, 1, 1),
  50868. B.disable(F.BLEND),
  50869. B.enable(F.CULL_FACE),
  50870. F.frontFace(F.CCW),
  50871. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50872. B.setDepthTest(!0),
  50873. B.setScissorTest(!1);
  50874. for (var o = 0, a = r.length; o < a; o++) {
  50875. var s = r[o]
  50876. , l = s.shadow
  50877. , c = l.camera;
  50878. if (U.copy(l.mapSize),
  50879. s instanceof Ci.PointLight) {
  50880. i = 6,
  50881. n = !0;
  50882. var h = U.x
  50883. , u = U.y;
  50884. Y[0].set(2 * h, u, h, u),
  50885. Y[1].set(0, u, h, u),
  50886. Y[2].set(3 * h, u, h, u),
  50887. Y[3].set(h, u, h, u),
  50888. Y[4].set(3 * h, 0, h, u),
  50889. Y[5].set(h, 0, h, u),
  50890. U.x *= 4,
  50891. U.y *= 2
  50892. } else
  50893. n = !(i = 1);
  50894. if (null === l.map) {
  50895. var d = {
  50896. minFilter: Ci.NearestFilter,
  50897. magFilter: Ci.NearestFilter,
  50898. format: Ci.RGBAFormat
  50899. };
  50900. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50901. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50902. c.updateProjectionMatrix()
  50903. }
  50904. var p = l.map
  50905. , f = l.matrix;
  50906. z.setFromMatrixPosition(s.matrixWorld),
  50907. c.position.copy(z),
  50908. P.setRenderTarget(p),
  50909. P.clear();
  50910. for (var g = 0; g < i; g++) {
  50911. if (n) {
  50912. H.copy(c.position),
  50913. H.add(W[g]),
  50914. c.up.copy(j[g]),
  50915. c.lookAt(H);
  50916. var m = Y[g];
  50917. B.viewport(m)
  50918. } else
  50919. H.setFromMatrixPosition(s.target.matrixWorld),
  50920. c.lookAt(H);
  50921. c.updateMatrixWorld(),
  50922. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50923. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50924. f.multiply(c.projectionMatrix),
  50925. f.multiply(c.matrixWorldInverse),
  50926. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50927. V.setFromMatrix(k),
  50928. G.length = 0,
  50929. N(e, t, c);
  50930. for (var v = 0, y = G.length; v < y; v++) {
  50931. var A = G[v]
  50932. , C = L.update(A)
  50933. , I = A.material;
  50934. if (I instanceof Ci.MultiMaterial)
  50935. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  50936. var T = E[b]
  50937. , x = _[T.materialIndex];
  50938. if (!0 === x.visible) {
  50939. var S = D(A, x, n, z);
  50940. P.renderBufferDirect(c, null, C, S, A, T)
  50941. }
  50942. }
  50943. else {
  50944. S = D(A, I, n, z);
  50945. P.renderBufferDirect(c, null, C, S, A, null)
  50946. }
  50947. }
  50948. }
  50949. }
  50950. var M = P.getClearColor()
  50951. , R = P.getClearAlpha();
  50952. P.setClearColor(M, R),
  50953. B.enable(F.BLEND),
  50954. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  50955. q.needsUpdate = !1
  50956. }
  50957. }
  50958. }
  50959. ,
  50960. Ci.WebGLState = function(l, i, c) {
  50961. var n = this
  50962. , r = new Ci.Vector4
  50963. , o = new Uint8Array(16)
  50964. , a = new Uint8Array(16)
  50965. , s = new Uint8Array(16)
  50966. , t = {}
  50967. , h = null
  50968. , u = null
  50969. , d = null
  50970. , p = null
  50971. , f = null
  50972. , g = null
  50973. , m = null
  50974. , v = null
  50975. , y = !1
  50976. , A = null
  50977. , C = null
  50978. , I = null
  50979. , E = null
  50980. , _ = null
  50981. , b = null
  50982. , w = null
  50983. , T = null
  50984. , x = null
  50985. , S = null
  50986. , M = null
  50987. , R = null
  50988. , P = null
  50989. , O = null
  50990. , L = null
  50991. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  50992. , N = void 0
  50993. , F = {}
  50994. , B = new Ci.Vector4
  50995. , V = null
  50996. , k = null
  50997. , U = new Ci.Vector4
  50998. , H = new Ci.Vector4
  50999. , z = l.createTexture();
  51000. l.bindTexture(l.TEXTURE_2D, z),
  51001. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  51002. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  51003. this.init = function() {
  51004. this.clearColor(0, 0, 0, 1),
  51005. this.clearDepth(1),
  51006. this.clearStencil(0),
  51007. this.enable(l.DEPTH_TEST),
  51008. l.depthFunc(l.LEQUAL),
  51009. l.frontFace(l.CCW),
  51010. l.cullFace(l.BACK),
  51011. this.enable(l.CULL_FACE),
  51012. this.enable(l.BLEND),
  51013. l.blendEquation(l.FUNC_ADD),
  51014. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  51015. }
  51016. ,
  51017. this.initAttributes = function() {
  51018. for (var e = 0, t = o.length; e < t; e++)
  51019. o[e] = 0
  51020. }
  51021. ,
  51022. this.enableAttribute = function(e) {
  51023. o[e] = 1,
  51024. 0 === a[e] && (l.enableVertexAttribArray(e),
  51025. a[e] = 1),
  51026. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  51027. s[e] = 0)
  51028. }
  51029. ,
  51030. this.enableAttributeAndDivisor = function(e, t, i) {
  51031. o[e] = 1,
  51032. 0 === a[e] && (l.enableVertexAttribArray(e),
  51033. a[e] = 1),
  51034. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  51035. s[e] = t)
  51036. }
  51037. ,
  51038. this.disableUnusedAttributes = function() {
  51039. for (var e = 0, t = a.length; e < t; e++)
  51040. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  51041. a[e] = 0)
  51042. }
  51043. ,
  51044. this.enable = function(e) {
  51045. !0 !== t[e] && (l.enable(e),
  51046. t[e] = !0)
  51047. }
  51048. ,
  51049. this.disable = function(e) {
  51050. !1 !== t[e] && (l.disable(e),
  51051. t[e] = !1)
  51052. }
  51053. ,
  51054. this.getCompressedTextureFormats = function() {
  51055. if (null === h && (h = [],
  51056. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  51057. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  51058. h.push(e[t]);
  51059. return h
  51060. }
  51061. ,
  51062. this.setBlending = function(e, t, i, n, r, o, a, s) {
  51063. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  51064. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51065. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  51066. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51067. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  51068. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51069. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  51070. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51071. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51072. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  51073. u = e,
  51074. y = s),
  51075. e === Ci.CustomBlending ? (r = r || t,
  51076. o = o || i,
  51077. a = a || n,
  51078. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  51079. d = t,
  51080. g = r),
  51081. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  51082. p = i,
  51083. f = n,
  51084. m = o,
  51085. v = a)) : v = m = g = f = p = d = null
  51086. }
  51087. ,
  51088. this.setDepthFunc = function(e) {
  51089. if (A !== e) {
  51090. if (e)
  51091. switch (e) {
  51092. case Ci.NeverDepth:
  51093. l.depthFunc(l.NEVER);
  51094. break;
  51095. case Ci.AlwaysDepth:
  51096. l.depthFunc(l.ALWAYS);
  51097. break;
  51098. case Ci.LessDepth:
  51099. l.depthFunc(l.LESS);
  51100. break;
  51101. case Ci.LessEqualDepth:
  51102. l.depthFunc(l.LEQUAL);
  51103. break;
  51104. case Ci.EqualDepth:
  51105. l.depthFunc(l.EQUAL);
  51106. break;
  51107. case Ci.GreaterEqualDepth:
  51108. l.depthFunc(l.GEQUAL);
  51109. break;
  51110. case Ci.GreaterDepth:
  51111. l.depthFunc(l.GREATER);
  51112. break;
  51113. case Ci.NotEqualDepth:
  51114. l.depthFunc(l.NOTEQUAL);
  51115. break;
  51116. default:
  51117. l.depthFunc(l.LEQUAL)
  51118. }
  51119. else
  51120. l.depthFunc(l.LEQUAL);
  51121. A = e
  51122. }
  51123. }
  51124. ,
  51125. this.setDepthTest = function(e) {
  51126. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  51127. }
  51128. ,
  51129. this.setDepthWrite = function(e) {
  51130. C !== e && (l.depthMask(e),
  51131. C = e)
  51132. }
  51133. ,
  51134. this.setColorWrite = function(e) {
  51135. I !== e && (l.colorMask(e, e, e, e),
  51136. I = e)
  51137. }
  51138. ,
  51139. this.setStencilFunc = function(e, t, i) {
  51140. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  51141. _ = e,
  51142. b = t,
  51143. w = i)
  51144. }
  51145. ,
  51146. this.setStencilOp = function(e, t, i) {
  51147. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  51148. T = e,
  51149. x = t,
  51150. S = i)
  51151. }
  51152. ,
  51153. this.setStencilTest = function(e) {
  51154. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  51155. }
  51156. ,
  51157. this.setStencilWrite = function(e) {
  51158. E !== e && (l.stencilMask(e),
  51159. E = e)
  51160. }
  51161. ,
  51162. this.setFlipSided = function(e) {
  51163. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  51164. M = e)
  51165. }
  51166. ,
  51167. this.setLineWidth = function(e) {
  51168. e !== R && (l.lineWidth(e),
  51169. R = e)
  51170. }
  51171. ,
  51172. this.setPolygonOffset = function(e, t, i) {
  51173. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  51174. !e || P === t && O === i || (l.polygonOffset(t, i),
  51175. P = t,
  51176. O = i)
  51177. }
  51178. ,
  51179. this.getScissorTest = function() {
  51180. return L
  51181. }
  51182. ,
  51183. this.setScissorTest = function(e) {
  51184. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  51185. }
  51186. ,
  51187. this.activeTexture = function(e) {
  51188. void 0 === e && (e = l.TEXTURE0 + D - 1),
  51189. N !== e && (l.activeTexture(e),
  51190. N = e)
  51191. }
  51192. ,
  51193. this.bindTexture = function(e, t) {
  51194. void 0 === N && n.activeTexture();
  51195. var i = F[N];
  51196. void 0 === i && (i = {
  51197. type: void 0,
  51198. texture: void 0
  51199. },
  51200. F[N] = i),
  51201. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  51202. i.type = e,
  51203. i.texture = t)
  51204. }
  51205. ,
  51206. this.compressedTexImage2D = function() {
  51207. try {
  51208. l.compressedTexImage2D.apply(l, arguments)
  51209. } catch (e) {
  51210. console.error(e)
  51211. }
  51212. }
  51213. ,
  51214. this.texImage2D = function() {
  51215. try {
  51216. l.texImage2D.apply(l, arguments)
  51217. } catch (e) {
  51218. console.error(e)
  51219. }
  51220. }
  51221. ,
  51222. this.clearColor = function(e, t, i, n) {
  51223. r.set(e, t, i, n),
  51224. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  51225. B.copy(r))
  51226. }
  51227. ,
  51228. this.clearDepth = function(e) {
  51229. V !== e && (l.clearDepth(e),
  51230. V = e)
  51231. }
  51232. ,
  51233. this.clearStencil = function(e) {
  51234. k !== e && (l.clearStencil(e),
  51235. k = e)
  51236. }
  51237. ,
  51238. this.scissor = function(e) {
  51239. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  51240. U.copy(e))
  51241. }
  51242. ,
  51243. this.viewport = function(e) {
  51244. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  51245. H.copy(e))
  51246. }
  51247. ,
  51248. this.reset = function() {
  51249. for (var e = 0; e < a.length; e++)
  51250. 1 === a[e] && (l.disableVertexAttribArray(e),
  51251. a[e] = 0);
  51252. t = {},
  51253. N = void 0,
  51254. F = {},
  51255. M = E = C = I = u = h = null
  51256. }
  51257. }
  51258. ,
  51259. Ci.LensFlarePlugin = function(v, y) {
  51260. function A() {
  51261. var e, t = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1]), i = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51262. C = S.createBuffer(),
  51263. I = S.createBuffer(),
  51264. S.bindBuffer(S.ARRAY_BUFFER, C),
  51265. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  51266. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  51267. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  51268. T = S.createTexture(),
  51269. x = S.createTexture(),
  51270. M.bindTexture(S.TEXTURE_2D, T),
  51271. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  51272. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  51273. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  51274. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  51275. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  51276. M.bindTexture(S.TEXTURE_2D, x),
  51277. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  51278. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  51279. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  51280. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  51281. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  51282. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  51283. 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"),
  51284. 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")
  51285. } : {
  51286. 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"),
  51287. 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")
  51288. },
  51289. E = function(e) {
  51290. var t = S.createProgram()
  51291. , i = S.createShader(S.FRAGMENT_SHADER)
  51292. , n = S.createShader(S.VERTEX_SHADER)
  51293. , r = "precision " + v.getPrecision() + " float;\n";
  51294. return S.shaderSource(i, r + e.fragmentShader),
  51295. S.shaderSource(n, r + e.vertexShader),
  51296. S.compileShader(i),
  51297. S.compileShader(n),
  51298. S.attachShader(t, i),
  51299. S.attachShader(t, n),
  51300. S.linkProgram(t),
  51301. t
  51302. }(e),
  51303. _ = {
  51304. vertex: S.getAttribLocation(E, "position"),
  51305. uv: S.getAttribLocation(E, "uv")
  51306. },
  51307. b = {
  51308. renderType: S.getUniformLocation(E, "renderType"),
  51309. map: S.getUniformLocation(E, "map"),
  51310. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  51311. opacity: S.getUniformLocation(E, "opacity"),
  51312. color: S.getUniformLocation(E, "color"),
  51313. scale: S.getUniformLocation(E, "scale"),
  51314. rotation: S.getUniformLocation(E, "rotation"),
  51315. screenPosition: S.getUniformLocation(E, "screenPosition")
  51316. }
  51317. }
  51318. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  51319. this.render = function(e, t, i) {
  51320. if (0 !== y.length) {
  51321. var n = new Ci.Vector3
  51322. , r = i.w / i.z
  51323. , o = .5 * i.z
  51324. , a = .5 * i.w
  51325. , s = 16 / i.w
  51326. , l = new Ci.Vector2(s * r,s)
  51327. , c = new Ci.Vector3(1,1,0)
  51328. , h = new Ci.Vector2(1,1);
  51329. void 0 === E && A(),
  51330. S.useProgram(E),
  51331. M.initAttributes(),
  51332. M.enableAttribute(_.vertex),
  51333. M.enableAttribute(_.uv),
  51334. M.disableUnusedAttributes(),
  51335. S.uniform1i(b.occlusionMap, 0),
  51336. S.uniform1i(b.map, 1),
  51337. S.bindBuffer(S.ARRAY_BUFFER, C),
  51338. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  51339. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  51340. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  51341. M.disable(S.CULL_FACE),
  51342. M.setDepthWrite(!1);
  51343. for (var u = 0, d = y.length; u < d; u++) {
  51344. s = 16 / i.w,
  51345. l.set(s * r, s);
  51346. var p = y[u];
  51347. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  51348. n.applyMatrix4(t.matrixWorldInverse),
  51349. n.applyProjection(t.projectionMatrix),
  51350. c.copy(n),
  51351. h.x = c.x * o + o,
  51352. h.y = c.y * a + a,
  51353. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  51354. M.activeTexture(S.TEXTURE0),
  51355. M.bindTexture(S.TEXTURE_2D, null),
  51356. M.activeTexture(S.TEXTURE1),
  51357. M.bindTexture(S.TEXTURE_2D, T),
  51358. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51359. S.uniform1i(b.renderType, 0),
  51360. S.uniform2f(b.scale, l.x, l.y),
  51361. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51362. M.disable(S.BLEND),
  51363. M.enable(S.DEPTH_TEST),
  51364. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51365. M.activeTexture(S.TEXTURE0),
  51366. M.bindTexture(S.TEXTURE_2D, x),
  51367. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51368. S.uniform1i(b.renderType, 1),
  51369. M.disable(S.DEPTH_TEST),
  51370. M.activeTexture(S.TEXTURE1),
  51371. M.bindTexture(S.TEXTURE_2D, T),
  51372. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51373. p.positionScreen.copy(c),
  51374. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  51375. S.uniform1i(b.renderType, 2),
  51376. M.enable(S.BLEND);
  51377. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  51378. var m = p.lensFlares[f];
  51379. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  51380. c.y = m.y,
  51381. c.z = m.z,
  51382. s = m.size * m.scale / i.w,
  51383. l.x = s * r,
  51384. l.y = s,
  51385. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51386. S.uniform2f(b.scale, l.x, l.y),
  51387. S.uniform1f(b.rotation, m.rotation),
  51388. S.uniform1f(b.opacity, m.opacity),
  51389. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  51390. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  51391. v.setTexture(m.texture, 1),
  51392. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  51393. }
  51394. }
  51395. }
  51396. M.enable(S.CULL_FACE),
  51397. M.enable(S.DEPTH_TEST),
  51398. M.setDepthWrite(!0),
  51399. v.resetGLState()
  51400. }
  51401. }
  51402. }
  51403. ,
  51404. Ci.SpritePlugin = function(u, d) {
  51405. function p() {
  51406. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  51407. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51408. g = I.createBuffer(),
  51409. m = I.createBuffer(),
  51410. I.bindBuffer(I.ARRAY_BUFFER, g),
  51411. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  51412. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51413. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  51414. v = function() {
  51415. var e = I.createProgram()
  51416. , t = I.createShader(I.VERTEX_SHADER)
  51417. , i = I.createShader(I.FRAGMENT_SHADER);
  51418. return I.shaderSource(t, ["precision " + u.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")),
  51419. I.shaderSource(i, ["precision " + u.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")),
  51420. I.compileShader(t),
  51421. I.compileShader(i),
  51422. I.attachShader(e, t),
  51423. I.attachShader(e, i),
  51424. I.linkProgram(e),
  51425. e
  51426. }(),
  51427. y = {
  51428. position: I.getAttribLocation(v, "position"),
  51429. uv: I.getAttribLocation(v, "uv")
  51430. },
  51431. A = {
  51432. uvOffset: I.getUniformLocation(v, "uvOffset"),
  51433. uvScale: I.getUniformLocation(v, "uvScale"),
  51434. rotation: I.getUniformLocation(v, "rotation"),
  51435. scale: I.getUniformLocation(v, "scale"),
  51436. color: I.getUniformLocation(v, "color"),
  51437. map: I.getUniformLocation(v, "map"),
  51438. opacity: I.getUniformLocation(v, "opacity"),
  51439. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  51440. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  51441. fogType: I.getUniformLocation(v, "fogType"),
  51442. fogDensity: I.getUniformLocation(v, "fogDensity"),
  51443. fogNear: I.getUniformLocation(v, "fogNear"),
  51444. fogFar: I.getUniformLocation(v, "fogFar"),
  51445. fogColor: I.getUniformLocation(v, "fogColor"),
  51446. alphaTest: I.getUniformLocation(v, "alphaTest")
  51447. };
  51448. var i = document.createElement("canvas");
  51449. i.width = 8,
  51450. i.height = 8;
  51451. var n = i.getContext("2d");
  51452. n.fillStyle = "white",
  51453. n.fillRect(0, 0, 8, 8),
  51454. (C = new Ci.Texture(i)).needsUpdate = !0
  51455. }
  51456. function f(e, t) {
  51457. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51458. }
  51459. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  51460. this.render = function(e, t) {
  51461. if (0 !== d.length) {
  51462. void 0 === v && p(),
  51463. I.useProgram(v),
  51464. E.initAttributes(),
  51465. E.enableAttribute(y.position),
  51466. E.enableAttribute(y.uv),
  51467. E.disableUnusedAttributes(),
  51468. E.disable(I.CULL_FACE),
  51469. E.enable(I.BLEND),
  51470. I.bindBuffer(I.ARRAY_BUFFER, g),
  51471. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  51472. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  51473. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51474. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  51475. E.activeTexture(I.TEXTURE0),
  51476. I.uniform1i(A.map, 0);
  51477. var i = 0
  51478. , n = 0
  51479. , r = e.fog;
  51480. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  51481. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  51482. I.uniform1f(A.fogFar, r.far),
  51483. I.uniform1i(A.fogType, 1),
  51484. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  51485. I.uniform1i(A.fogType, 2),
  51486. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  51487. n = i = 0);
  51488. for (var o = 0, a = d.length; o < a; o++) {
  51489. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51490. l.z = -l.modelViewMatrix.elements[14]
  51491. }
  51492. d.sort(f);
  51493. var s = [];
  51494. for (o = 0,
  51495. a = d.length; o < a; o++) {
  51496. var l, c = (l = d[o]).material;
  51497. I.uniform1f(A.alphaTest, c.alphaTest),
  51498. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  51499. l.matrixWorld.decompose(_, b, w),
  51500. s[0] = w.x,
  51501. s[1] = w.y;
  51502. var h = 0;
  51503. e.fog && c.fog && (h = n),
  51504. i !== h && (I.uniform1i(A.fogType, h),
  51505. i = h),
  51506. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  51507. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  51508. I.uniform2f(A.uvScale, 1, 1)),
  51509. I.uniform1f(A.opacity, c.opacity),
  51510. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  51511. I.uniform1f(A.rotation, c.rotation),
  51512. I.uniform2fv(A.scale, s),
  51513. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  51514. E.setDepthTest(c.depthTest),
  51515. E.setDepthWrite(c.depthWrite),
  51516. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  51517. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  51518. }
  51519. E.enable(I.CULL_FACE),
  51520. u.resetGLState()
  51521. }
  51522. }
  51523. }
  51524. ,
  51525. Object.defineProperties(Ci.Box2.prototype, {
  51526. empty: {
  51527. value: function() {
  51528. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51529. this.isEmpty()
  51530. }
  51531. },
  51532. isIntersectionBox: {
  51533. value: function(e) {
  51534. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51535. this.intersectsBox(e)
  51536. }
  51537. }
  51538. }),
  51539. Object.defineProperties(Ci.Box3.prototype, {
  51540. empty: {
  51541. value: function() {
  51542. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51543. this.isEmpty()
  51544. }
  51545. },
  51546. isIntersectionBox: {
  51547. value: function(e) {
  51548. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51549. this.intersectsBox(e)
  51550. }
  51551. },
  51552. isIntersectionSphere: {
  51553. value: function(e) {
  51554. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51555. this.intersectsSphere(e)
  51556. }
  51557. }
  51558. }),
  51559. Object.defineProperties(Ci.Matrix3.prototype, {
  51560. multiplyVector3: {
  51561. value: function(e) {
  51562. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51563. e.applyMatrix3(this)
  51564. }
  51565. },
  51566. multiplyVector3Array: {
  51567. value: function(e) {
  51568. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51569. this.applyToVector3Array(e)
  51570. }
  51571. }
  51572. }),
  51573. Object.defineProperties(Ci.Matrix4.prototype, {
  51574. extractPosition: {
  51575. value: function(e) {
  51576. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51577. this.copyPosition(e)
  51578. }
  51579. },
  51580. setRotationFromQuaternion: {
  51581. value: function(e) {
  51582. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51583. this.makeRotationFromQuaternion(e)
  51584. }
  51585. },
  51586. multiplyVector3: {
  51587. value: function(e) {
  51588. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51589. e.applyProjection(this)
  51590. }
  51591. },
  51592. multiplyVector4: {
  51593. value: function(e) {
  51594. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51595. e.applyMatrix4(this)
  51596. }
  51597. },
  51598. multiplyVector3Array: {
  51599. value: function(e) {
  51600. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51601. this.applyToVector3Array(e)
  51602. }
  51603. },
  51604. rotateAxis: {
  51605. value: function(e) {
  51606. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51607. e.transformDirection(this)
  51608. }
  51609. },
  51610. crossVector: {
  51611. value: function(e) {
  51612. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51613. e.applyMatrix4(this)
  51614. }
  51615. },
  51616. translate: {
  51617. value: function(e) {
  51618. console.error("THREE.Matrix4: .translate() has been removed.")
  51619. }
  51620. },
  51621. rotateX: {
  51622. value: function(e) {
  51623. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51624. }
  51625. },
  51626. rotateY: {
  51627. value: function(e) {
  51628. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51629. }
  51630. },
  51631. rotateZ: {
  51632. value: function(e) {
  51633. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51634. }
  51635. },
  51636. rotateByAxis: {
  51637. value: function(e, t) {
  51638. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51639. }
  51640. }
  51641. }),
  51642. Object.defineProperties(Ci.Plane.prototype, {
  51643. isIntersectionLine: {
  51644. value: function(e) {
  51645. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51646. this.intersectsLine(e)
  51647. }
  51648. }
  51649. }),
  51650. Object.defineProperties(Ci.Quaternion.prototype, {
  51651. multiplyVector3: {
  51652. value: function(e) {
  51653. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51654. e.applyQuaternion(this)
  51655. }
  51656. }
  51657. }),
  51658. Object.defineProperties(Ci.Ray.prototype, {
  51659. isIntersectionBox: {
  51660. value: function(e) {
  51661. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51662. this.intersectsBox(e)
  51663. }
  51664. },
  51665. isIntersectionPlane: {
  51666. value: function(e) {
  51667. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51668. this.intersectsPlane(e)
  51669. }
  51670. },
  51671. isIntersectionSphere: {
  51672. value: function(e) {
  51673. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51674. this.intersectsSphere(e)
  51675. }
  51676. }
  51677. }),
  51678. Object.defineProperties(Ci.Vector3.prototype, {
  51679. setEulerFromRotationMatrix: {
  51680. value: function() {
  51681. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51682. }
  51683. },
  51684. setEulerFromQuaternion: {
  51685. value: function() {
  51686. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51687. }
  51688. },
  51689. getPositionFromMatrix: {
  51690. value: function(e) {
  51691. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51692. this.setFromMatrixPosition(e)
  51693. }
  51694. },
  51695. getScaleFromMatrix: {
  51696. value: function(e) {
  51697. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51698. this.setFromMatrixScale(e)
  51699. }
  51700. },
  51701. getColumnFromMatrix: {
  51702. value: function(e, t) {
  51703. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51704. this.setFromMatrixColumn(e, t)
  51705. }
  51706. }
  51707. }),
  51708. Ci.Face4 = function(e, t, i, n, r, o, a) {
  51709. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51710. new Ci.Face3(e,t,i,r,o,a)
  51711. }
  51712. ,
  51713. Ci.Vertex = function(e, t, i) {
  51714. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51715. new Ci.Vector3(e,t,i)
  51716. }
  51717. ,
  51718. Object.defineProperties(Ci.Object3D.prototype, {
  51719. eulerOrder: {
  51720. get: function() {
  51721. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51722. this.rotation.order
  51723. },
  51724. set: function(e) {
  51725. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51726. this.rotation.order = e
  51727. }
  51728. },
  51729. getChildByName: {
  51730. value: function(e) {
  51731. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51732. this.getObjectByName(e)
  51733. }
  51734. },
  51735. renderDepth: {
  51736. set: function(e) {
  51737. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51738. }
  51739. },
  51740. translate: {
  51741. value: function(e, t) {
  51742. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51743. this.translateOnAxis(t, e)
  51744. }
  51745. },
  51746. useQuaternion: {
  51747. get: function() {
  51748. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51749. },
  51750. set: function(e) {
  51751. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51752. }
  51753. }
  51754. }),
  51755. Object.defineProperties(Ci, {
  51756. PointCloud: {
  51757. value: function(e, t) {
  51758. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51759. new Ci.Points(e,t)
  51760. }
  51761. },
  51762. ParticleSystem: {
  51763. value: function(e, t) {
  51764. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51765. new Ci.Points(e,t)
  51766. }
  51767. }
  51768. }),
  51769. Object.defineProperties(Ci.Light.prototype, {
  51770. onlyShadow: {
  51771. set: function(e) {
  51772. console.warn("THREE.Light: .onlyShadow has been removed.")
  51773. }
  51774. },
  51775. shadowCameraFov: {
  51776. set: function(e) {
  51777. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51778. this.shadow.camera.fov = e
  51779. }
  51780. },
  51781. shadowCameraLeft: {
  51782. set: function(e) {
  51783. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51784. this.shadow.camera.left = e
  51785. }
  51786. },
  51787. shadowCameraRight: {
  51788. set: function(e) {
  51789. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51790. this.shadow.camera.right = e
  51791. }
  51792. },
  51793. shadowCameraTop: {
  51794. set: function(e) {
  51795. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51796. this.shadow.camera.top = e
  51797. }
  51798. },
  51799. shadowCameraBottom: {
  51800. set: function(e) {
  51801. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51802. this.shadow.camera.bottom = e
  51803. }
  51804. },
  51805. shadowCameraNear: {
  51806. set: function(e) {
  51807. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51808. this.shadow.camera.near = e
  51809. }
  51810. },
  51811. shadowCameraFar: {
  51812. set: function(e) {
  51813. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51814. this.shadow.camera.far = e
  51815. }
  51816. },
  51817. shadowCameraVisible: {
  51818. set: function(e) {
  51819. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51820. }
  51821. },
  51822. shadowBias: {
  51823. set: function(e) {
  51824. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51825. this.shadow.bias = e
  51826. }
  51827. },
  51828. shadowDarkness: {
  51829. set: function(e) {
  51830. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51831. }
  51832. },
  51833. shadowMapWidth: {
  51834. set: function(e) {
  51835. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51836. this.shadow.mapSize.width = e
  51837. }
  51838. },
  51839. shadowMapHeight: {
  51840. set: function(e) {
  51841. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51842. this.shadow.mapSize.height = e
  51843. }
  51844. }
  51845. }),
  51846. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51847. length: {
  51848. get: function() {
  51849. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51850. this.array.length
  51851. }
  51852. }
  51853. }),
  51854. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51855. drawcalls: {
  51856. get: function() {
  51857. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51858. this.groups
  51859. }
  51860. },
  51861. offsets: {
  51862. get: function() {
  51863. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51864. this.groups
  51865. }
  51866. },
  51867. addIndex: {
  51868. value: function(e) {
  51869. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51870. this.setIndex(e)
  51871. }
  51872. },
  51873. addDrawCall: {
  51874. value: function(e, t, i) {
  51875. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51876. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51877. this.addGroup(e, t)
  51878. }
  51879. },
  51880. clearDrawCalls: {
  51881. value: function() {
  51882. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51883. this.clearGroups()
  51884. }
  51885. },
  51886. computeTangents: {
  51887. value: function() {
  51888. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51889. }
  51890. },
  51891. computeOffsets: {
  51892. value: function() {
  51893. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51894. }
  51895. }
  51896. }),
  51897. Object.defineProperties(Ci.Material.prototype, {
  51898. wrapAround: {
  51899. get: function() {
  51900. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51901. },
  51902. set: function(e) {
  51903. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51904. }
  51905. },
  51906. wrapRGB: {
  51907. get: function() {
  51908. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51909. new Ci.Color
  51910. }
  51911. }
  51912. }),
  51913. Object.defineProperties(Ci, {
  51914. PointCloudMaterial: {
  51915. value: function(e) {
  51916. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51917. new Ci.PointsMaterial(e)
  51918. }
  51919. },
  51920. ParticleBasicMaterial: {
  51921. value: function(e) {
  51922. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51923. new Ci.PointsMaterial(e)
  51924. }
  51925. },
  51926. ParticleSystemMaterial: {
  51927. value: function(e) {
  51928. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51929. new Ci.PointsMaterial(e)
  51930. }
  51931. }
  51932. }),
  51933. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51934. metal: {
  51935. get: function() {
  51936. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51937. !1
  51938. },
  51939. set: function(e) {
  51940. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51941. }
  51942. }
  51943. }),
  51944. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  51945. derivatives: {
  51946. get: function() {
  51947. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51948. this.extensions.derivatives
  51949. },
  51950. set: function(e) {
  51951. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51952. this.extensions.derivatives = e
  51953. }
  51954. }
  51955. }),
  51956. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  51957. supportsFloatTextures: {
  51958. value: function() {
  51959. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51960. this.extensions.get("OES_texture_float")
  51961. }
  51962. },
  51963. supportsHalfFloatTextures: {
  51964. value: function() {
  51965. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51966. this.extensions.get("OES_texture_half_float")
  51967. }
  51968. },
  51969. supportsStandardDerivatives: {
  51970. value: function() {
  51971. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51972. this.extensions.get("OES_standard_derivatives")
  51973. }
  51974. },
  51975. supportsCompressedTextureS3TC: {
  51976. value: function() {
  51977. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51978. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51979. }
  51980. },
  51981. supportsCompressedTexturePVRTC: {
  51982. value: function() {
  51983. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51984. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51985. }
  51986. },
  51987. supportsBlendMinMax: {
  51988. value: function() {
  51989. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51990. this.extensions.get("EXT_blend_minmax")
  51991. }
  51992. },
  51993. supportsVertexTextures: {
  51994. value: function() {
  51995. return this.capabilities.vertexTextures
  51996. }
  51997. },
  51998. supportsInstancedArrays: {
  51999. value: function() {
  52000. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  52001. this.extensions.get("ANGLE_instanced_arrays")
  52002. }
  52003. },
  52004. enableScissorTest: {
  52005. value: function(e) {
  52006. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  52007. this.setScissorTest(e)
  52008. }
  52009. },
  52010. initMaterial: {
  52011. value: function() {
  52012. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  52013. }
  52014. },
  52015. addPrePlugin: {
  52016. value: function() {
  52017. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  52018. }
  52019. },
  52020. addPostPlugin: {
  52021. value: function() {
  52022. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  52023. }
  52024. },
  52025. updateShadowMap: {
  52026. value: function() {
  52027. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  52028. }
  52029. },
  52030. shadowMapEnabled: {
  52031. get: function() {
  52032. return this.shadowMap.enabled
  52033. },
  52034. set: function(e) {
  52035. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  52036. this.shadowMap.enabled = e
  52037. }
  52038. },
  52039. shadowMapType: {
  52040. get: function() {
  52041. return this.shadowMap.type
  52042. },
  52043. set: function(e) {
  52044. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  52045. this.shadowMap.type = e
  52046. }
  52047. },
  52048. shadowMapCullFace: {
  52049. get: function() {
  52050. return this.shadowMap.cullFace
  52051. },
  52052. set: function(e) {
  52053. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  52054. this.shadowMap.cullFace = e
  52055. }
  52056. }
  52057. }),
  52058. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  52059. wrapS: {
  52060. get: function() {
  52061. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  52062. this.texture.wrapS
  52063. },
  52064. set: function(e) {
  52065. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  52066. this.texture.wrapS = e
  52067. }
  52068. },
  52069. wrapT: {
  52070. get: function() {
  52071. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  52072. this.texture.wrapT
  52073. },
  52074. set: function(e) {
  52075. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  52076. this.texture.wrapT = e
  52077. }
  52078. },
  52079. magFilter: {
  52080. get: function() {
  52081. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  52082. this.texture.magFilter
  52083. },
  52084. set: function(e) {
  52085. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  52086. this.texture.magFilter = e
  52087. }
  52088. },
  52089. minFilter: {
  52090. get: function() {
  52091. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  52092. this.texture.minFilter
  52093. },
  52094. set: function(e) {
  52095. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  52096. this.texture.minFilter = e
  52097. }
  52098. },
  52099. anisotropy: {
  52100. get: function() {
  52101. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52102. this.texture.anisotropy
  52103. },
  52104. set: function(e) {
  52105. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52106. this.texture.anisotropy = e
  52107. }
  52108. },
  52109. offset: {
  52110. get: function() {
  52111. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52112. this.texture.offset
  52113. },
  52114. set: function(e) {
  52115. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52116. this.texture.offset = e
  52117. }
  52118. },
  52119. repeat: {
  52120. get: function() {
  52121. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52122. this.texture.repeat
  52123. },
  52124. set: function(e) {
  52125. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52126. this.texture.repeat = e
  52127. }
  52128. },
  52129. format: {
  52130. get: function() {
  52131. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52132. this.texture.format
  52133. },
  52134. set: function(e) {
  52135. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52136. this.texture.format = e
  52137. }
  52138. },
  52139. type: {
  52140. get: function() {
  52141. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52142. this.texture.type
  52143. },
  52144. set: function(e) {
  52145. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52146. this.texture.type = e
  52147. }
  52148. },
  52149. generateMipmaps: {
  52150. get: function() {
  52151. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52152. this.texture.generateMipmaps
  52153. },
  52154. set: function(e) {
  52155. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52156. this.texture.generateMipmaps = e
  52157. }
  52158. }
  52159. }),
  52160. Ci.GeometryUtils = {
  52161. merge: function(e, t, i) {
  52162. var n;
  52163. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  52164. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  52165. n = t.matrix,
  52166. t = t.geometry),
  52167. e.merge(t, n, i)
  52168. },
  52169. center: function(e) {
  52170. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  52171. e.center()
  52172. }
  52173. },
  52174. Ci.ImageUtils = {
  52175. crossOrigin: void 0,
  52176. loadTexture: function(e, t, i, n) {
  52177. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  52178. var r = new Ci.TextureLoader;
  52179. r.setCrossOrigin(this.crossOrigin);
  52180. var o = r.load(e, i, void 0, n);
  52181. return t && (o.mapping = t),
  52182. o
  52183. },
  52184. loadTextureCube: function(e, t, i, n) {
  52185. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  52186. var r = new Ci.CubeTextureLoader;
  52187. r.setCrossOrigin(this.crossOrigin);
  52188. var o = r.load(e, i, void 0, n);
  52189. return t && (o.mapping = t),
  52190. o
  52191. },
  52192. loadCompressedTexture: function() {
  52193. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  52194. },
  52195. loadCompressedTextureCube: function() {
  52196. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  52197. }
  52198. },
  52199. Ci.Projector = function() {
  52200. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  52201. this.projectVector = function(e, t) {
  52202. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  52203. e.project(t)
  52204. }
  52205. ,
  52206. this.unprojectVector = function(e, t) {
  52207. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  52208. e.unproject(t)
  52209. }
  52210. ,
  52211. this.pickingRay = function(e, t) {
  52212. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  52213. }
  52214. }
  52215. ,
  52216. Ci.CanvasRenderer = function() {
  52217. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  52218. this.domElement = document.createElement("canvas"),
  52219. this.clear = function() {}
  52220. ,
  52221. this.render = function() {}
  52222. ,
  52223. this.setClearColor = function() {}
  52224. ,
  52225. this.setSize = function() {}
  52226. }
  52227. ,
  52228. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  52229. Ci.CurveUtils = {
  52230. tangentQuadraticBezier: function(e, t, i, n) {
  52231. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  52232. },
  52233. tangentCubicBezier: function(e, t, i, n, r) {
  52234. 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
  52235. },
  52236. tangentSpline: function(e, t, i, n, r) {
  52237. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  52238. },
  52239. interpolate: function(e, t, i, n, r) {
  52240. var o = .5 * (i - e)
  52241. , a = .5 * (n - t)
  52242. , s = r * r;
  52243. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  52244. }
  52245. },
  52246. Ci.SceneUtils = {
  52247. createMultiMaterialObject: function(e, t) {
  52248. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  52249. i.add(new Ci.Mesh(e,t[n]));
  52250. return i
  52251. },
  52252. detach: function(e, t, i) {
  52253. e.applyMatrix(t.matrixWorld),
  52254. t.remove(e),
  52255. i.add(e)
  52256. },
  52257. attach: function(e, t, i) {
  52258. var n = new Ci.Matrix4;
  52259. n.getInverse(i.matrixWorld),
  52260. e.applyMatrix(n),
  52261. t.remove(e),
  52262. i.add(e)
  52263. }
  52264. },
  52265. Ci.ShapeUtils = {
  52266. area: function(e) {
  52267. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  52268. i += e[n].x * e[r].y - e[r].x * e[n].y;
  52269. return .5 * i
  52270. },
  52271. triangulate: function(e, t) {
  52272. var i = e.length;
  52273. if (i < 3)
  52274. return null;
  52275. var n, r, o, a = [], s = [], l = [];
  52276. if (0 < Ci.ShapeUtils.area(e))
  52277. for (r = 0; r < i; r++)
  52278. s[r] = r;
  52279. else
  52280. for (r = 0; r < i; r++)
  52281. s[r] = i - 1 - r;
  52282. var c = i
  52283. , h = 2 * c;
  52284. for (r = c - 1; 2 < c; ) {
  52285. if (h-- <= 0)
  52286. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  52287. t ? l : a;
  52288. if (c <= (n = r) && (n = 0),
  52289. c <= (r = n + 1) && (r = 0),
  52290. c <= (o = r + 1) && (o = 0),
  52291. Si(e, n, r, o, c, s)) {
  52292. var u, d, p, f, g;
  52293. for (u = s[n],
  52294. d = s[r],
  52295. p = s[o],
  52296. a.push([e[u], e[d], e[p]]),
  52297. l.push([s[n], s[r], s[o]]),
  52298. g = (f = r) + 1; g < c; f++,
  52299. g++)
  52300. s[f] = s[g];
  52301. h = 2 * --c
  52302. }
  52303. }
  52304. return t ? l : a
  52305. },
  52306. triangulateShape: function(e, t) {
  52307. function w(e, t, i) {
  52308. 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
  52309. }
  52310. function b(e, t, i, n, r) {
  52311. var o = t.x - e.x
  52312. , a = t.y - e.y
  52313. , s = n.x - i.x
  52314. , l = n.y - i.y
  52315. , c = e.x - i.x
  52316. , h = e.y - i.y
  52317. , u = a * s - o * l
  52318. , d = a * c - o * h;
  52319. if (Math.abs(u) > Number.EPSILON) {
  52320. var p;
  52321. if (0 < u) {
  52322. if (d < 0 || u < d)
  52323. return [];
  52324. if ((p = l * c - s * h) < 0 || u < p)
  52325. return []
  52326. } else {
  52327. if (0 < d || d < u)
  52328. return [];
  52329. if (0 < (p = l * c - s * h) || p < u)
  52330. return []
  52331. }
  52332. if (0 === p)
  52333. return !r || 0 != d && d != u ? [e] : [];
  52334. if (p === u)
  52335. return !r || 0 != d && d != u ? [t] : [];
  52336. if (0 == d)
  52337. return [i];
  52338. if (d == u)
  52339. return [n];
  52340. var f = p / u;
  52341. return [{
  52342. x: e.x + f * o,
  52343. y: e.y + f * a
  52344. }]
  52345. }
  52346. if (0 != d || l * c != s * h)
  52347. return [];
  52348. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  52349. return _ && b ? e.x !== i.x || e.y !== i.y ? [] : [e] : _ ? w(i, n, e) ? [e] : [] : b ? w(e, t, i) ? [i] : [] : (E = 0 != o ? (y = e.x < t.x ? (v = (g = e).x,
  52350. (m = t).x) : (v = (g = t).x,
  52351. (m = e).x),
  52352. i.x < n.x ? (I = (A = i).x,
  52353. (C = n).x) : (I = (A = n).x,
  52354. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  52355. (m = t).y) : (v = (g = t).y,
  52356. (m = e).y),
  52357. i.y < n.y ? (I = (A = i).y,
  52358. (C = n).y) : (I = (A = n).y,
  52359. (C = i).y)),
  52360. v <= I ? y < I ? [] : y === I ? r ? [] : [A] : y <= E ? [A, m] : [A, C] : E < v ? [] : v === E ? r ? [] : [g] : y <= E ? [g, m] : [g, C])
  52361. }
  52362. function T(e, t, i, n) {
  52363. var r = t.x - e.x
  52364. , o = t.y - e.y
  52365. , a = i.x - e.x
  52366. , s = i.y - e.y
  52367. , l = n.x - e.x
  52368. , c = n.y - e.y
  52369. , h = r * s - o * a
  52370. , u = r * c - o * l;
  52371. if (Math.abs(h) > Number.EPSILON) {
  52372. var d = l * s - c * a;
  52373. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  52374. }
  52375. return 0 < u
  52376. }
  52377. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  52378. Array.prototype.push.apply(c, t[h]);
  52379. for (i = 0,
  52380. n = c.length; i < n; i++)
  52381. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  52382. l[a] = i;
  52383. var d = function(e, a) {
  52384. function t(e, t) {
  52385. var i = m.length - 1
  52386. , n = e - 1;
  52387. n < 0 && (n = i);
  52388. var r = e + 1;
  52389. i < r && (r = 0);
  52390. var o = T(m[e], m[n], m[r], c[t]);
  52391. if (!o)
  52392. return !1;
  52393. var a = c.length - 1
  52394. , s = t - 1;
  52395. s < 0 && (s = a);
  52396. var l = t + 1;
  52397. return a < l && (l = 0),
  52398. !!(o = T(c[t], c[s], c[l], m[e]))
  52399. }
  52400. function i(e, t) {
  52401. var i, n;
  52402. for (i = 0; i < m.length; i++)
  52403. if (n = i + 1,
  52404. n %= m.length,
  52405. 0 < b(e, t, m[i], m[n], !0).length)
  52406. return !0;
  52407. return !1
  52408. }
  52409. function n(e, t) {
  52410. var i, n, r, o;
  52411. for (i = 0; i < v.length; i++)
  52412. for (n = a[v[i]],
  52413. r = 0; r < n.length; r++)
  52414. if (o = r + 1,
  52415. o %= n.length,
  52416. 0 < b(e, t, n[r], n[o], !0).length)
  52417. return !0;
  52418. return !1
  52419. }
  52420. for (var c, r, o, s, l, h, u, d, p, f, g, m = e.concat(), v = [], y = [], A = 0, C = a.length; A < C; A++)
  52421. v.push(A);
  52422. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  52423. if (--E < 0) {
  52424. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  52425. break
  52426. }
  52427. for (o = I; o < m.length; o++) {
  52428. s = m[o],
  52429. r = -1;
  52430. for (A = 0; A < v.length; A++)
  52431. if (h = v[A],
  52432. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  52433. c = a[h];
  52434. for (var _ = 0; _ < c.length; _++)
  52435. if (l = c[_],
  52436. t(o, _) && !i(s, l) && !n(s, l)) {
  52437. r = _,
  52438. v.splice(A, 1),
  52439. d = m.slice(0, o + 1),
  52440. p = m.slice(o),
  52441. f = c.slice(r),
  52442. g = c.slice(0, r + 1),
  52443. m = d.concat(f).concat(g).concat(p),
  52444. I = o;
  52445. break
  52446. }
  52447. if (0 <= r)
  52448. break;
  52449. y[u] = !0
  52450. }
  52451. if (0 <= r)
  52452. break
  52453. }
  52454. }
  52455. return m
  52456. }(e, t)
  52457. , p = Ci.ShapeUtils.triangulate(d, !1);
  52458. for (i = 0,
  52459. n = p.length; i < n; i++)
  52460. for (o = p[i],
  52461. r = 0; r < 3; r++)
  52462. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  52463. return p.concat()
  52464. },
  52465. isClockWise: function(e) {
  52466. return Ci.ShapeUtils.area(e) < 0
  52467. },
  52468. b2: function(e, t, i, n) {
  52469. return function(e, t) {
  52470. var i = 1 - e;
  52471. return i * i * t
  52472. }(e, t) + function(e, t) {
  52473. return 2 * (1 - e) * e * t
  52474. }(e, i) + function(e, t) {
  52475. return e * e * t
  52476. }(e, n)
  52477. },
  52478. b3: function(e, t, i, n, r) {
  52479. return function(e, t) {
  52480. var i = 1 - e;
  52481. return i * i * i * t
  52482. }(e, t) + function(e, t) {
  52483. var i = 1 - e;
  52484. return 3 * i * i * e * t
  52485. }(e, i) + function(e, t) {
  52486. return 3 * (1 - e) * e * e * t
  52487. }(e, n) + function(e, t) {
  52488. return e * e * e * t
  52489. }(e, r)
  52490. }
  52491. },
  52492. Ci.Curve = function() {}
  52493. ,
  52494. Ci.Curve.prototype = {
  52495. constructor: Ci.Curve,
  52496. getPoint: function(e) {
  52497. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52498. null
  52499. },
  52500. getPointAt: function(e) {
  52501. var t = this.getUtoTmapping(e);
  52502. return this.getPoint(t)
  52503. },
  52504. getPoints: function(e) {
  52505. e = e || 5;
  52506. var t, i = [];
  52507. for (t = 0; t <= e; t++)
  52508. i.push(this.getPoint(t / e));
  52509. return i
  52510. },
  52511. getSpacedPoints: function(e) {
  52512. e = e || 5;
  52513. var t, i = [];
  52514. for (t = 0; t <= e; t++)
  52515. i.push(this.getPointAt(t / e));
  52516. return i
  52517. },
  52518. getLength: function() {
  52519. var e = this.getLengths();
  52520. return e[e.length - 1]
  52521. },
  52522. getLengths: function(e) {
  52523. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52524. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52525. return this.cacheArcLengths;
  52526. this.needsUpdate = !1;
  52527. var t, i, n = [], r = this.getPoint(0), o = 0;
  52528. for (n.push(0),
  52529. i = 1; i <= e; i++)
  52530. o += (t = this.getPoint(i / e)).distanceTo(r),
  52531. n.push(o),
  52532. r = t;
  52533. return this.cacheArcLengths = n
  52534. },
  52535. updateArcLengths: function() {
  52536. this.needsUpdate = !0,
  52537. this.getLengths()
  52538. },
  52539. getUtoTmapping: function(e, t) {
  52540. var i, n = this.getLengths(), r = 0, o = n.length;
  52541. i = t || e * n[o - 1];
  52542. for (var a, s = 0, l = o - 1; s <= l; )
  52543. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  52544. s = r + 1;
  52545. else {
  52546. if (!(0 < a)) {
  52547. l = r;
  52548. break
  52549. }
  52550. l = r - 1
  52551. }
  52552. if (n[r = l] === i)
  52553. return r / (o - 1);
  52554. var c = n[r];
  52555. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  52556. },
  52557. getTangent: function(e) {
  52558. var t = e - 1e-4
  52559. , i = e + 1e-4;
  52560. t < 0 && (t = 0),
  52561. 1 < i && (i = 1);
  52562. var n = this.getPoint(t);
  52563. return this.getPoint(i).clone().sub(n).normalize()
  52564. },
  52565. getTangentAt: function(e) {
  52566. var t = this.getUtoTmapping(e);
  52567. return this.getTangent(t)
  52568. }
  52569. },
  52570. Ci.Curve.create = function(e, t) {
  52571. return e.prototype = Object.create(Ci.Curve.prototype),
  52572. (e.prototype.constructor = e).prototype.getPoint = t,
  52573. e
  52574. }
  52575. ,
  52576. Ci.CurvePath = function() {
  52577. this.curves = [],
  52578. this.autoClose = !1
  52579. }
  52580. ,
  52581. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  52582. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  52583. Ci.CurvePath.prototype.add = function(e) {
  52584. this.curves.push(e)
  52585. }
  52586. ,
  52587. Ci.CurvePath.prototype.closePath = function() {
  52588. var e = this.curves[0].getPoint(0)
  52589. , t = this.curves[this.curves.length - 1].getPoint(1);
  52590. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  52591. }
  52592. ,
  52593. Ci.CurvePath.prototype.getPoint = function(e) {
  52594. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52595. if (i[n] >= t) {
  52596. var r = i[n] - t
  52597. , o = this.curves[n]
  52598. , a = 1 - r / o.getLength();
  52599. return o.getPointAt(a)
  52600. }
  52601. n++
  52602. }
  52603. return null
  52604. }
  52605. ,
  52606. Ci.CurvePath.prototype.getLength = function() {
  52607. var e = this.getCurveLengths();
  52608. return e[e.length - 1]
  52609. }
  52610. ,
  52611. Ci.CurvePath.prototype.getCurveLengths = function() {
  52612. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52613. return this.cacheLengths;
  52614. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52615. t += this.curves[i].getLength(),
  52616. e.push(t);
  52617. return this.cacheLengths = e
  52618. }
  52619. ,
  52620. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  52621. var t = this.getPoints(e);
  52622. return this.createGeometry(t)
  52623. }
  52624. ,
  52625. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52626. var t = this.getSpacedPoints(e);
  52627. return this.createGeometry(t)
  52628. }
  52629. ,
  52630. Ci.CurvePath.prototype.createGeometry = function(e) {
  52631. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  52632. var r = e[i];
  52633. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  52634. }
  52635. return t
  52636. }
  52637. ,
  52638. Ci.Font = function(e) {
  52639. this.data = e
  52640. }
  52641. ,
  52642. Ci.Font.prototype = {
  52643. constructor: Ci.Font,
  52644. generateShapes: function(e, s, b) {
  52645. function l(e, t, i) {
  52646. var n = w.glyphs[e] || w.glyphs["?"];
  52647. if (n) {
  52648. var r, o, a, s, l, c, h, u, d, p, f, g = new Ci.Path, m = [], v = Ci.ShapeUtils.b2, y = Ci.ShapeUtils.b3;
  52649. if (n.o)
  52650. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  52651. switch (A[C++]) {
  52652. case "m":
  52653. r = A[C++] * t + i,
  52654. o = A[C++] * t,
  52655. g.moveTo(r, o);
  52656. break;
  52657. case "l":
  52658. r = A[C++] * t + i,
  52659. o = A[C++] * t,
  52660. g.lineTo(r, o);
  52661. break;
  52662. case "q":
  52663. if (a = A[C++] * t + i,
  52664. s = A[C++] * t,
  52665. h = A[C++] * t + i,
  52666. u = A[C++] * t,
  52667. g.quadraticCurveTo(h, u, a, s),
  52668. f = m[m.length - 1]) {
  52669. l = f.x,
  52670. c = f.y;
  52671. for (var E = 1; E <= b; E++) {
  52672. v(_ = E / b, l, h, a),
  52673. v(_, c, u, s)
  52674. }
  52675. }
  52676. break;
  52677. case "b":
  52678. if (a = A[C++] * t + i,
  52679. s = A[C++] * t,
  52680. h = A[C++] * t + i,
  52681. u = A[C++] * t,
  52682. d = A[C++] * t + i,
  52683. p = A[C++] * t,
  52684. g.bezierCurveTo(h, u, d, p, a, s),
  52685. f = m[m.length - 1]) {
  52686. l = f.x,
  52687. c = f.y;
  52688. for (E = 1; E <= b; E++) {
  52689. var _;
  52690. y(_ = E / b, l, h, d, a),
  52691. y(_, c, u, p, s)
  52692. }
  52693. }
  52694. }
  52695. }
  52696. return {
  52697. offset: n.ha * t,
  52698. path: g
  52699. }
  52700. }
  52701. }
  52702. void 0 === s && (s = 100),
  52703. void 0 === b && (b = 4);
  52704. for (var w = this.data, t = function(e) {
  52705. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  52706. var a = l(t[o], i, n);
  52707. n += a.offset,
  52708. r.push(a.path)
  52709. }
  52710. return r
  52711. }(e), i = [], n = 0, r = t.length; n < r; n++)
  52712. Array.prototype.push.apply(i, t[n].toShapes());
  52713. return i
  52714. }
  52715. },
  52716. Ci.Path = function(e) {
  52717. Ci.CurvePath.call(this),
  52718. this.actions = [],
  52719. e && this.fromPoints(e)
  52720. }
  52721. ,
  52722. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  52723. Ci.Path.prototype.constructor = Ci.Path,
  52724. Ci.Path.prototype.fromPoints = function(e) {
  52725. this.moveTo(e[0].x, e[0].y);
  52726. for (var t = 1, i = e.length; t < i; t++)
  52727. this.lineTo(e[t].x, e[t].y)
  52728. }
  52729. ,
  52730. Ci.Path.prototype.moveTo = function(e, t) {
  52731. this.actions.push({
  52732. action: "moveTo",
  52733. args: [e, t]
  52734. })
  52735. }
  52736. ,
  52737. Ci.Path.prototype.lineTo = function(e, t) {
  52738. var i = this.actions[this.actions.length - 1].args
  52739. , n = i[i.length - 2]
  52740. , r = i[i.length - 1]
  52741. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  52742. this.curves.push(o),
  52743. this.actions.push({
  52744. action: "lineTo",
  52745. args: [e, t]
  52746. })
  52747. }
  52748. ,
  52749. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  52750. var r = this.actions[this.actions.length - 1].args
  52751. , o = r[r.length - 2]
  52752. , a = r[r.length - 1]
  52753. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  52754. this.curves.push(s),
  52755. this.actions.push({
  52756. action: "quadraticCurveTo",
  52757. args: [e, t, i, n]
  52758. })
  52759. }
  52760. ,
  52761. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  52762. var a = this.actions[this.actions.length - 1].args
  52763. , s = a[a.length - 2]
  52764. , l = a[a.length - 1]
  52765. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  52766. this.curves.push(c),
  52767. this.actions.push({
  52768. action: "bezierCurveTo",
  52769. args: [e, t, i, n, r, o]
  52770. })
  52771. }
  52772. ,
  52773. Ci.Path.prototype.splineThru = function(e) {
  52774. var t = Array.prototype.slice.call(arguments)
  52775. , i = this.actions[this.actions.length - 1].args
  52776. , n = i[i.length - 2]
  52777. , r = i[i.length - 1]
  52778. , o = [new Ci.Vector2(n,r)];
  52779. Array.prototype.push.apply(o, e);
  52780. var a = new Ci.SplineCurve(o);
  52781. this.curves.push(a),
  52782. this.actions.push({
  52783. action: "splineThru",
  52784. args: t
  52785. })
  52786. }
  52787. ,
  52788. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  52789. var a = this.actions[this.actions.length - 1].args
  52790. , s = a[a.length - 2]
  52791. , l = a[a.length - 1];
  52792. this.absarc(e + s, t + l, i, n, r, o)
  52793. }
  52794. ,
  52795. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52796. this.absellipse(e, t, i, i, n, r, o)
  52797. }
  52798. ,
  52799. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52800. var l = this.actions[this.actions.length - 1].args
  52801. , c = l[l.length - 2]
  52802. , h = l[l.length - 1];
  52803. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52804. }
  52805. ,
  52806. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52807. var l = [e, t, i, n, r, o, a, s || 0]
  52808. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52809. this.curves.push(c);
  52810. var h = c.getPoint(1);
  52811. l.push(h.x),
  52812. l.push(h.y),
  52813. this.actions.push({
  52814. action: "ellipse",
  52815. args: l
  52816. })
  52817. }
  52818. ,
  52819. Ci.Path.prototype.getSpacedPoints = function(e) {
  52820. e = e || 40;
  52821. for (var t = [], i = 0; i < e; i++)
  52822. t.push(this.getPoint(i / e));
  52823. return this.autoClose && t.push(t[0]),
  52824. t
  52825. }
  52826. ,
  52827. Ci.Path.prototype.getPoints = function(e) {
  52828. e = e || 12;
  52829. for (var t, i, n, r, o, a, s, l, c, h, u, d = Ci.ShapeUtils.b2, p = Ci.ShapeUtils.b3, f = [], g = 0, m = this.actions.length; g < m; g++) {
  52830. var v = this.actions[g]
  52831. , y = v.action
  52832. , A = v.args;
  52833. switch (y) {
  52834. case "moveTo":
  52835. case "lineTo":
  52836. f.push(new Ci.Vector2(A[0],A[1]));
  52837. break;
  52838. case "quadraticCurveTo":
  52839. t = A[2],
  52840. i = A[3],
  52841. o = A[0],
  52842. a = A[1],
  52843. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52844. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52845. c[c.length - 1]);
  52846. for (var C = 1; C <= e; C++) {
  52847. h = d(O = C / e, s, o, t),
  52848. u = d(O, l, a, i),
  52849. f.push(new Ci.Vector2(h,u))
  52850. }
  52851. break;
  52852. case "bezierCurveTo":
  52853. t = A[4],
  52854. i = A[5],
  52855. o = A[0],
  52856. a = A[1],
  52857. n = A[2],
  52858. r = A[3],
  52859. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52860. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52861. c[c.length - 1]);
  52862. for (C = 1; C <= e; C++) {
  52863. h = p(O = C / e, s, o, n, t),
  52864. u = p(O, l, a, r, i),
  52865. f.push(new Ci.Vector2(h,u))
  52866. }
  52867. break;
  52868. case "splineThru":
  52869. c = this.actions[g - 1].args;
  52870. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52871. , E = e * A[0].length;
  52872. I = I.concat(A[0]);
  52873. var _ = new Ci.SplineCurve(I);
  52874. for (C = 1; C <= E; C++)
  52875. f.push(_.getPointAt(C / E));
  52876. break;
  52877. case "arc":
  52878. var b = A[0]
  52879. , w = A[1]
  52880. , T = A[2]
  52881. , x = A[3]
  52882. , S = A[4]
  52883. , M = !!A[5]
  52884. , R = S - x
  52885. , P = 2 * e;
  52886. for (C = 1; C <= P; C++) {
  52887. var O = C / P;
  52888. M || (O = 1 - O),
  52889. L = x + O * R,
  52890. h = b + T * Math.cos(L),
  52891. u = w + T * Math.sin(L),
  52892. f.push(new Ci.Vector2(h,u))
  52893. }
  52894. break;
  52895. case "ellipse":
  52896. b = A[0],
  52897. w = A[1];
  52898. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52899. S = A[5],
  52900. M = !!A[6],
  52901. A[7]);
  52902. R = S - x,
  52903. P = 2 * e;
  52904. 0 !== V && (D = Math.cos(V),
  52905. N = Math.sin(V));
  52906. for (C = 1; C <= P; C++) {
  52907. O = C / P;
  52908. if (M || (O = 1 - O),
  52909. L = x + O * R,
  52910. h = b + F * Math.cos(L),
  52911. u = w + B * Math.sin(L),
  52912. 0 !== V) {
  52913. var k = h;
  52914. h = (k - b) * D - (u - w) * N + b,
  52915. u = (k - b) * N + (u - w) * D + w
  52916. }
  52917. f.push(new Ci.Vector2(h,u))
  52918. }
  52919. }
  52920. }
  52921. var U = f[f.length - 1];
  52922. return Math.abs(U.x - f[0].x) < Number.EPSILON && Math.abs(U.y - f[0].y) < Number.EPSILON && f.splice(f.length - 1, 1),
  52923. this.autoClose && f.push(f[0]),
  52924. f
  52925. }
  52926. ,
  52927. Ci.Path.prototype.toShapes = function(e, t) {
  52928. function i(e) {
  52929. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52930. var r = e[i]
  52931. , o = new Ci.Shape;
  52932. o.actions = r.actions,
  52933. o.curves = r.curves,
  52934. t.push(o)
  52935. }
  52936. return t
  52937. }
  52938. function n(e, t) {
  52939. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52940. var a = t[r]
  52941. , s = t[o]
  52942. , l = s.x - a.x
  52943. , c = s.y - a.y;
  52944. if (Math.abs(c) > Number.EPSILON) {
  52945. if (c < 0 && (a = t[o],
  52946. l = -l,
  52947. s = t[r],
  52948. c = -c),
  52949. e.y < a.y || e.y > s.y)
  52950. continue;
  52951. if (e.y === a.y) {
  52952. if (e.x === a.x)
  52953. return !0
  52954. } else {
  52955. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52956. if (0 == h)
  52957. return !0;
  52958. if (h < 0)
  52959. continue;
  52960. n = !n
  52961. }
  52962. } else {
  52963. if (e.y !== a.y)
  52964. continue;
  52965. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52966. return !0
  52967. }
  52968. }
  52969. return n
  52970. }
  52971. var r = Ci.ShapeUtils.isClockWise
  52972. , o = function(e) {
  52973. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  52974. var o = e[n]
  52975. , a = o.args
  52976. , s = o.action;
  52977. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  52978. i = new Ci.Path),
  52979. i[s].apply(i, a)
  52980. }
  52981. return 0 !== i.actions.length && t.push(i),
  52982. t
  52983. }(this.actions);
  52984. if (0 === o.length)
  52985. return [];
  52986. if (!0 === t)
  52987. return i(o);
  52988. var a, s, l, c = [];
  52989. if (1 === o.length)
  52990. return s = o[0],
  52991. (l = new Ci.Shape).actions = s.actions,
  52992. l.curves = s.curves,
  52993. c.push(l),
  52994. c;
  52995. var h = !r(o[0].getPoints());
  52996. h = e ? !h : h;
  52997. var u, d = [], p = [], f = [], g = 0;
  52998. p[g] = void 0,
  52999. f[g] = [];
  53000. for (var m = 0, v = o.length; m < v; m++)
  53001. a = r(u = (s = o[m]).getPoints()),
  53002. (a = e ? !a : a) ? (!h && p[g] && g++,
  53003. p[g] = {
  53004. s: new Ci.Shape,
  53005. p: u
  53006. },
  53007. p[g].s.actions = s.actions,
  53008. p[g].s.curves = s.curves,
  53009. h && g++,
  53010. f[g] = []) : f[g].push({
  53011. h: s,
  53012. p: u[0]
  53013. });
  53014. if (!p[0])
  53015. return i(o);
  53016. if (1 < p.length) {
  53017. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  53018. d[C] = [];
  53019. for (C = 0,
  53020. I = p.length; C < I; C++)
  53021. for (var E = f[C], _ = 0; _ < E.length; _++) {
  53022. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  53023. n(b.p, p[T].p) && (C !== T && A.push({
  53024. froms: C,
  53025. tos: T,
  53026. hole: _
  53027. }),
  53028. w ? (w = !1,
  53029. d[T].push(b)) : y = !0);
  53030. w && d[C].push(b)
  53031. }
  53032. 0 < A.length && (y || (f = d))
  53033. }
  53034. m = 0;
  53035. for (var x, S = p.length; m < S; m++) {
  53036. l = p[m].s,
  53037. c.push(l);
  53038. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  53039. l.holes.push(x[M].h)
  53040. }
  53041. return c
  53042. }
  53043. ,
  53044. Ci.Shape = function() {
  53045. Ci.Path.apply(this, arguments),
  53046. this.holes = []
  53047. }
  53048. ,
  53049. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  53050. Ci.Shape.prototype.constructor = Ci.Shape,
  53051. Ci.Shape.prototype.extrude = function(e) {
  53052. return new Ci.ExtrudeGeometry(this,e)
  53053. }
  53054. ,
  53055. Ci.Shape.prototype.makeGeometry = function(e) {
  53056. return new Ci.ShapeGeometry(this,e)
  53057. }
  53058. ,
  53059. Ci.Shape.prototype.getPointsHoles = function(e) {
  53060. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  53061. t[i] = this.holes[i].getPoints(e);
  53062. return t
  53063. }
  53064. ,
  53065. Ci.Shape.prototype.extractAllPoints = function(e) {
  53066. return {
  53067. shape: this.getPoints(e),
  53068. holes: this.getPointsHoles(e)
  53069. }
  53070. }
  53071. ,
  53072. Ci.Shape.prototype.extractPoints = function(e) {
  53073. return this.extractAllPoints(e)
  53074. }
  53075. ,
  53076. Ci.LineCurve = function(e, t) {
  53077. this.v1 = e,
  53078. this.v2 = t
  53079. }
  53080. ,
  53081. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  53082. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  53083. Ci.LineCurve.prototype.getPoint = function(e) {
  53084. var t = this.v2.clone().sub(this.v1);
  53085. return t.multiplyScalar(e).add(this.v1),
  53086. t
  53087. }
  53088. ,
  53089. Ci.LineCurve.prototype.getPointAt = function(e) {
  53090. return this.getPoint(e)
  53091. }
  53092. ,
  53093. Ci.LineCurve.prototype.getTangent = function(e) {
  53094. return this.v2.clone().sub(this.v1).normalize()
  53095. }
  53096. ,
  53097. Ci.QuadraticBezierCurve = function(e, t, i) {
  53098. this.v0 = e,
  53099. this.v1 = t,
  53100. this.v2 = i
  53101. }
  53102. ,
  53103. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  53104. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  53105. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  53106. var t = Ci.ShapeUtils.b2;
  53107. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y))
  53108. }
  53109. ,
  53110. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  53111. var t = Ci.CurveUtils.tangentQuadraticBezier;
  53112. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y)).normalize()
  53113. }
  53114. ,
  53115. Ci.CubicBezierCurve = function(e, t, i, n) {
  53116. this.v0 = e,
  53117. this.v1 = t,
  53118. this.v2 = i,
  53119. this.v3 = n
  53120. }
  53121. ,
  53122. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  53123. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  53124. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  53125. var t = Ci.ShapeUtils.b3;
  53126. return new Ci.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))
  53127. }
  53128. ,
  53129. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  53130. var t = Ci.CurveUtils.tangentCubicBezier;
  53131. return new Ci.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()
  53132. }
  53133. ,
  53134. Ci.SplineCurve = function(e) {
  53135. this.points = null == e ? [] : e
  53136. }
  53137. ,
  53138. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  53139. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  53140. Ci.SplineCurve.prototype.getPoint = function(e) {
  53141. var t = this.points
  53142. , i = (t.length - 1) * e
  53143. , n = Math.floor(i)
  53144. , r = i - n
  53145. , o = t[0 === n ? n : n - 1]
  53146. , a = t[n]
  53147. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  53148. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  53149. , c = Ci.CurveUtils.interpolate;
  53150. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  53151. }
  53152. ,
  53153. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  53154. this.aX = e,
  53155. this.aY = t,
  53156. this.xRadius = i,
  53157. this.yRadius = n,
  53158. this.aStartAngle = r,
  53159. this.aEndAngle = o,
  53160. this.aClockwise = a,
  53161. this.aRotation = s || 0
  53162. }
  53163. ,
  53164. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  53165. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  53166. Ci.EllipseCurve.prototype.getPoint = function(e) {
  53167. var t, i = this.aEndAngle - this.aStartAngle;
  53168. i < 0 && (i += 2 * Math.PI),
  53169. i > 2 * Math.PI && (i -= 2 * Math.PI),
  53170. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  53171. var n = this.aX + this.xRadius * Math.cos(t)
  53172. , r = this.aY + this.yRadius * Math.sin(t);
  53173. if (0 !== this.aRotation) {
  53174. var o = Math.cos(this.aRotation)
  53175. , a = Math.sin(this.aRotation)
  53176. , s = n
  53177. , l = r;
  53178. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  53179. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  53180. }
  53181. return new Ci.Vector2(n,r)
  53182. }
  53183. ,
  53184. Ci.ArcCurve = function(e, t, i, n, r, o) {
  53185. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  53186. }
  53187. ,
  53188. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  53189. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  53190. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  53191. this.v1 = e,
  53192. this.v2 = t
  53193. }, function(e) {
  53194. var t = new Ci.Vector3;
  53195. return t.subVectors(this.v2, this.v1),
  53196. t.multiplyScalar(e),
  53197. t.add(this.v1),
  53198. t
  53199. }),
  53200. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  53201. this.v0 = e,
  53202. this.v1 = t,
  53203. this.v2 = i
  53204. }, function(e) {
  53205. var t = Ci.ShapeUtils.b2;
  53206. return new Ci.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))
  53207. }),
  53208. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  53209. this.v0 = e,
  53210. this.v1 = t,
  53211. this.v2 = i,
  53212. this.v3 = n
  53213. }, function(e) {
  53214. var t = Ci.ShapeUtils.b3;
  53215. return new Ci.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))
  53216. }),
  53217. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  53218. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  53219. this.points = null == e ? [] : e
  53220. }, function(e) {
  53221. var t = this.points
  53222. , i = (t.length - 1) * e
  53223. , n = Math.floor(i)
  53224. , r = i - n
  53225. , o = t[0 == n ? n : n - 1]
  53226. , a = t[n]
  53227. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  53228. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  53229. , c = Ci.CurveUtils.interpolate;
  53230. return new Ci.Vector3(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r),c(o.z, a.z, s.z, l.z, r))
  53231. }),
  53232. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  53233. Xt = new xi,
  53234. Zt = new xi,
  53235. Kt = new xi,
  53236. xi.prototype.init = function(e, t, i, n) {
  53237. this.c0 = e,
  53238. this.c1 = i,
  53239. this.c2 = -3 * e + 3 * t - 2 * i - n,
  53240. this.c3 = 2 * e - 2 * t + i + n
  53241. }
  53242. ,
  53243. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  53244. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  53245. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  53246. s *= o,
  53247. l *= o,
  53248. this.init(t, i, s, l)
  53249. }
  53250. ,
  53251. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  53252. this.init(t, i, r * (i - e), r * (n - t))
  53253. }
  53254. ,
  53255. xi.prototype.calc = function(e) {
  53256. var t = e * e
  53257. , i = t * e;
  53258. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  53259. }
  53260. ,
  53261. Ci.Curve.create(function(e) {
  53262. this.points = e || [],
  53263. this.closed = !1
  53264. }, function(e) {
  53265. var t, i, n, r, o, a, s, l, c = this.points;
  53266. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  53267. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  53268. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  53269. n = 1),
  53270. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  53271. qt),
  53272. a = c[i % r],
  53273. s = c[(i + 1) % r],
  53274. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  53275. qt),
  53276. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  53277. var h = "chordal" === this.type ? .5 : .25
  53278. , u = Math.pow(o.distanceToSquared(a), h)
  53279. , d = Math.pow(a.distanceToSquared(s), h)
  53280. , p = Math.pow(s.distanceToSquared(l), h);
  53281. d < 1e-4 && (d = 1),
  53282. u < 1e-4 && (u = d),
  53283. p < 1e-4 && (p = d),
  53284. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  53285. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  53286. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  53287. } else if ("catmullrom" === this.type) {
  53288. var f = void 0 !== this.tension ? this.tension : .5;
  53289. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  53290. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  53291. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  53292. }
  53293. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  53294. })),
  53295. Ci.ClosedSplineCurve3 = function(e) {
  53296. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  53297. Ci.CatmullRomCurve3.call(this, e),
  53298. this.type = "catmullrom",
  53299. this.closed = !0
  53300. }
  53301. ,
  53302. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  53303. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  53304. Ci.Geometry.call(this),
  53305. this.type = "BoxGeometry",
  53306. this.parameters = {
  53307. width: e,
  53308. height: t,
  53309. depth: i,
  53310. widthSegments: n,
  53311. heightSegments: r,
  53312. depthSegments: o
  53313. },
  53314. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  53315. this.mergeVertices()
  53316. }
  53317. ,
  53318. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53319. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  53320. Ci.CubeGeometry = Ci.BoxGeometry,
  53321. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  53322. function a(e, t, i, n, r, o, a, s, l, c, h) {
  53323. for (var u = o / l, d = a / c, p = o / 2, f = a / 2, g = s / 2, m = l + 1, v = c + 1, y = 0, A = 0, C = new Ci.Vector3, I = 0; I < v; I++)
  53324. for (var E = I * d - f, _ = 0; _ < m; _++) {
  53325. var b = _ * u - p;
  53326. C[e] = b * n,
  53327. C[t] = E * r,
  53328. C[i] = g,
  53329. P[D] = C.x,
  53330. P[D + 1] = C.y,
  53331. P[D + 2] = C.z,
  53332. C[e] = 0,
  53333. C[t] = 0,
  53334. C[i] = 0 < s ? 1 : -1,
  53335. O[D] = C.x,
  53336. O[D + 1] = C.y,
  53337. O[D + 2] = C.z,
  53338. L[N] = _ / l,
  53339. L[N + 1] = 1 - I / c,
  53340. D += 3,
  53341. N += 2,
  53342. y += 1
  53343. }
  53344. for (I = 0; I < c; I++)
  53345. for (_ = 0; _ < l; _++) {
  53346. var w = B + _ + m * I
  53347. , T = B + _ + m * (I + 1)
  53348. , x = B + (_ + 1) + m * (I + 1)
  53349. , S = B + (_ + 1) + m * I;
  53350. R[F] = w,
  53351. R[F + 1] = T,
  53352. R[F + 2] = S,
  53353. R[F + 3] = T,
  53354. R[F + 4] = x,
  53355. R[F + 5] = S,
  53356. F += 6,
  53357. A += 6
  53358. }
  53359. M.addGroup(V, A, h),
  53360. V += A,
  53361. B += y
  53362. }
  53363. Ci.BufferGeometry.call(this),
  53364. this.type = "BoxBufferGeometry",
  53365. this.parameters = {
  53366. width: e,
  53367. height: t,
  53368. depth: i,
  53369. widthSegments: n,
  53370. heightSegments: r,
  53371. depthSegments: o
  53372. };
  53373. var M = this;
  53374. n = Math.floor(n) || 1,
  53375. r = Math.floor(r) || 1,
  53376. o = Math.floor(o) || 1;
  53377. var s, l, c, h, u = (h = 0,
  53378. h += (s = n) * (l = r) * 2,
  53379. h += s * (c = o) * 2,
  53380. 4 * (h += c * l * 2)), d = u / 4 * 6, R = new (65535 < d ? Uint32Array : Uint16Array)(d), P = new Float32Array(3 * u), O = new Float32Array(3 * u), L = new Float32Array(2 * u), D = 0, N = 0, F = 0, B = 0, V = 0;
  53381. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  53382. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  53383. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  53384. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  53385. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  53386. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  53387. this.setIndex(new Ci.BufferAttribute(R,1)),
  53388. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  53389. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  53390. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  53391. }
  53392. ,
  53393. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53394. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  53395. Ci.CircleGeometry = function(e, t, i, n) {
  53396. Ci.Geometry.call(this),
  53397. this.type = "CircleGeometry",
  53398. this.parameters = {
  53399. radius: e,
  53400. segments: t,
  53401. thetaStart: i,
  53402. thetaLength: n
  53403. },
  53404. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  53405. }
  53406. ,
  53407. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53408. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  53409. Ci.CircleBufferGeometry = function(e, t, i, n) {
  53410. Ci.BufferGeometry.call(this),
  53411. this.type = "CircleBufferGeometry",
  53412. this.parameters = {
  53413. radius: e,
  53414. segments: t,
  53415. thetaStart: i,
  53416. thetaLength: n
  53417. },
  53418. e = e || 50,
  53419. t = void 0 !== t ? Math.max(3, t) : 8,
  53420. i = void 0 !== i ? i : 0,
  53421. n = void 0 !== n ? n : 2 * Math.PI;
  53422. var r = t + 2
  53423. , o = new Float32Array(3 * r)
  53424. , a = new Float32Array(3 * r)
  53425. , s = new Float32Array(2 * r);
  53426. a[2] = 1,
  53427. s[0] = .5,
  53428. s[1] = .5;
  53429. for (var l = 0, c = 3, h = 2; l <= t; l++,
  53430. c += 3,
  53431. h += 2) {
  53432. var u = i + l / t * n;
  53433. o[c] = e * Math.cos(u),
  53434. o[c + 1] = e * Math.sin(u),
  53435. a[c + 2] = 1,
  53436. s[h] = (o[c] / e + 1) / 2,
  53437. s[h + 1] = (o[c + 1] / e + 1) / 2
  53438. }
  53439. var d = [];
  53440. for (c = 1; c <= t; c++)
  53441. d.push(c, c + 1, 0);
  53442. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  53443. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  53444. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  53445. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  53446. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53447. }
  53448. ,
  53449. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53450. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  53451. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  53452. function t(e) {
  53453. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  53454. for (i = b,
  53455. t = 1; t <= m; t++)
  53456. I.setXYZ(b, 0, x * s, 0),
  53457. E.setXYZ(b, 0, s, 0),
  53458. !0 === e ? (r.x = t / m,
  53459. r.y = 0) : (r.x = (t - 1) / m,
  53460. r.y = 1),
  53461. _.setXY(b, r.x, r.y),
  53462. b++;
  53463. for (n = b,
  53464. t = 0; t <= m; t++) {
  53465. var l = t / m;
  53466. o.x = a * Math.sin(l * A + y),
  53467. o.y = x * s,
  53468. o.z = a * Math.cos(l * A + y),
  53469. I.setXYZ(b, o.x, o.y, o.z),
  53470. E.setXYZ(b, 0, s, 0),
  53471. _.setXY(b, l, !0 === e ? 1 : 0),
  53472. b++
  53473. }
  53474. for (t = 0; t < m; t++) {
  53475. var c = i + t
  53476. , h = n + t;
  53477. !0 === e ? (C.setX(w, h),
  53478. w++,
  53479. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  53480. w++,
  53481. C.setX(w, h)),
  53482. w++,
  53483. C.setX(w, c),
  53484. w++
  53485. }
  53486. }
  53487. Ci.BufferGeometry.call(this),
  53488. this.type = "CylinderBufferGeometry",
  53489. this.parameters = {
  53490. radiusTop: p,
  53491. radiusBottom: f,
  53492. height: g,
  53493. radialSegments: m,
  53494. heightSegments: v,
  53495. openEnded: e,
  53496. thetaStart: y,
  53497. thetaLength: A
  53498. },
  53499. p = void 0 !== p ? p : 20,
  53500. f = void 0 !== f ? f : 20,
  53501. g = void 0 !== g ? g : 100,
  53502. m = Math.floor(m) || 8,
  53503. v = Math.floor(v) || 1,
  53504. e = void 0 !== e && e,
  53505. y = void 0 !== y ? y : 0,
  53506. A = void 0 !== A ? A : 2 * Math.PI;
  53507. var i, n, r = (n = (m + 1) * (v + 1),
  53508. !1 === e && (n += 2 * (m + 1) + 2 * m),
  53509. n), o = (i = m * v * 2 * 3,
  53510. !1 === e && (i += 2 * m * 3),
  53511. i), C = new Ci.BufferAttribute(new (65535 < o ? Uint32Array : Uint16Array)(o),1), I = new Ci.BufferAttribute(new Float32Array(3 * r),3), E = new Ci.BufferAttribute(new Float32Array(3 * r),3), _ = new Ci.BufferAttribute(new Float32Array(2 * r),2), b = 0, w = 0, T = [], x = g / 2;
  53512. (function() {
  53513. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  53514. for (t = 0; t <= v; t++) {
  53515. var o = []
  53516. , a = t / v
  53517. , s = a * (f - p) + p;
  53518. for (e = 0; e <= m; e++) {
  53519. var l = e / m;
  53520. n.x = s * Math.sin(l * A + y),
  53521. n.y = -a * g + x,
  53522. n.z = s * Math.cos(l * A + y),
  53523. I.setXYZ(b, n.x, n.y, n.z),
  53524. i.copy(n),
  53525. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  53526. i.z = Math.cos(l * A + y)),
  53527. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  53528. E.setXYZ(b, i.x, i.y, i.z),
  53529. _.setXY(b, l, 1 - a),
  53530. o.push(b),
  53531. b++
  53532. }
  53533. T.push(o)
  53534. }
  53535. for (e = 0; e < m; e++)
  53536. for (t = 0; t < v; t++) {
  53537. var c = T[t][e]
  53538. , h = T[t + 1][e]
  53539. , u = T[t + 1][e + 1]
  53540. , d = T[t][e + 1];
  53541. C.setX(w, c),
  53542. w++,
  53543. C.setX(w, h),
  53544. w++,
  53545. C.setX(w, d),
  53546. w++,
  53547. C.setX(w, h),
  53548. w++,
  53549. C.setX(w, u),
  53550. w++,
  53551. C.setX(w, d),
  53552. w++
  53553. }
  53554. }
  53555. )(),
  53556. !1 === e && (0 < p && t(!0),
  53557. 0 < f && t(!1)),
  53558. this.setIndex(C),
  53559. this.addAttribute("position", I),
  53560. this.addAttribute("normal", E),
  53561. this.addAttribute("uv", _)
  53562. }
  53563. ,
  53564. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53565. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  53566. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  53567. Ci.Geometry.call(this),
  53568. this.type = "CylinderGeometry",
  53569. this.parameters = {
  53570. radiusTop: e,
  53571. radiusBottom: t,
  53572. height: i,
  53573. radialSegments: n,
  53574. heightSegments: r,
  53575. openEnded: o,
  53576. thetaStart: a,
  53577. thetaLength: s
  53578. },
  53579. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  53580. this.mergeVertices()
  53581. }
  53582. ,
  53583. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53584. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  53585. Ci.EdgesGeometry = function(e, t) {
  53586. function i(e, t) {
  53587. return e - t
  53588. }
  53589. Ci.BufferGeometry.call(this),
  53590. t = void 0 !== t ? t : 1;
  53591. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  53592. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  53593. n.mergeVertices(),
  53594. n.computeFaceNormals();
  53595. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  53596. for (var d = c[h], p = 0; p < 3; p++) {
  53597. o[0] = d[s[p]],
  53598. o[1] = d[s[(p + 1) % 3]],
  53599. o.sort(i),
  53600. void 0 === a[g = o.toString()] ? a[g] = {
  53601. vert1: o[0],
  53602. vert2: o[1],
  53603. face1: h,
  53604. face2: void 0
  53605. } : a[g].face2 = h
  53606. }
  53607. var f = [];
  53608. for (var g in a) {
  53609. var m = a[g];
  53610. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  53611. var v = l[m.vert1];
  53612. f.push(v.x),
  53613. f.push(v.y),
  53614. f.push(v.z),
  53615. v = l[m.vert2],
  53616. f.push(v.x),
  53617. f.push(v.y),
  53618. f.push(v.z)
  53619. }
  53620. }
  53621. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  53622. }
  53623. ,
  53624. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53625. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  53626. Ci.ExtrudeGeometry = function(e, t) {
  53627. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  53628. this.type = "ExtrudeGeometry",
  53629. e = Array.isArray(e) ? e : [e],
  53630. this.addShapeList(e, t),
  53631. void this.computeFaceNormals())
  53632. }
  53633. ;
  53634. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53635. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  53636. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53637. for (var i = e.length, n = 0; n < i; n++) {
  53638. var r = e[n];
  53639. this.addShape(r, t)
  53640. }
  53641. }
  53642. ,
  53643. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53644. function i(e, t, i) {
  53645. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53646. t.clone().multiplyScalar(i).add(e)
  53647. }
  53648. function n(e, t, i) {
  53649. var n, r, o = 1, a = e.x - t.x, s = e.y - t.y, l = i.x - e.x, c = i.y - e.y, h = a * a + s * s, u = a * c - s * l;
  53650. if (Math.abs(u) > Number.EPSILON) {
  53651. var d = Math.sqrt(h)
  53652. , p = Math.sqrt(l * l + c * c)
  53653. , f = t.x - s / d
  53654. , g = t.y + a / d
  53655. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  53656. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  53657. if (v <= 2)
  53658. return new Ci.Vector2(n,r);
  53659. o = Math.sqrt(v / 2)
  53660. } else {
  53661. var y = !1;
  53662. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  53663. o = y ? (n = -s,
  53664. r = a,
  53665. Math.sqrt(h)) : (n = a,
  53666. r = s,
  53667. Math.sqrt(h / 2))
  53668. }
  53669. return new Ci.Vector2(n / o,r / o)
  53670. }
  53671. function r(e, t) {
  53672. var i, n;
  53673. for (G = e.length; 0 <= --G; ) {
  53674. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  53675. var r = 0
  53676. , o = A + 2 * m;
  53677. for (r = 0; r < o; r++) {
  53678. var a = U * r
  53679. , s = U * (r + 1);
  53680. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  53681. }
  53682. }
  53683. }
  53684. function o(e, t, i) {
  53685. T.vertices.push(new Ci.Vector3(e,t,i))
  53686. }
  53687. function a(e, t, i) {
  53688. e += x,
  53689. t += x,
  53690. i += x,
  53691. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  53692. var n = E.generateTopUV(T, e, t, i);
  53693. T.faceVertexUvs[0].push(n)
  53694. }
  53695. function l(e, t, i, n) {
  53696. e += x,
  53697. t += x,
  53698. i += x,
  53699. n += x,
  53700. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  53701. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  53702. var r = E.generateSideWallUV(T, e, t, i, n);
  53703. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  53704. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  53705. }
  53706. var s, c, h, u, d, p = void 0 !== t.amount ? t.amount : 100, f = void 0 !== t.bevelThickness ? t.bevelThickness : 6, g = void 0 !== t.bevelSize ? t.bevelSize : f - 2, m = void 0 !== t.bevelSegments ? t.bevelSegments : 3, v = void 0 === t.bevelEnabled || t.bevelEnabled, y = void 0 !== t.curveSegments ? t.curveSegments : 12, A = void 0 !== t.steps ? t.steps : 1, C = t.extrudePath, I = !1, E = void 0 !== t.UVGenerator ? t.UVGenerator : Ci.ExtrudeGeometry.WorldUVGenerator;
  53707. C && (s = C.getSpacedPoints(A),
  53708. v = !(I = !0),
  53709. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  53710. h = new Ci.Vector3,
  53711. u = new Ci.Vector3,
  53712. d = new Ci.Vector3),
  53713. v || (g = f = m = 0);
  53714. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  53715. if (P) {
  53716. for (M = M.reverse(),
  53717. b = 0,
  53718. w = R.length; b < w; b++)
  53719. _ = R[b],
  53720. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  53721. P = !1
  53722. }
  53723. var O = Ci.ShapeUtils.triangulateShape(M, R)
  53724. , L = M;
  53725. for (b = 0,
  53726. w = R.length; b < w; b++)
  53727. _ = R[b],
  53728. M = M.concat(_);
  53729. for (var D, N, F, B, V, k, U = M.length, H = O.length, z = [], G = 0, W = L.length, j = W - 1, Y = G + 1; G < W; G++,
  53730. j++,
  53731. Y++)
  53732. j === W && (j = 0),
  53733. Y === W && (Y = 0),
  53734. z[G] = n(L[G], L[j], L[Y]);
  53735. var q, X, Z = [], K = z.concat();
  53736. for (b = 0,
  53737. w = R.length; b < w; b++) {
  53738. for (_ = R[b],
  53739. q = [],
  53740. G = 0,
  53741. j = (W = _.length) - 1,
  53742. Y = G + 1; G < W; G++,
  53743. j++,
  53744. Y++)
  53745. j === W && (j = 0),
  53746. Y === W && (Y = 0),
  53747. q[G] = n(_[G], _[j], _[Y]);
  53748. Z.push(q),
  53749. K = K.concat(q)
  53750. }
  53751. for (D = 0; D < m; D++) {
  53752. for (B = f * (1 - (F = D / m)),
  53753. N = g * Math.sin(F * Math.PI / 2),
  53754. G = 0,
  53755. W = L.length; G < W; G++)
  53756. o((V = i(L[G], z[G], N)).x, V.y, -B);
  53757. for (b = 0,
  53758. w = R.length; b < w; b++)
  53759. for (_ = R[b],
  53760. q = Z[b],
  53761. G = 0,
  53762. W = _.length; G < W; G++)
  53763. o((V = i(_[G], q[G], N)).x, V.y, -B)
  53764. }
  53765. for (N = g,
  53766. G = 0; G < U; G++)
  53767. V = v ? i(M[G], K[G], N) : M[G],
  53768. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  53769. h.copy(c.binormals[0]).multiplyScalar(V.y),
  53770. d.copy(s[0]).add(u).add(h),
  53771. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  53772. for (X = 1; X <= A; X++)
  53773. for (G = 0; G < U; G++)
  53774. V = v ? i(M[G], K[G], N) : M[G],
  53775. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  53776. h.copy(c.binormals[X]).multiplyScalar(V.y),
  53777. d.copy(s[X]).add(u).add(h),
  53778. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  53779. for (D = m - 1; 0 <= D; D--) {
  53780. for (B = f * (1 - (F = D / m)),
  53781. N = g * Math.sin(F * Math.PI / 2),
  53782. G = 0,
  53783. W = L.length; G < W; G++)
  53784. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  53785. for (b = 0,
  53786. w = R.length; b < w; b++)
  53787. for (_ = R[b],
  53788. q = Z[b],
  53789. G = 0,
  53790. W = _.length; G < W; G++)
  53791. V = i(_[G], q[G], N),
  53792. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53793. }
  53794. (function() {
  53795. if (v) {
  53796. var e = 0
  53797. , t = U * e;
  53798. for (G = 0; G < H; G++)
  53799. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53800. for (t = U * (e = A + 2 * m),
  53801. G = 0; G < H; G++)
  53802. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53803. } else {
  53804. for (G = 0; G < H; G++)
  53805. a((k = O[G])[2], k[1], k[0]);
  53806. for (G = 0; G < H; G++)
  53807. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53808. }
  53809. }
  53810. )(),
  53811. function() {
  53812. var e = 0;
  53813. for (r(L, e),
  53814. e += L.length,
  53815. b = 0,
  53816. w = R.length; b < w; b++)
  53817. r(_ = R[b], e),
  53818. e += _.length
  53819. }()
  53820. }
  53821. ,
  53822. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53823. generateTopUV: function(e, t, i, n) {
  53824. var r = e.vertices
  53825. , o = r[t]
  53826. , a = r[i]
  53827. , s = r[n];
  53828. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53829. },
  53830. generateSideWallUV: function(e, t, i, n, r) {
  53831. var o = e.vertices
  53832. , a = o[t]
  53833. , s = o[i]
  53834. , l = o[n]
  53835. , c = o[r];
  53836. return Math.abs(a.y - s.y) < .01 ? [new Ci.Vector2(a.x,1 - a.z), new Ci.Vector2(s.x,1 - s.z), new Ci.Vector2(l.x,1 - l.z), new Ci.Vector2(c.x,1 - c.z)] : [new Ci.Vector2(a.y,1 - a.z), new Ci.Vector2(s.y,1 - s.z), new Ci.Vector2(l.y,1 - l.z), new Ci.Vector2(c.y,1 - c.z)]
  53837. }
  53838. },
  53839. Ci.ShapeGeometry = function(e, t) {
  53840. Ci.Geometry.call(this),
  53841. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53842. this.addShapeList(e, t),
  53843. this.computeFaceNormals()
  53844. }
  53845. ,
  53846. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53847. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53848. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53849. for (var i = 0, n = e.length; i < n; i++)
  53850. this.addShape(e[i], t);
  53851. return this
  53852. }
  53853. ,
  53854. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53855. void 0 === t && (t = {});
  53856. var i, n, r, o = void 0 !== t.curveSegments ? t.curveSegments : 12, a = t.material, s = void 0 === t.UVGenerator ? Ci.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator, l = this.vertices.length, c = e.extractPoints(o), h = c.shape, u = c.holes, d = !Ci.ShapeUtils.isClockWise(h);
  53857. if (d) {
  53858. for (h = h.reverse(),
  53859. i = 0,
  53860. n = u.length; i < n; i++)
  53861. r = u[i],
  53862. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53863. d = !1
  53864. }
  53865. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53866. for (i = 0,
  53867. n = u.length; i < n; i++)
  53868. r = u[i],
  53869. h = h.concat(r);
  53870. var f, g, m = h.length, v = p.length;
  53871. for (i = 0; i < m; i++)
  53872. f = h[i],
  53873. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53874. for (i = 0; i < v; i++) {
  53875. var y = (g = p[i])[0] + l
  53876. , A = g[1] + l
  53877. , C = g[2] + l;
  53878. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53879. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53880. }
  53881. }
  53882. ,
  53883. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53884. Ci.BufferGeometry.call(this),
  53885. this.type = "LatheBufferGeometry",
  53886. this.parameters = {
  53887. points: e,
  53888. segments: t,
  53889. phiStart: i,
  53890. phiLength: n
  53891. },
  53892. t = Math.floor(t) || 12,
  53893. i = i || 0,
  53894. n = n || 2 * Math.PI,
  53895. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53896. var r, o, a, s = (t + 1) * e.length, l = t * e.length * 2 * 3, c = new Ci.BufferAttribute(new (65535 < l ? Uint32Array : Uint16Array)(l),1), h = new Ci.BufferAttribute(new Float32Array(3 * s),3), u = new Ci.BufferAttribute(new Float32Array(2 * s),2), d = 0, p = 0, f = (e.length,
  53897. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53898. for (o = 0; o <= t; o++) {
  53899. var v = i + o * f * n
  53900. , y = Math.sin(v)
  53901. , A = Math.cos(v);
  53902. for (a = 0; a <= e.length - 1; a++)
  53903. g.x = e[a].x * y,
  53904. g.y = e[a].y,
  53905. g.z = e[a].x * A,
  53906. h.setXYZ(d, g.x, g.y, g.z),
  53907. m.x = o / t,
  53908. m.y = a / (e.length - 1),
  53909. u.setXY(d, m.x, m.y),
  53910. d++
  53911. }
  53912. for (o = 0; o < t; o++)
  53913. for (a = 0; a < e.length - 1; a++) {
  53914. var C = r = a + o * e.length
  53915. , I = r + e.length
  53916. , E = r + e.length + 1
  53917. , _ = r + 1;
  53918. c.setX(p, C),
  53919. p++,
  53920. c.setX(p, I),
  53921. p++,
  53922. c.setX(p, _),
  53923. p++,
  53924. c.setX(p, I),
  53925. p++,
  53926. c.setX(p, E),
  53927. p++,
  53928. c.setX(p, _),
  53929. p++
  53930. }
  53931. if (this.setIndex(c),
  53932. this.addAttribute("position", h),
  53933. this.addAttribute("uv", u),
  53934. this.computeVertexNormals(),
  53935. n === 2 * Math.PI) {
  53936. var b = this.attributes.normal.array
  53937. , w = new Ci.Vector3
  53938. , T = new Ci.Vector3
  53939. , x = new Ci.Vector3;
  53940. for (r = t * e.length * 3,
  53941. a = o = 0; o < e.length; o++,
  53942. a += 3)
  53943. w.x = b[a + 0],
  53944. w.y = b[a + 1],
  53945. w.z = b[a + 2],
  53946. T.x = b[r + a + 0],
  53947. T.y = b[r + a + 1],
  53948. T.z = b[r + a + 2],
  53949. x.addVectors(w, T).normalize(),
  53950. b[a + 0] = b[r + a + 0] = x.x,
  53951. b[a + 1] = b[r + a + 1] = x.y,
  53952. b[a + 2] = b[r + a + 2] = x.z
  53953. }
  53954. }
  53955. ,
  53956. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53957. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  53958. Ci.LatheGeometry = function(e, t, i, n) {
  53959. Ci.Geometry.call(this),
  53960. this.type = "LatheGeometry",
  53961. this.parameters = {
  53962. points: e,
  53963. segments: t,
  53964. phiStart: i,
  53965. phiLength: n
  53966. },
  53967. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  53968. this.mergeVertices()
  53969. }
  53970. ,
  53971. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53972. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  53973. Ci.PlaneGeometry = function(e, t, i, n) {
  53974. Ci.Geometry.call(this),
  53975. this.type = "PlaneGeometry",
  53976. this.parameters = {
  53977. width: e,
  53978. height: t,
  53979. widthSegments: i,
  53980. heightSegments: n
  53981. },
  53982. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  53983. }
  53984. ,
  53985. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53986. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  53987. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  53988. Ci.BufferGeometry.call(this),
  53989. this.type = "PlaneBufferGeometry",
  53990. this.parameters = {
  53991. width: e,
  53992. height: t,
  53993. widthSegments: i,
  53994. heightSegments: n
  53995. };
  53996. for (var r = e / 2, o = t / 2, a = Math.floor(i) || 1, s = Math.floor(n) || 1, l = a + 1, c = s + 1, h = e / a, u = t / s, d = new Float32Array(l * c * 3), p = new Float32Array(l * c * 3), f = new Float32Array(l * c * 2), g = 0, m = 0, v = 0; v < c; v++)
  53997. for (var y = v * u - o, A = 0; A < l; A++) {
  53998. var C = A * h - r;
  53999. d[g] = C,
  54000. d[g + 1] = -y,
  54001. p[g + 2] = 1,
  54002. f[m] = A / a,
  54003. f[m + 1] = 1 - v / s,
  54004. g += 3,
  54005. m += 2
  54006. }
  54007. g = 0;
  54008. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  54009. for (v = 0; v < s; v++)
  54010. for (A = 0; A < a; A++) {
  54011. var E = A + l * v
  54012. , _ = A + l * (v + 1)
  54013. , b = A + 1 + l * (v + 1)
  54014. , w = A + 1 + l * v;
  54015. I[g] = E,
  54016. I[g + 1] = _,
  54017. I[g + 2] = w,
  54018. I[g + 3] = _,
  54019. I[g + 4] = b,
  54020. I[g + 5] = w,
  54021. g += 6
  54022. }
  54023. this.setIndex(new Ci.BufferAttribute(I,1)),
  54024. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  54025. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  54026. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  54027. }
  54028. ,
  54029. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54030. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  54031. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  54032. Ci.BufferGeometry.call(this),
  54033. this.type = "RingBufferGeometry",
  54034. this.parameters = {
  54035. innerRadius: e,
  54036. outerRadius: t,
  54037. thetaSegments: i,
  54038. phiSegments: n,
  54039. thetaStart: r,
  54040. thetaLength: o
  54041. },
  54042. e = e || 20,
  54043. t = t || 50,
  54044. r = void 0 !== r ? r : 0,
  54045. o = void 0 !== o ? o : 2 * Math.PI;
  54046. var a, s, l, c = ((i = void 0 !== i ? Math.max(3, i) : 8) + 1) * ((n = void 0 !== n ? Math.max(1, n) : 1) + 1), h = i * n * 2 * 3, u = new Ci.BufferAttribute(new (65535 < h ? Uint32Array : Uint16Array)(h),1), d = new Ci.BufferAttribute(new Float32Array(3 * c),3), p = new Ci.BufferAttribute(new Float32Array(3 * c),3), f = new Ci.BufferAttribute(new Float32Array(2 * c),2), g = 0, m = 0, v = e, y = (t - e) / n, A = new Ci.Vector3, C = new Ci.Vector2;
  54047. for (s = 0; s <= n; s++) {
  54048. for (l = 0; l <= i; l++)
  54049. a = r + l / i * o,
  54050. A.x = v * Math.cos(a),
  54051. A.y = v * Math.sin(a),
  54052. d.setXYZ(g, A.x, A.y, A.z),
  54053. p.setXYZ(g, 0, 0, 1),
  54054. C.x = (A.x / t + 1) / 2,
  54055. C.y = (A.y / t + 1) / 2,
  54056. f.setXY(g, C.x, C.y),
  54057. g++;
  54058. v += y
  54059. }
  54060. for (s = 0; s < n; s++) {
  54061. var I = s * (i + 1);
  54062. for (l = 0; l < i; l++) {
  54063. var E = a = l + I
  54064. , _ = a + i + 1
  54065. , b = a + i + 2
  54066. , w = a + 1;
  54067. u.setX(m, E),
  54068. m++,
  54069. u.setX(m, _),
  54070. m++,
  54071. u.setX(m, b),
  54072. m++,
  54073. u.setX(m, E),
  54074. m++,
  54075. u.setX(m, b),
  54076. m++,
  54077. u.setX(m, w),
  54078. m++
  54079. }
  54080. }
  54081. this.setIndex(u),
  54082. this.addAttribute("position", d),
  54083. this.addAttribute("normal", p),
  54084. this.addAttribute("uv", f)
  54085. }
  54086. ,
  54087. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54088. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  54089. Ci.RingGeometry = function(e, t, i, n, r, o) {
  54090. Ci.Geometry.call(this),
  54091. this.type = "RingGeometry",
  54092. this.parameters = {
  54093. innerRadius: e,
  54094. outerRadius: t,
  54095. thetaSegments: i,
  54096. phiSegments: n,
  54097. thetaStart: r,
  54098. thetaLength: o
  54099. },
  54100. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  54101. }
  54102. ,
  54103. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54104. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  54105. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  54106. Ci.Geometry.call(this),
  54107. this.type = "SphereGeometry",
  54108. this.parameters = {
  54109. radius: e,
  54110. widthSegments: t,
  54111. heightSegments: i,
  54112. phiStart: n,
  54113. phiLength: r,
  54114. thetaStart: o,
  54115. thetaLength: a
  54116. },
  54117. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  54118. }
  54119. ,
  54120. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54121. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  54122. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  54123. Ci.BufferGeometry.call(this),
  54124. this.type = "SphereBufferGeometry",
  54125. this.parameters = {
  54126. radius: e,
  54127. widthSegments: t,
  54128. heightSegments: i,
  54129. phiStart: n,
  54130. phiLength: r,
  54131. thetaStart: o,
  54132. thetaLength: a
  54133. },
  54134. e = e || 50,
  54135. t = Math.max(3, Math.floor(t) || 8),
  54136. i = Math.max(2, Math.floor(i) || 6),
  54137. n = void 0 !== n ? n : 0,
  54138. r = void 0 !== r ? r : 2 * Math.PI;
  54139. for (var s = (o = void 0 !== o ? o : 0) + (a = void 0 !== a ? a : Math.PI), l = (t + 1) * (i + 1), c = new Ci.BufferAttribute(new Float32Array(3 * l),3), h = new Ci.BufferAttribute(new Float32Array(3 * l),3), u = new Ci.BufferAttribute(new Float32Array(2 * l),2), d = 0, p = [], f = new Ci.Vector3, g = 0; g <= i; g++) {
  54140. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  54141. var A = y / t
  54142. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  54143. , I = e * Math.cos(o + v * a)
  54144. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  54145. f.set(C, I, E).normalize(),
  54146. c.setXYZ(d, C, I, E),
  54147. h.setXYZ(d, f.x, f.y, f.z),
  54148. u.setXY(d, A, 1 - v),
  54149. m.push(d),
  54150. d++
  54151. }
  54152. p.push(m)
  54153. }
  54154. var _ = [];
  54155. for (g = 0; g < i; g++)
  54156. for (y = 0; y < t; y++) {
  54157. var b = p[g][y + 1]
  54158. , w = p[g][y]
  54159. , T = p[g + 1][y]
  54160. , x = p[g + 1][y + 1];
  54161. (0 !== g || 0 < o) && _.push(b, w, x),
  54162. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  54163. }
  54164. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  54165. this.addAttribute("position", c),
  54166. this.addAttribute("normal", h),
  54167. this.addAttribute("uv", u),
  54168. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  54169. }
  54170. ,
  54171. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54172. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  54173. Ci.TextGeometry = function(e, t) {
  54174. var i = (t = t || {}).font;
  54175. if (i instanceof Ci.Font == 0)
  54176. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  54177. new Ci.Geometry;
  54178. var n = i.generateShapes(e, t.size, t.curveSegments);
  54179. t.amount = void 0 !== t.height ? t.height : 50,
  54180. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  54181. void 0 === t.bevelSize && (t.bevelSize = 8),
  54182. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  54183. Ci.ExtrudeGeometry.call(this, n, t),
  54184. this.type = "TextGeometry"
  54185. }
  54186. ,
  54187. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  54188. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  54189. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  54190. Ci.BufferGeometry.call(this),
  54191. this.type = "TorusBufferGeometry",
  54192. this.parameters = {
  54193. radius: e,
  54194. tube: t,
  54195. radialSegments: i,
  54196. tubularSegments: n,
  54197. arc: r
  54198. },
  54199. e = e || 100,
  54200. t = t || 40,
  54201. i = Math.floor(i) || 8,
  54202. n = Math.floor(n) || 6,
  54203. r = r || 2 * Math.PI;
  54204. var o, a, s = (i + 1) * (n + 1), l = i * n * 2 * 3, c = new (65535 < l ? Uint32Array : Uint16Array)(l), h = new Float32Array(3 * s), u = new Float32Array(3 * s), d = new Float32Array(2 * s), p = 0, f = 0, g = 0, m = new Ci.Vector3, v = new Ci.Vector3, y = new Ci.Vector3;
  54205. for (o = 0; o <= i; o++)
  54206. for (a = 0; a <= n; a++) {
  54207. var A = a / n * r
  54208. , C = o / i * Math.PI * 2;
  54209. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  54210. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  54211. v.z = t * Math.sin(C),
  54212. h[p] = v.x,
  54213. h[p + 1] = v.y,
  54214. h[p + 2] = v.z,
  54215. m.x = e * Math.cos(A),
  54216. m.y = e * Math.sin(A),
  54217. y.subVectors(v, m).normalize(),
  54218. u[p] = y.x,
  54219. u[p + 1] = y.y,
  54220. u[p + 2] = y.z,
  54221. d[f] = a / n,
  54222. d[f + 1] = o / i,
  54223. p += 3,
  54224. f += 2
  54225. }
  54226. for (o = 1; o <= i; o++)
  54227. for (a = 1; a <= n; a++) {
  54228. var I = (n + 1) * o + a - 1
  54229. , E = (n + 1) * (o - 1) + a - 1
  54230. , _ = (n + 1) * (o - 1) + a
  54231. , b = (n + 1) * o + a;
  54232. c[g] = I,
  54233. c[g + 1] = E,
  54234. c[g + 2] = b,
  54235. c[g + 3] = E,
  54236. c[g + 4] = _,
  54237. c[g + 5] = b,
  54238. g += 6
  54239. }
  54240. this.setIndex(new Ci.BufferAttribute(c,1)),
  54241. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  54242. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  54243. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  54244. }
  54245. ,
  54246. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54247. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  54248. Ci.TorusGeometry = function(e, t, i, n, r) {
  54249. Ci.Geometry.call(this),
  54250. this.type = "TorusGeometry",
  54251. this.parameters = {
  54252. radius: e,
  54253. tube: t,
  54254. radialSegments: i,
  54255. tubularSegments: n,
  54256. arc: r
  54257. },
  54258. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  54259. }
  54260. ,
  54261. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54262. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  54263. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  54264. function a(e, t, i, n, r) {
  54265. var o = Math.cos(e)
  54266. , a = Math.sin(e)
  54267. , s = i / t * e
  54268. , l = Math.cos(s);
  54269. r.x = n * (2 + l) * .5 * o,
  54270. r.y = n * (2 + l) * a * .5,
  54271. r.z = n * Math.sin(s) * .5
  54272. }
  54273. Ci.BufferGeometry.call(this),
  54274. this.type = "TorusKnotBufferGeometry",
  54275. this.parameters = {
  54276. radius: e,
  54277. tube: t,
  54278. tubularSegments: i,
  54279. radialSegments: n,
  54280. p: r,
  54281. q: o
  54282. },
  54283. e = e || 100,
  54284. t = t || 40,
  54285. i = Math.floor(i) || 64,
  54286. r = r || 2,
  54287. o = o || 3;
  54288. var s, l, c = ((n = Math.floor(n) || 8) + 1) * (i + 1), h = n * i * 2 * 3, u = new Ci.BufferAttribute(new (65535 < h ? Uint32Array : Uint16Array)(h),1), d = new Ci.BufferAttribute(new Float32Array(3 * c),3), p = new Ci.BufferAttribute(new Float32Array(3 * c),3), f = new Ci.BufferAttribute(new Float32Array(2 * c),2), g = 0, m = 0, v = new Ci.Vector3, y = new Ci.Vector3, A = new Ci.Vector2, C = new Ci.Vector3, I = new Ci.Vector3, E = new Ci.Vector3, _ = new Ci.Vector3, b = new Ci.Vector3;
  54289. for (s = 0; s <= i; ++s) {
  54290. var w = s / i * r * Math.PI * 2;
  54291. for (a(w, r, o, e, C),
  54292. a(.01 + w, r, o, e, I),
  54293. _.subVectors(I, C),
  54294. b.addVectors(I, C),
  54295. E.crossVectors(_, b),
  54296. b.crossVectors(E, _),
  54297. E.normalize(),
  54298. b.normalize(),
  54299. l = 0; l <= n; ++l) {
  54300. var T = l / n * Math.PI * 2
  54301. , x = -t * Math.cos(T)
  54302. , S = t * Math.sin(T);
  54303. v.x = C.x + (x * b.x + S * E.x),
  54304. v.y = C.y + (x * b.y + S * E.y),
  54305. v.z = C.z + (x * b.z + S * E.z),
  54306. d.setXYZ(g, v.x, v.y, v.z),
  54307. y.subVectors(v, C).normalize(),
  54308. p.setXYZ(g, y.x, y.y, y.z),
  54309. A.x = s / i,
  54310. A.y = l / n,
  54311. f.setXY(g, A.x, A.y),
  54312. g++
  54313. }
  54314. }
  54315. for (l = 1; l <= i; l++)
  54316. for (s = 1; s <= n; s++) {
  54317. var M = (n + 1) * (l - 1) + (s - 1)
  54318. , R = (n + 1) * l + (s - 1)
  54319. , P = (n + 1) * l + s
  54320. , O = (n + 1) * (l - 1) + s;
  54321. u.setX(m, M),
  54322. m++,
  54323. u.setX(m, R),
  54324. m++,
  54325. u.setX(m, O),
  54326. m++,
  54327. u.setX(m, R),
  54328. m++,
  54329. u.setX(m, P),
  54330. m++,
  54331. u.setX(m, O),
  54332. m++
  54333. }
  54334. this.setIndex(u),
  54335. this.addAttribute("position", d),
  54336. this.addAttribute("normal", p),
  54337. this.addAttribute("uv", f)
  54338. }
  54339. ,
  54340. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54341. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  54342. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  54343. Ci.Geometry.call(this),
  54344. this.type = "TorusKnotGeometry",
  54345. this.parameters = {
  54346. radius: e,
  54347. tube: t,
  54348. tubularSegments: i,
  54349. radialSegments: n,
  54350. p: r,
  54351. q: o
  54352. },
  54353. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  54354. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  54355. this.mergeVertices()
  54356. }
  54357. ,
  54358. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54359. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  54360. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  54361. Ci.Geometry.call(this),
  54362. this.type = "TubeGeometry",
  54363. this.parameters = {
  54364. path: e,
  54365. segments: t,
  54366. radius: i,
  54367. radialSegments: n,
  54368. closed: r,
  54369. taper: o
  54370. },
  54371. t = t || 64,
  54372. i = i || 1,
  54373. n = n || 8,
  54374. r = r || !1,
  54375. o = o || Ci.TubeGeometry.NoTaper;
  54376. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M = [], R = this, P = t + 1, O = new Ci.Vector3, L = new Ci.TubeGeometry.FrenetFrames(e,t,r), D = L.tangents, N = L.normals, F = L.binormals;
  54377. for (this.tangents = D,
  54378. this.normals = N,
  54379. this.binormals = F,
  54380. f = 0; f < P; f++)
  54381. for (M[f] = [],
  54382. l = f / (P - 1),
  54383. p = e.getPointAt(l),
  54384. D[f],
  54385. a = N[f],
  54386. s = F[f],
  54387. h = i * o(l),
  54388. g = 0; g < n; g++)
  54389. c = g / n * 2 * Math.PI,
  54390. u = -h * Math.cos(c),
  54391. d = h * Math.sin(c),
  54392. O.copy(p),
  54393. O.x += u * a.x + d * s.x,
  54394. O.y += u * a.y + d * s.y,
  54395. O.z += u * a.z + d * s.z,
  54396. M[f][g] = (T = O.x,
  54397. x = O.y,
  54398. S = O.z,
  54399. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  54400. for (f = 0; f < t; f++)
  54401. for (g = 0; g < n; g++)
  54402. m = r ? (f + 1) % t : f + 1,
  54403. v = (g + 1) % n,
  54404. y = M[f][g],
  54405. A = M[m][g],
  54406. C = M[m][v],
  54407. I = M[f][v],
  54408. E = new Ci.Vector2(f / t,g / n),
  54409. _ = new Ci.Vector2((f + 1) / t,g / n),
  54410. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  54411. w = new Ci.Vector2(f / t,(g + 1) / n),
  54412. this.faces.push(new Ci.Face3(y,A,I)),
  54413. this.faceVertexUvs[0].push([E, _, w]),
  54414. this.faces.push(new Ci.Face3(A,C,I)),
  54415. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  54416. this.computeFaceNormals(),
  54417. this.computeVertexNormals()
  54418. }
  54419. ,
  54420. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54421. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  54422. Ci.TubeGeometry.NoTaper = function(e) {
  54423. return 1
  54424. }
  54425. ,
  54426. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  54427. return Math.sin(Math.PI * e)
  54428. }
  54429. ,
  54430. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  54431. var n, r, o, a, s, l, c, h = new Ci.Vector3, u = [], d = [], p = [], f = new Ci.Vector3, g = new Ci.Matrix4, m = t + 1;
  54432. for (this.tangents = u,
  54433. this.normals = d,
  54434. this.binormals = p,
  54435. l = 0; l < m; l++)
  54436. c = l / (m - 1),
  54437. u[l] = e.getTangentAt(c),
  54438. u[l].normalize();
  54439. for (d[0] = new Ci.Vector3,
  54440. p[0] = new Ci.Vector3,
  54441. r = Number.MAX_VALUE,
  54442. o = Math.abs(u[0].x),
  54443. a = Math.abs(u[0].y),
  54444. s = Math.abs(u[0].z),
  54445. o <= r && (r = o,
  54446. h.set(1, 0, 0)),
  54447. a <= r && (r = a,
  54448. h.set(0, 1, 0)),
  54449. s <= r && h.set(0, 0, 1),
  54450. f.crossVectors(u[0], h).normalize(),
  54451. d[0].crossVectors(u[0], f),
  54452. p[0].crossVectors(u[0], d[0]),
  54453. l = 1; l < m; l++)
  54454. d[l] = d[l - 1].clone(),
  54455. p[l] = p[l - 1].clone(),
  54456. f.crossVectors(u[l - 1], u[l]),
  54457. f.length() > Number.EPSILON && (f.normalize(),
  54458. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  54459. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  54460. p[l].crossVectors(u[l], d[l]);
  54461. if (i)
  54462. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  54463. n /= m - 1,
  54464. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  54465. l = 1; l < m; l++)
  54466. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  54467. p[l].crossVectors(u[l], d[l])
  54468. }
  54469. ,
  54470. Ci.PolyhedronGeometry = function(e, t, i, n) {
  54471. function f(e) {
  54472. var t = e.normalize().clone();
  54473. t.index = m.vertices.push(t) - 1;
  54474. var i = a(e) / 2 / Math.PI + .5
  54475. , n = function(e) {
  54476. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54477. }(e) / Math.PI + .5;
  54478. return t.uv = new Ci.Vector2(i,1 - n),
  54479. t
  54480. }
  54481. function g(e, t, i, n) {
  54482. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  54483. m.faces.push(r),
  54484. y.copy(e).add(t).add(i).divideScalar(3);
  54485. var o = a(y);
  54486. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  54487. }
  54488. function r(e, t) {
  54489. for (var i = Math.pow(2, t), n = f(m.vertices[e.a]), r = f(m.vertices[e.b]), o = f(m.vertices[e.c]), a = [], s = e.materialIndex, l = 0; l <= i; l++) {
  54490. a[l] = [];
  54491. for (var c = f(n.clone().lerp(o, l / i)), h = f(r.clone().lerp(o, l / i)), u = i - l, d = 0; d <= u; d++)
  54492. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  54493. }
  54494. for (l = 0; l < i; l++)
  54495. for (d = 0; d < 2 * (i - l) - 1; d++) {
  54496. var p = Math.floor(d / 2);
  54497. d % 2 == 0 ? g(a[l][p + 1], a[l + 1][p], a[l][p], s) : g(a[l][p + 1], a[l + 1][p + 1], a[l + 1][p], s)
  54498. }
  54499. }
  54500. function a(e) {
  54501. return Math.atan2(e.z, -e.x)
  54502. }
  54503. function s(e, t, i) {
  54504. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  54505. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  54506. e.clone()
  54507. }
  54508. Ci.Geometry.call(this),
  54509. this.type = "PolyhedronGeometry",
  54510. this.parameters = {
  54511. vertices: e,
  54512. indices: t,
  54513. radius: i,
  54514. detail: n
  54515. },
  54516. i = i || 1,
  54517. n = n || 0;
  54518. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  54519. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  54520. var c = this.vertices
  54521. , h = []
  54522. , u = (o = 0,
  54523. 0);
  54524. for (l = t.length; o < l; o += 3,
  54525. u++) {
  54526. var d = c[t[o]]
  54527. , p = c[t[o + 1]]
  54528. , v = c[t[o + 2]];
  54529. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  54530. }
  54531. var y = new Ci.Vector3;
  54532. for (o = 0,
  54533. l = h.length; o < l; o++)
  54534. r(h[o], n);
  54535. for (o = 0,
  54536. l = this.faceVertexUvs[0].length; o < l; o++) {
  54537. var A = this.faceVertexUvs[0][o]
  54538. , C = A[0].x
  54539. , I = A[1].x
  54540. , E = A[2].x
  54541. , _ = Math.max(C, I, E)
  54542. , b = Math.min(C, I, E);
  54543. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  54544. I < .2 && (A[1].x += 1),
  54545. E < .2 && (A[2].x += 1))
  54546. }
  54547. for (o = 0,
  54548. l = this.vertices.length; o < l; o++)
  54549. this.vertices[o].multiplyScalar(i);
  54550. this.mergeVertices(),
  54551. this.computeFaceNormals(),
  54552. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  54553. }
  54554. ,
  54555. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54556. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  54557. Ci.DodecahedronGeometry = function(e, t) {
  54558. var i = (1 + Math.sqrt(5)) / 2
  54559. , n = 1 / i
  54560. , r = [-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, -n, -i, 0, -n, i, 0, n, -i, 0, n, i, -n, -i, 0, -n, i, 0, n, -i, 0, n, i, 0, -i, 0, -n, i, 0, -n, -i, 0, n, i, 0, n];
  54561. Ci.PolyhedronGeometry.call(this, r, [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], e, t),
  54562. this.type = "DodecahedronGeometry",
  54563. this.parameters = {
  54564. radius: e,
  54565. detail: t
  54566. }
  54567. }
  54568. ,
  54569. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54570. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  54571. Ci.IcosahedronGeometry = function(e, t) {
  54572. var i = (1 + Math.sqrt(5)) / 2
  54573. , n = [-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];
  54574. Ci.PolyhedronGeometry.call(this, n, [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], e, t),
  54575. this.type = "IcosahedronGeometry",
  54576. this.parameters = {
  54577. radius: e,
  54578. detail: t
  54579. }
  54580. }
  54581. ,
  54582. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54583. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  54584. Ci.OctahedronGeometry = function(e, t) {
  54585. Ci.PolyhedronGeometry.call(this, [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1], [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2], e, t),
  54586. this.type = "OctahedronGeometry",
  54587. this.parameters = {
  54588. radius: e,
  54589. detail: t
  54590. }
  54591. }
  54592. ,
  54593. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54594. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  54595. Ci.TetrahedronGeometry = function(e, t) {
  54596. Ci.PolyhedronGeometry.call(this, [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1], [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1], e, t),
  54597. this.type = "TetrahedronGeometry",
  54598. this.parameters = {
  54599. radius: e,
  54600. detail: t
  54601. }
  54602. }
  54603. ,
  54604. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54605. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  54606. Ci.ParametricGeometry = function(e, t, i) {
  54607. Ci.Geometry.call(this),
  54608. this.type = "ParametricGeometry",
  54609. this.parameters = {
  54610. func: e,
  54611. slices: t,
  54612. stacks: i
  54613. };
  54614. var n, r, o, a, s, l, c, h, u, d, p, f, g = this.vertices, m = this.faces, v = this.faceVertexUvs[0], y = t + 1;
  54615. for (n = 0; n <= i; n++)
  54616. for (a = n / i,
  54617. r = 0; r <= t; r++)
  54618. o = e(r / t, a),
  54619. g.push(o);
  54620. for (n = 0; n < i; n++)
  54621. for (r = 0; r < t; r++)
  54622. l = (s = n * y + r) + 1,
  54623. c = (n + 1) * y + r + 1,
  54624. h = (n + 1) * y + r,
  54625. u = new Ci.Vector2(r / t,n / i),
  54626. d = new Ci.Vector2((r + 1) / t,n / i),
  54627. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  54628. f = new Ci.Vector2(r / t,(n + 1) / i),
  54629. m.push(new Ci.Face3(s,l,h)),
  54630. v.push([u, d, f]),
  54631. m.push(new Ci.Face3(l,c,h)),
  54632. v.push([d.clone(), p, f.clone()]);
  54633. this.computeFaceNormals(),
  54634. this.computeVertexNormals()
  54635. }
  54636. ,
  54637. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54638. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  54639. Ci.WireframeGeometry = function(e) {
  54640. function t(e, t) {
  54641. return e - t
  54642. }
  54643. Ci.BufferGeometry.call(this);
  54644. var i = [0, 0]
  54645. , n = {}
  54646. , r = ["a", "b", "c"];
  54647. if (e instanceof Ci.Geometry) {
  54648. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  54649. for (var u = a[c], d = 0; d < 3; d++) {
  54650. i[0] = u[r[d]],
  54651. i[1] = u[r[(d + 1) % 3]],
  54652. i.sort(t),
  54653. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54654. l[2 * s + 1] = i[1],
  54655. n[E] = !0,
  54656. s++)
  54657. }
  54658. var p = new Float32Array(2 * s * 3);
  54659. for (c = 0,
  54660. h = s; c < h; c++)
  54661. for (d = 0; d < 2; d++) {
  54662. var f = o[l[2 * c + d]];
  54663. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  54664. p[_ + 1] = f.y,
  54665. p[_ + 2] = f.z
  54666. }
  54667. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54668. } else if (e instanceof Ci.BufferGeometry)
  54669. if (null !== e.index) {
  54670. var g = e.index.array
  54671. , m = (o = e.attributes.position,
  54672. e.groups);
  54673. s = 0;
  54674. 0 === m.length && e.addGroup(0, g.length);
  54675. l = new Uint32Array(2 * g.length);
  54676. for (var v = 0, y = m.length; v < y; ++v)
  54677. for (var A = m[v], C = A.start, I = (c = C,
  54678. C + A.count); c < I; c += 3)
  54679. for (d = 0; d < 3; d++) {
  54680. var E;
  54681. i[0] = g[c + d],
  54682. i[1] = g[c + (d + 1) % 3],
  54683. i.sort(t),
  54684. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54685. l[2 * s + 1] = i[1],
  54686. n[E] = !0,
  54687. s++)
  54688. }
  54689. for (p = new Float32Array(2 * s * 3),
  54690. c = 0,
  54691. h = s; c < h; c++)
  54692. for (d = 0; d < 2; d++) {
  54693. var _ = 6 * c + 3 * d
  54694. , b = l[2 * c + d];
  54695. p[_ + 0] = o.getX(b),
  54696. p[_ + 1] = o.getY(b),
  54697. p[_ + 2] = o.getZ(b)
  54698. }
  54699. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54700. } else {
  54701. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  54702. for (p = new Float32Array(2 * s * 3),
  54703. c = 0,
  54704. h = w; c < h; c++)
  54705. for (d = 0; d < 3; d++) {
  54706. var T = 9 * c + 3 * d;
  54707. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  54708. p[_ + 1] = o[1 + T],
  54709. p[_ + 2] = o[2 + T];
  54710. b = 9 * c + (d + 1) % 3 * 3;
  54711. p[_ + 3] = o[b],
  54712. p[_ + 4] = o[b + 1],
  54713. p[_ + 5] = o[b + 2]
  54714. }
  54715. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54716. }
  54717. }
  54718. ,
  54719. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54720. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  54721. Ci.AxisHelper = function(e) {
  54722. e = e || 1;
  54723. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54724. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54725. , n = new Ci.BufferGeometry;
  54726. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  54727. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  54728. var r = new Ci.LineBasicMaterial({
  54729. vertexColors: Ci.VertexColors
  54730. });
  54731. Ci.LineSegments.call(this, n, r)
  54732. }
  54733. ,
  54734. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54735. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  54736. Ci.ArrowHelper = function() {
  54737. var a = new Ci.Geometry;
  54738. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  54739. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  54740. return s.translate(0, -.5, 0),
  54741. function(e, t, i, n, r, o) {
  54742. Ci.Object3D.call(this),
  54743. void 0 === n && (n = 16776960),
  54744. void 0 === i && (i = 1),
  54745. void 0 === r && (r = .2 * i),
  54746. void 0 === o && (o = .2 * r),
  54747. this.position.copy(t),
  54748. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  54749. color: n
  54750. })),
  54751. this.line.matrixAutoUpdate = !1,
  54752. this.add(this.line),
  54753. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  54754. color: n
  54755. })),
  54756. this.cone.matrixAutoUpdate = !1,
  54757. this.add(this.cone),
  54758. this.setDirection(e),
  54759. this.setLength(i, r, o)
  54760. }
  54761. }(),
  54762. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  54763. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  54764. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  54765. function(e) {
  54766. .99999 < e.y ? this.quaternion.set(0, 0, 0, 1) : e.y < -.99999 ? this.quaternion.set(1, 0, 0, 0) : (Ai.set(e.z, 0, -e.x).normalize(),
  54767. yi = Math.acos(e.y),
  54768. this.quaternion.setFromAxisAngle(Ai, yi))
  54769. }
  54770. ),
  54771. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  54772. void 0 === t && (t = .2 * e),
  54773. void 0 === i && (i = .2 * t),
  54774. this.line.scale.set(1, Math.max(0, e - t), 1),
  54775. this.line.updateMatrix(),
  54776. this.cone.scale.set(i, t, i),
  54777. this.cone.position.y = e,
  54778. this.cone.updateMatrix()
  54779. }
  54780. ,
  54781. Ci.ArrowHelper.prototype.setColor = function(e) {
  54782. this.line.material.color.set(e),
  54783. this.cone.material.color.set(e)
  54784. }
  54785. ,
  54786. Ci.BoxHelper = function(e) {
  54787. 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])
  54788. , i = new Float32Array(24)
  54789. , n = new Ci.BufferGeometry;
  54790. n.setIndex(new Ci.BufferAttribute(t,1)),
  54791. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54792. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54793. color: 16776960
  54794. })),
  54795. void 0 !== e && this.update(e)
  54796. }
  54797. ,
  54798. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54799. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54800. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54801. function(e) {
  54802. if (vi.setFromObject(e),
  54803. !vi.isEmpty()) {
  54804. var t = vi.min
  54805. , i = vi.max
  54806. , n = this.geometry.attributes.position
  54807. , r = n.array;
  54808. r[0] = i.x,
  54809. r[1] = i.y,
  54810. r[2] = i.z,
  54811. r[3] = t.x,
  54812. r[4] = i.y,
  54813. r[5] = i.z,
  54814. r[6] = t.x,
  54815. r[7] = t.y,
  54816. r[8] = i.z,
  54817. r[9] = i.x,
  54818. r[10] = t.y,
  54819. r[11] = i.z,
  54820. r[12] = i.x,
  54821. r[13] = i.y,
  54822. r[14] = t.z,
  54823. r[15] = t.x,
  54824. r[16] = i.y,
  54825. r[17] = t.z,
  54826. r[18] = t.x,
  54827. r[19] = t.y,
  54828. r[20] = t.z,
  54829. r[21] = i.x,
  54830. r[22] = t.y,
  54831. r[23] = t.z,
  54832. n.needsUpdate = !0,
  54833. this.geometry.computeBoundingSphere()
  54834. }
  54835. }
  54836. ),
  54837. Ci.BoundingBoxHelper = function(e, t) {
  54838. var i = void 0 !== t ? t : 8947848;
  54839. this.object = e,
  54840. this.box = new Ci.Box3,
  54841. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54842. color: i,
  54843. wireframe: !0
  54844. }))
  54845. }
  54846. ,
  54847. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54848. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54849. Ci.BoundingBoxHelper.prototype.update = function() {
  54850. this.box.setFromObject(this.object),
  54851. this.box.size(this.scale),
  54852. this.box.center(this.position)
  54853. }
  54854. ,
  54855. Ci.CameraHelper = function(e) {
  54856. function t(e, t, i) {
  54857. n(e, i),
  54858. n(t, i)
  54859. }
  54860. function n(e, t) {
  54861. i.vertices.push(new Ci.Vector3),
  54862. i.colors.push(new Ci.Color(t)),
  54863. void 0 === o[e] && (o[e] = []),
  54864. o[e].push(i.vertices.length - 1)
  54865. }
  54866. var i = new Ci.Geometry
  54867. , r = new Ci.LineBasicMaterial({
  54868. color: 16777215,
  54869. vertexColors: Ci.FaceColors
  54870. })
  54871. , o = {}
  54872. , a = 16755200
  54873. , s = 16711680
  54874. , l = 3355443;
  54875. t("n1", "n2", a),
  54876. t("n2", "n4", a),
  54877. t("n4", "n3", a),
  54878. t("n3", "n1", a),
  54879. t("f1", "f2", a),
  54880. t("f2", "f4", a),
  54881. t("f4", "f3", a),
  54882. t("f3", "f1", a),
  54883. t("n1", "f1", a),
  54884. t("n2", "f2", a),
  54885. t("n3", "f3", a),
  54886. t("n4", "f4", a),
  54887. t("p", "n1", s),
  54888. t("p", "n2", s),
  54889. t("p", "n3", s),
  54890. t("p", "n4", s),
  54891. t("u1", "u2", 43775),
  54892. t("u2", "u3", 43775),
  54893. t("u3", "u1", 43775),
  54894. t("c", "t", 16777215),
  54895. t("p", "c", l),
  54896. t("cn1", "cn2", l),
  54897. t("cn3", "cn4", l),
  54898. t("cf1", "cf2", l),
  54899. t("cf3", "cf4", l),
  54900. Ci.LineSegments.call(this, i, r),
  54901. this.camera = e,
  54902. this.camera.updateProjectionMatrix(),
  54903. this.matrix = e.matrixWorld,
  54904. this.matrixAutoUpdate = !1,
  54905. this.pointMap = o,
  54906. this.update()
  54907. }
  54908. ,
  54909. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54910. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54911. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54912. mi = new Ci.Camera,
  54913. function() {
  54914. pi = this.geometry,
  54915. fi = this.pointMap,
  54916. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54917. Ni("c", 0, 0, -1),
  54918. Ni("t", 0, 0, 1),
  54919. Ni("n1", -1, -1, -1),
  54920. Ni("n2", 1, -1, -1),
  54921. Ni("n3", -1, 1, -1),
  54922. Ni("n4", 1, 1, -1),
  54923. Ni("f1", -1, -1, 1),
  54924. Ni("f2", 1, -1, 1),
  54925. Ni("f3", -1, 1, 1),
  54926. Ni("f4", 1, 1, 1),
  54927. Ni("u1", .7, 1.1, -1),
  54928. Ni("u2", -.7, 1.1, -1),
  54929. Ni("u3", 0, 2, -1),
  54930. Ni("cf1", -1, 0, 1),
  54931. Ni("cf2", 1, 0, 1),
  54932. Ni("cf3", 0, -1, 1),
  54933. Ni("cf4", 0, 1, 1),
  54934. Ni("cn1", -1, 0, -1),
  54935. Ni("cn2", 1, 0, -1),
  54936. Ni("cn3", 0, -1, -1),
  54937. Ni("cn4", 0, 1, -1),
  54938. pi.verticesNeedUpdate = !0
  54939. }
  54940. ),
  54941. Ci.DirectionalLightHelper = function(e, t) {
  54942. Ci.Object3D.call(this),
  54943. this.light = e,
  54944. this.light.updateMatrixWorld(),
  54945. this.matrix = e.matrixWorld,
  54946. this.matrixAutoUpdate = !1,
  54947. t = t || 1;
  54948. var i = new Ci.Geometry;
  54949. i.vertices.push(new Ci.Vector3(-t,t,0), new Ci.Vector3(t,t,0), new Ci.Vector3(t,-t,0), new Ci.Vector3(-t,-t,0), new Ci.Vector3(-t,t,0));
  54950. var n = new Ci.LineBasicMaterial({
  54951. fog: !1
  54952. });
  54953. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54954. this.lightPlane = new Ci.Line(i,n),
  54955. this.add(this.lightPlane),
  54956. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  54957. (n = new Ci.LineBasicMaterial({
  54958. fog: !1
  54959. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54960. this.targetLine = new Ci.Line(i,n),
  54961. this.add(this.targetLine),
  54962. this.update()
  54963. }
  54964. ,
  54965. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54966. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  54967. Ci.DirectionalLightHelper.prototype.dispose = function() {
  54968. this.lightPlane.geometry.dispose(),
  54969. this.lightPlane.material.dispose(),
  54970. this.targetLine.geometry.dispose(),
  54971. this.targetLine.material.dispose()
  54972. }
  54973. ,
  54974. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  54975. ui = new Ci.Vector3,
  54976. di = new Ci.Vector3,
  54977. function() {
  54978. hi.setFromMatrixPosition(this.light.matrixWorld),
  54979. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  54980. di.subVectors(ui, hi),
  54981. this.lightPlane.lookAt(di),
  54982. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54983. this.targetLine.geometry.vertices[1].copy(di),
  54984. this.targetLine.geometry.verticesNeedUpdate = !0,
  54985. this.targetLine.material.color.copy(this.lightPlane.material.color)
  54986. }
  54987. ),
  54988. Ci.EdgesHelper = function(e, t, i) {
  54989. var n = void 0 !== t ? t : 16777215;
  54990. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  54991. color: n
  54992. })),
  54993. this.matrix = e.matrixWorld,
  54994. this.matrixAutoUpdate = !1
  54995. }
  54996. ,
  54997. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54998. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  54999. Ci.FaceNormalsHelper = function(e, t, i, n) {
  55000. this.object = e,
  55001. this.size = void 0 !== t ? t : 1;
  55002. var r = void 0 !== i ? i : 16776960
  55003. , o = void 0 !== n ? n : 1
  55004. , a = 0
  55005. , s = this.object.geometry;
  55006. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  55007. var l = new Ci.BufferGeometry
  55008. , c = new Ci.Float32Attribute(2 * a * 3,3);
  55009. l.addAttribute("position", c),
  55010. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  55011. color: r,
  55012. linewidth: o
  55013. })),
  55014. this.matrixAutoUpdate = !1,
  55015. this.update()
  55016. }
  55017. ,
  55018. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55019. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  55020. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  55021. li = new Ci.Vector3,
  55022. ci = new Ci.Matrix3,
  55023. function() {
  55024. this.object.updateMatrixWorld(!0),
  55025. ci.getNormalMatrix(this.object.matrixWorld);
  55026. for (var e = this.object.matrixWorld, t = this.geometry.attributes.position, i = this.object.geometry, n = i.vertices, r = i.faces, o = 0, a = 0, s = r.length; a < s; a++) {
  55027. var l = r[a]
  55028. , c = l.normal;
  55029. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  55030. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  55031. t.setXYZ(o, si.x, si.y, si.z),
  55032. o += 1,
  55033. t.setXYZ(o, li.x, li.y, li.z),
  55034. o += 1
  55035. }
  55036. return t.needsUpdate = !0,
  55037. this
  55038. }
  55039. ),
  55040. Ci.GridHelper = function(e, t) {
  55041. var i = new Ci.Geometry
  55042. , n = new Ci.LineBasicMaterial({
  55043. vertexColors: Ci.VertexColors
  55044. });
  55045. this.color1 = new Ci.Color(4473924),
  55046. this.color2 = new Ci.Color(8947848);
  55047. for (var r = -e; r <= e; r += t) {
  55048. i.vertices.push(new Ci.Vector3(-e,0,r), new Ci.Vector3(e,0,r), new Ci.Vector3(r,0,-e), new Ci.Vector3(r,0,e));
  55049. var o = 0 === r ? this.color1 : this.color2;
  55050. i.colors.push(o, o, o, o)
  55051. }
  55052. Ci.LineSegments.call(this, i, n)
  55053. }
  55054. ,
  55055. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55056. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  55057. Ci.GridHelper.prototype.setColors = function(e, t) {
  55058. this.color1.set(e),
  55059. this.color2.set(t),
  55060. this.geometry.colorsNeedUpdate = !0
  55061. }
  55062. ,
  55063. Ci.HemisphereLightHelper = function(e, t) {
  55064. Ci.Object3D.call(this),
  55065. this.light = e,
  55066. this.light.updateMatrixWorld(),
  55067. this.matrix = e.matrixWorld,
  55068. this.matrixAutoUpdate = !1,
  55069. this.colors = [new Ci.Color, new Ci.Color];
  55070. var i = new Ci.SphereGeometry(t,4,2);
  55071. i.rotateX(-Math.PI / 2);
  55072. for (var n = 0; n < 8; n++)
  55073. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  55074. var r = new Ci.MeshBasicMaterial({
  55075. vertexColors: Ci.FaceColors,
  55076. wireframe: !0
  55077. });
  55078. this.lightSphere = new Ci.Mesh(i,r),
  55079. this.add(this.lightSphere),
  55080. this.update()
  55081. }
  55082. ,
  55083. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  55084. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  55085. Ci.HemisphereLightHelper.prototype.dispose = function() {
  55086. this.lightSphere.geometry.dispose(),
  55087. this.lightSphere.material.dispose()
  55088. }
  55089. ,
  55090. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  55091. function() {
  55092. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  55093. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  55094. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  55095. this.lightSphere.geometry.colorsNeedUpdate = !0
  55096. }
  55097. ),
  55098. Ci.PointLightHelper = function(e, t) {
  55099. this.light = e,
  55100. this.light.updateMatrixWorld();
  55101. var i = new Ci.SphereGeometry(t,4,2)
  55102. , n = new Ci.MeshBasicMaterial({
  55103. wireframe: !0,
  55104. fog: !1
  55105. });
  55106. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55107. Ci.Mesh.call(this, i, n),
  55108. this.matrix = this.light.matrixWorld,
  55109. this.matrixAutoUpdate = !1
  55110. }
  55111. ,
  55112. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  55113. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  55114. Ci.PointLightHelper.prototype.dispose = function() {
  55115. this.geometry.dispose(),
  55116. this.material.dispose()
  55117. }
  55118. ,
  55119. Ci.PointLightHelper.prototype.update = function() {
  55120. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55121. }
  55122. ,
  55123. Ci.SkeletonHelper = function(e) {
  55124. this.bones = this.getBoneList(e);
  55125. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  55126. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  55127. t.vertices.push(new Ci.Vector3),
  55128. t.colors.push(new Ci.Color(0,0,1)),
  55129. t.colors.push(new Ci.Color(0,1,0)))
  55130. }
  55131. t.dynamic = !0;
  55132. var n = new Ci.LineBasicMaterial({
  55133. vertexColors: Ci.VertexColors,
  55134. depthTest: !1,
  55135. depthWrite: !1,
  55136. transparent: !0
  55137. });
  55138. Ci.LineSegments.call(this, t, n),
  55139. this.root = e,
  55140. this.matrix = e.matrixWorld,
  55141. this.matrixAutoUpdate = !1,
  55142. this.update()
  55143. }
  55144. ,
  55145. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55146. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  55147. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  55148. var t = [];
  55149. e instanceof Ci.Bone && t.push(e);
  55150. for (var i = 0; i < e.children.length; i++)
  55151. t.push.apply(t, this.getBoneList(e.children[i]));
  55152. return t
  55153. }
  55154. ,
  55155. Ci.SkeletonHelper.prototype.update = function() {
  55156. for (var e = this.geometry, t = (new Ci.Matrix4).getInverse(this.root.matrixWorld), i = new Ci.Matrix4, n = 0, r = 0; r < this.bones.length; r++) {
  55157. var o = this.bones[r];
  55158. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  55159. e.vertices[n].setFromMatrixPosition(i),
  55160. i.multiplyMatrices(t, o.parent.matrixWorld),
  55161. e.vertices[n + 1].setFromMatrixPosition(i),
  55162. n += 2)
  55163. }
  55164. e.verticesNeedUpdate = !0,
  55165. e.computeBoundingSphere()
  55166. }
  55167. ,
  55168. Ci.SpotLightHelper = function(e) {
  55169. Ci.Object3D.call(this),
  55170. this.light = e,
  55171. this.light.updateMatrixWorld(),
  55172. this.matrix = e.matrixWorld,
  55173. this.matrixAutoUpdate = !1;
  55174. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  55175. t.translate(0, -.5, 0),
  55176. t.rotateX(-Math.PI / 2);
  55177. var i = new Ci.MeshBasicMaterial({
  55178. wireframe: !0,
  55179. fog: !1
  55180. });
  55181. this.cone = new Ci.Mesh(t,i),
  55182. this.add(this.cone),
  55183. this.update()
  55184. }
  55185. ,
  55186. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  55187. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  55188. Ci.SpotLightHelper.prototype.dispose = function() {
  55189. this.cone.geometry.dispose(),
  55190. this.cone.material.dispose()
  55191. }
  55192. ,
  55193. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  55194. oi = new Ci.Vector3,
  55195. function() {
  55196. var e = this.light.distance ? this.light.distance : 1e4
  55197. , t = e * Math.tan(this.light.angle);
  55198. this.cone.scale.set(t, t, e),
  55199. ri.setFromMatrixPosition(this.light.matrixWorld),
  55200. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  55201. this.cone.lookAt(oi.sub(ri)),
  55202. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55203. }
  55204. ),
  55205. Ci.VertexNormalsHelper = function(e, t, i, n) {
  55206. this.object = e,
  55207. this.size = void 0 !== t ? t : 1;
  55208. var r = void 0 !== i ? i : 16711680
  55209. , o = void 0 !== n ? n : 1
  55210. , a = 0
  55211. , s = this.object.geometry;
  55212. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  55213. var l = new Ci.BufferGeometry
  55214. , c = new Ci.Float32Attribute(2 * a * 3,3);
  55215. l.addAttribute("position", c),
  55216. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  55217. color: r,
  55218. linewidth: o
  55219. })),
  55220. this.matrixAutoUpdate = !1,
  55221. this.update()
  55222. }
  55223. ,
  55224. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55225. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  55226. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  55227. ii = new Ci.Vector3,
  55228. ni = new Ci.Matrix3,
  55229. function() {
  55230. var e = ["a", "b", "c"];
  55231. this.object.updateMatrixWorld(!0),
  55232. ni.getNormalMatrix(this.object.matrixWorld);
  55233. var t = this.object.matrixWorld
  55234. , i = this.geometry.attributes.position
  55235. , n = this.object.geometry;
  55236. if (n instanceof Ci.Geometry)
  55237. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  55238. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  55239. var d = r[c[e[h]]]
  55240. , p = c.vertexNormals[h];
  55241. ti.copy(d).applyMatrix4(t),
  55242. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  55243. i.setXYZ(a, ti.x, ti.y, ti.z),
  55244. a += 1,
  55245. i.setXYZ(a, ii.x, ii.y, ii.z),
  55246. a += 1
  55247. }
  55248. else if (n instanceof Ci.BufferGeometry) {
  55249. var f = n.attributes.position
  55250. , g = n.attributes.normal;
  55251. for (h = a = 0,
  55252. u = f.count; h < u; h++)
  55253. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  55254. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  55255. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  55256. i.setXYZ(a, ti.x, ti.y, ti.z),
  55257. a += 1,
  55258. i.setXYZ(a, ii.x, ii.y, ii.z),
  55259. a += 1
  55260. }
  55261. return i.needsUpdate = !0,
  55262. this
  55263. }
  55264. ),
  55265. Ci.WireframeHelper = function(e, t) {
  55266. var i = void 0 !== t ? t : 16777215;
  55267. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  55268. color: i
  55269. })),
  55270. this.matrix = e.matrixWorld,
  55271. this.matrixAutoUpdate = !1
  55272. }
  55273. ,
  55274. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55275. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  55276. Ci.ImmediateRenderObject = function(e) {
  55277. Ci.Object3D.call(this),
  55278. this.material = e,
  55279. this.render = function(e) {}
  55280. }
  55281. ,
  55282. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  55283. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  55284. Ci.MorphBlendMesh = function(e, t) {
  55285. Ci.Mesh.call(this, e, t),
  55286. this.animationsMap = {},
  55287. this.animationsList = [];
  55288. var i = this.geometry.morphTargets.length
  55289. , n = i - 1
  55290. , r = i / 1;
  55291. this.createAnimation("__default", 0, n, r),
  55292. this.setAnimationWeight("__default", 1)
  55293. }
  55294. ,
  55295. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  55296. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  55297. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  55298. var r = {
  55299. start: t,
  55300. end: i,
  55301. length: i - t + 1,
  55302. fps: n,
  55303. duration: (i - t) / n,
  55304. lastFrame: 0,
  55305. currentFrame: 0,
  55306. active: !1,
  55307. time: 0,
  55308. direction: 1,
  55309. weight: 1,
  55310. directionBackwards: !1,
  55311. mirroredLoop: !1
  55312. };
  55313. this.animationsMap[e] = r,
  55314. this.animationsList.push(r)
  55315. }
  55316. ,
  55317. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  55318. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  55319. var s = r.morphTargets[o].name.match(i);
  55320. if (s && 1 < s.length)
  55321. n[l = s[1]] || (n[l] = {
  55322. start: 1 / 0,
  55323. end: -1 / 0
  55324. }),
  55325. o < (c = n[l]).start && (c.start = o),
  55326. o > c.end && (c.end = o),
  55327. t = t || l
  55328. }
  55329. for (var l in n) {
  55330. var c = n[l];
  55331. this.createAnimation(l, c.start, c.end, e)
  55332. }
  55333. this.firstAnimation = t
  55334. }
  55335. ,
  55336. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  55337. var t = this.animationsMap[e];
  55338. t && (t.direction = 1,
  55339. t.directionBackwards = !1)
  55340. }
  55341. ,
  55342. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  55343. var t = this.animationsMap[e];
  55344. t && (t.direction = -1,
  55345. t.directionBackwards = !0)
  55346. }
  55347. ,
  55348. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  55349. var i = this.animationsMap[e];
  55350. i && (i.fps = t,
  55351. i.duration = (i.end - i.start) / i.fps)
  55352. }
  55353. ,
  55354. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  55355. var i = this.animationsMap[e];
  55356. i && (i.duration = t,
  55357. i.fps = (i.end - i.start) / i.duration)
  55358. }
  55359. ,
  55360. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  55361. var i = this.animationsMap[e];
  55362. i && (i.weight = t)
  55363. }
  55364. ,
  55365. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  55366. var i = this.animationsMap[e];
  55367. i && (i.time = t)
  55368. }
  55369. ,
  55370. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  55371. var t = 0
  55372. , i = this.animationsMap[e];
  55373. return i && (t = i.time),
  55374. t
  55375. }
  55376. ,
  55377. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  55378. var t = -1
  55379. , i = this.animationsMap[e];
  55380. return i && (t = i.duration),
  55381. t
  55382. }
  55383. ,
  55384. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  55385. var t = this.animationsMap[e];
  55386. t ? (t.time = 0,
  55387. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  55388. }
  55389. ,
  55390. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  55391. var t = this.animationsMap[e];
  55392. t && (t.active = !1)
  55393. }
  55394. ,
  55395. Ci.MorphBlendMesh.prototype.update = function(e) {
  55396. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  55397. var n = this.animationsList[t];
  55398. if (n.active) {
  55399. var r = n.duration / n.length;
  55400. n.time += n.direction * e,
  55401. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  55402. n.time > n.duration && (n.time = n.duration,
  55403. n.directionBackwards = !0),
  55404. n.time < 0 && (n.time = 0,
  55405. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  55406. n.time < 0 && (n.time += n.duration));
  55407. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  55408. , a = n.weight;
  55409. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  55410. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  55411. this.morphTargetInfluences[o] = 0,
  55412. n.lastFrame = n.currentFrame,
  55413. n.currentFrame = o);
  55414. var s = n.time % r / r;
  55415. n.directionBackwards && (s = 1 - s),
  55416. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  55417. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  55418. }
  55419. }
  55420. }
  55421. ,
  55422. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  55423. i.THREE = Ci) : this.THREE = Ci
  55424. window.THREE = Ci
  55425. getObjLoader()
  55426. }
  55427. , {}]
  55428. }, {}, [116]);