main_2020_edit.js 2.4 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687
  1. var dom = {
  2. getOffset: function(e, t, i) {
  3. for (left = "left" == e ? t.offsetLeft : t.offsetTop,
  4. i = i || $("body")[0]; (t = t.offsetParent) && t != i; )
  5. left += "left" == e ? t.offsetLeft : t.offsetTop;
  6. return left
  7. }
  8. };
  9. if (function() {
  10. "use strict";
  11. function o(e, t) {
  12. return typeof e === t
  13. }
  14. function a(e, t) {
  15. return e instanceof t
  16. }
  17. function s(e) {
  18. return e && e.nodeType
  19. }
  20. function l(e) {
  21. return s(e) ? e : a(e, y) ? e[0] : void 0
  22. }
  23. function e(e, i, n) {
  24. return y.each(e, function(e, t) {
  25. n = i.call(t, n, e, t)
  26. }),
  27. n
  28. }
  29. function t(e, t, i) {
  30. var n, r, o;
  31. if (e === t)
  32. return !0;
  33. if (!e || !t || e.constructor !== t.constructor)
  34. return !1;
  35. for (n = 0,
  36. r = i.length; n < r; n += 1) {
  37. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  38. return !1;
  39. if (e[o] !== t[o])
  40. return !1
  41. }
  42. return !0
  43. }
  44. function c(e, t, i, n) {
  45. this.left = w(e),
  46. this.top = w(t),
  47. this.width = w(i),
  48. this.height = w(n),
  49. this.right = this.left + this.width,
  50. this.bottom = this.top + this.height
  51. }
  52. function h(e, t, i, n) {
  53. this.visible = e || 0,
  54. this.viewport = t || 0,
  55. this.possible = i || 0,
  56. this.rects = n && I({}, n) || null
  57. }
  58. function r(e, t) {
  59. this.els = e,
  60. this.viewport = t
  61. }
  62. function n(e, t) {
  63. return e.val - t.val
  64. }
  65. function u(e, t) {
  66. return t.val - e.val
  67. }
  68. function d(e) {
  69. var t = c.ofContent(e, !0)
  70. , i = c.ofViewport(e, !0)
  71. , n = t.width - i.width
  72. , r = t.height - i.height;
  73. this.content = t,
  74. this.viewport = i,
  75. this.width = n <= 0 ? null : i.left / n,
  76. this.height = r <= 0 ? null : i.top / r,
  77. this.left = i.left,
  78. this.top = i.top,
  79. this.right = t.right - i.right,
  80. this.bottom = t.bottom - i.bottom
  81. }
  82. function p(e) {
  83. this.el = e || window
  84. }
  85. function f(e, t) {
  86. this.context = e,
  87. this.viewport = t,
  88. this.init()
  89. }
  90. function g(e, t, i, n) {
  91. this.context = new r(e,t),
  92. this.property = i,
  93. this.descending = n,
  94. this.init()
  95. }
  96. function m(e) {
  97. e && e !== window && e !== document ? (this.context = e,
  98. this.$autoTarget = y(e)) : this.context = window,
  99. this.init()
  100. }
  101. 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 = {},
  102. v = 1,
  103. function(e) {
  104. return e ? (i[e] || (i[e] = v,
  105. v += 1),
  106. i[e]) : 0
  107. }
  108. );
  109. I(c.prototype, {
  110. equals: function(e) {
  111. return t(this, e, ["left", "top", "width", "height"])
  112. },
  113. area: function() {
  114. return this.width * this.height
  115. },
  116. relativeTo: function(e) {
  117. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  118. },
  119. intersection: function(e) {
  120. if (!a(e, c))
  121. return null;
  122. var t = _(this.left, e.left)
  123. , i = b(this.right, e.right)
  124. , n = _(this.top, e.top)
  125. , r = i - t
  126. , o = b(this.bottom, e.bottom) - n;
  127. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  128. },
  129. envelope: function(e) {
  130. if (!a(e, c))
  131. return this;
  132. var t = b(this.left, e.left)
  133. , i = _(this.right, e.right)
  134. , n = b(this.top, e.top);
  135. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  136. }
  137. }),
  138. I(c, {
  139. ofContent: function(e, t) {
  140. 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())
  141. },
  142. ofViewport: function(e, t) {
  143. 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())
  144. },
  145. ofElement: function(e) {
  146. var t = y(e);
  147. if (!t.is(":visible"))
  148. return null;
  149. var i = t.offset();
  150. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  151. }
  152. }),
  153. I(h.prototype, {
  154. equals: function(e) {
  155. return this.fracsEqual(e) && this.rectsEqual(e)
  156. },
  157. fracsEqual: function(e) {
  158. return t(this, e, ["visible", "viewport", "possible"])
  159. },
  160. rectsEqual: function(e) {
  161. return t(this.rects, e.rects, ["document", "element", "viewport"])
  162. }
  163. }),
  164. I(h, {
  165. of: function(e, t) {
  166. var i, n, r;
  167. return e = s(e) && c.ofElement(e) || e,
  168. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  169. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  170. r = b(e.width, t.width) * b(e.height, t.height),
  171. new h(n / e.area(),n / t.area(),n / r,{
  172. document: i,
  173. element: i.relativeTo(e),
  174. viewport: i.relativeTo(t)
  175. })) : new h
  176. }
  177. });
  178. var x = ["width", "height", "left", "right", "top", "bottom"]
  179. , S = ["possible", "visible", "viewport"];
  180. I(r.prototype, {
  181. sorted: function(t, e) {
  182. var i = this.viewport;
  183. return y.map(this.els, function(e) {
  184. return {
  185. el: e,
  186. val: function(e, t, i) {
  187. var n;
  188. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  189. n ? n[i] : 0
  190. }(e, i, t)
  191. }
  192. }).sort(e ? u : n)
  193. },
  194. best: function(e, t) {
  195. return this.els.length ? this.sorted(e, t)[0] : null
  196. }
  197. }),
  198. I(d.prototype, {
  199. equals: function(e) {
  200. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  201. }
  202. }),
  203. I(p.prototype, {
  204. equals: function(e) {
  205. return t(this, e, ["el"])
  206. },
  207. scrollState: function() {
  208. return new d(this.el)
  209. },
  210. scrollTo: function(e, t, i) {
  211. var n = y(this.el === window ? "html,body" : this.el);
  212. e = e || 0,
  213. t = t || 0,
  214. i = isNaN(i) ? 1e3 : i,
  215. n.stop(!0).animate({
  216. scrollLeft: e,
  217. scrollTop: t
  218. }, i)
  219. },
  220. scroll: function(e, t, i) {
  221. var n = this.el === window ? A : y(this.el);
  222. e = e || 0,
  223. t = t || 0,
  224. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  225. },
  226. scrollToRect: function(e, t, i, n) {
  227. t = t || 0,
  228. i = i || 0,
  229. this.scrollTo(e.left - t, e.top - i, n)
  230. },
  231. scrollToElement: function(e, t, i, n) {
  232. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  233. this.scrollToRect(r, t, i, n)
  234. }
  235. });
  236. var M = {
  237. init: function() {
  238. this.callbacks = y.Callbacks("memory unique"),
  239. this.currVal = null,
  240. this.prevVal = null,
  241. this.checkProxy = y.proxy(this.check, this),
  242. this.autoCheck()
  243. },
  244. bind: function(e) {
  245. this.callbacks.add(e)
  246. },
  247. unbind: function(e) {
  248. e ? this.callbacks.remove(e) : this.callbacks.empty()
  249. },
  250. trigger: function() {
  251. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  252. },
  253. check: function(e) {
  254. var t = this.updatedValue(e);
  255. return void 0 !== t && (this.prevVal = this.currVal,
  256. this.currVal = t,
  257. this.trigger(),
  258. !0)
  259. },
  260. $autoTarget: A,
  261. autoEvents: "load resize scroll",
  262. autoCheck: function(e) {
  263. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  264. }
  265. };
  266. I(f.prototype, M, {
  267. updatedValue: function() {
  268. var e = h.of(this.context, this.viewport);
  269. return this.currVal && this.currVal.equals(e) ? void 0 : e
  270. }
  271. }),
  272. I(g.prototype, M, {
  273. updatedValue: function() {
  274. var e = this.context.best(this.property, this.descending);
  275. return e && (e = 0 < e.val ? e.el : null,
  276. this.currVal !== e) ? e : void 0
  277. }
  278. }),
  279. I(m.prototype, M, {
  280. updatedValue: function() {
  281. var e = new d(this.context);
  282. return this.currVal && this.currVal.equals(e) ? void 0 : e
  283. }
  284. });
  285. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  286. function H(e, t, i, n) {
  287. return i = N(i) ? i.apply(e, t) : i,
  288. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  289. }
  290. R = U,
  291. P = {
  292. statics: {
  293. version: "0.15.0",
  294. Rect: c,
  295. Fractions: h,
  296. Group: r,
  297. ScrollState: d,
  298. Viewport: p,
  299. FracsCallbacks: f,
  300. GroupCallbacks: g,
  301. ScrollStateCallbacks: m,
  302. fracs: function(e, t) {
  303. return h.of(e, t)
  304. }
  305. },
  306. methods: {
  307. content: function(e) {
  308. return this.length ? c.ofContent(this[0], e) : null
  309. },
  310. envelope: function() {
  311. return e(this, function(e) {
  312. var t = c.ofElement(this);
  313. return e ? e.envelope(t) : t
  314. })
  315. },
  316. fracs: function(e, i, n) {
  317. o(e, "string") || (n = i,
  318. i = e,
  319. e = null),
  320. E(i) || (n = i,
  321. i = null),
  322. n = l(n);
  323. var r = U + ".fracs." + T(n);
  324. return "unbind" === e ? this.each(function() {
  325. var e = y(this).data(r);
  326. e && e.unbind(i)
  327. }) : "check" === e ? this.each(function() {
  328. var e = y(this).data(r);
  329. e && e.check()
  330. }) : E(i) ? this.each(function() {
  331. var e = y(this)
  332. , t = e.data(r);
  333. t || (t = new f(this,n),
  334. e.data(r, t)),
  335. t.bind(i)
  336. }) : this.length ? h.of(this[0], n) : null
  337. },
  338. intersection: function() {
  339. return e(this, function(e) {
  340. var t = c.ofElement(this);
  341. return e ? e.intersection(t) : t
  342. })
  343. },
  344. max: function(e, t, i) {
  345. return E(t) || (i = t,
  346. t = null),
  347. i = l(i),
  348. t ? (new g(this,i,e,!0).bind(t),
  349. this) : this.pushStack(new r(this,i).best(e, !0).el)
  350. },
  351. min: function(e, t, i) {
  352. return E(t) || (i = t,
  353. t = null),
  354. i = l(i),
  355. t ? (new g(this,i,e).bind(t),
  356. this) : this.pushStack(new r(this,i).best(e).el)
  357. },
  358. rect: function() {
  359. return this.length ? c.ofElement(this[0]) : null
  360. },
  361. scrollState: function(e, i) {
  362. var n = U + ".scrollState";
  363. return o(e, "string") || (i = e,
  364. e = null),
  365. "unbind" === e ? this.each(function() {
  366. var e = y(this).data(n);
  367. e && e.unbind(i)
  368. }) : "check" === e ? this.each(function() {
  369. var e = y(this).data(n);
  370. e && e.check()
  371. }) : E(i) ? this.each(function() {
  372. var e = y(this)
  373. , t = e.data(n);
  374. t || (t = new m(this),
  375. e.data(n, t)),
  376. t.bind(i)
  377. }) : this.length ? new d(this[0]) : null
  378. },
  379. scroll: function(e, t, i) {
  380. return this.each(function() {
  381. new p(this).scroll(e, t, i)
  382. })
  383. },
  384. scrollTo: function(e, t, i, n) {
  385. return y.isNumeric(e) && (n = i,
  386. i = t,
  387. t = e,
  388. e = null),
  389. e = l(e),
  390. this.each(function() {
  391. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  392. })
  393. },
  394. scrollToThis: function(e, t, i, n) {
  395. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  396. this
  397. },
  398. softLink: function(t, i, n, r) {
  399. return r = new p(l(r)),
  400. this.filter("a[href^=#]").each(function() {
  401. var e = y(this);
  402. e.on("click", function() {
  403. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  404. })
  405. })
  406. },
  407. sort: function(e, t, i) {
  408. return o(t, "boolean") || (i = t,
  409. t = null),
  410. i = l(i),
  411. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  412. return e.el
  413. }))
  414. },
  415. viewport: function(e) {
  416. return this.length ? c.ofViewport(this[0], e) : null
  417. }
  418. },
  419. defaultStatic: "fracs",
  420. defaultMethod: "fracs"
  421. },
  422. O = [].slice,
  423. L = jQuery,
  424. D = L.extend,
  425. N = L.isFunction,
  426. F = D({}, P),
  427. B = function() {
  428. return H(this, O.call(arguments), F.defaultStatic, B)
  429. }
  430. ,
  431. V = function(e) {
  432. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  433. }
  434. ,
  435. (k = function(e) {
  436. e && (D(B, e.statics),
  437. D(V, e.methods)),
  438. B.modplug = k
  439. }
  440. ).prev = {
  441. statics: L[R],
  442. methods: L.fn[R]
  443. },
  444. k(P),
  445. L[R] = B,
  446. L.fn[R] = V
  447. }(),
  448. "undefined" == typeof jQuery)
  449. throw new Error("Bootstrap's JavaScript requires jQuery");
  450. !function(m) {
  451. "use strict";
  452. function r(e, t) {
  453. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  454. this.init("tooltip", e, t)
  455. }
  456. r.VERSION = "3.2.0",
  457. r.DEFAULTS = {
  458. animation: !0,
  459. placement: "top",
  460. selector: !1,
  461. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  462. trigger: "hover focus",
  463. title: "",
  464. delay: 0,
  465. html: !1,
  466. container: !1,
  467. viewport: {
  468. selector: "body",
  469. padding: 0
  470. }
  471. },
  472. r.prototype.init = function(e, t, i) {
  473. this.enabled = !0,
  474. this.type = e,
  475. this.$element = m(t),
  476. this.options = this.getOptions(i),
  477. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  478. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  479. var o = n[r];
  480. if ("click" == o)
  481. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  482. else if ("manual" != o) {
  483. var a = "hover" == o ? "mouseenter" : "focusin"
  484. , s = "hover" == o ? "mouseleave" : "focusout";
  485. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  486. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  487. }
  488. }
  489. this.options.selector ? this._options = m.extend({}, this.options, {
  490. trigger: "manual",
  491. selector: ""
  492. }) : this.fixTitle()
  493. }
  494. ,
  495. r.prototype.getDefaults = function() {
  496. return r.DEFAULTS
  497. }
  498. ,
  499. r.prototype.getOptions = function(e) {
  500. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  501. show: e.delay,
  502. hide: e.delay
  503. }),
  504. e
  505. }
  506. ,
  507. r.prototype.getDelegateOptions = function() {
  508. var i = {}
  509. , n = this.getDefaults();
  510. return this._options && m.each(this._options, function(e, t) {
  511. n[e] != t && (i[e] = t)
  512. }),
  513. i
  514. }
  515. ,
  516. r.prototype.enter = function(e) {
  517. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  518. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  519. m(e.currentTarget).data("bs." + this.type, t)),
  520. clearTimeout(t.timeout),
  521. t.hoverState = "in",
  522. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  523. }
  524. ,
  525. r.prototype.leave = function(e) {
  526. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  527. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  528. m(e.currentTarget).data("bs." + this.type, t)),
  529. clearTimeout(t.timeout),
  530. t.hoverState = "out",
  531. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  532. "out" == t.hoverState && t.hide()
  533. }, t.options.delay.hide)) : t.hide()
  534. }
  535. ,
  536. r.prototype.show = function() {
  537. var e = m.Event("show.bs." + this.type);
  538. if (this.hasContent() && this.enabled) {
  539. this.$element.trigger(e);
  540. var t = m.contains(document.documentElement, this.$element[0]);
  541. if (e.isDefaultPrevented() || !t)
  542. return;
  543. var i = this
  544. , n = this.tip()
  545. , r = this.getUID(this.type);
  546. this.setContent(),
  547. n.attr("id", r),
  548. this.$element.attr("aria-describedby", r),
  549. this.options.animation && n.addClass("fade");
  550. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  551. , a = /\s?auto?\s?/i
  552. , s = a.test(o);
  553. s && (o = o.replace(a, "") || "top"),
  554. n.detach().css({
  555. top: 0,
  556. left: 0,
  557. display: "block"
  558. }).addClass(o).data("bs." + this.type, this),
  559. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  560. var l = this.getPosition()
  561. , c = n[0].offsetWidth
  562. , h = n[0].offsetHeight;
  563. if (s) {
  564. var u = o
  565. , d = this.$element.parent()
  566. , p = this.getPosition(d);
  567. 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,
  568. n.removeClass(u).addClass(o)
  569. }
  570. var f = this.getCalculatedOffset(o, l, c, h);
  571. this.applyPlacement(f, o);
  572. var g = function() {
  573. i.$element.trigger("shown.bs." + i.type),
  574. i.hoverState = null
  575. };
  576. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  577. }
  578. }
  579. ,
  580. r.prototype.applyPlacement = function(e, t) {
  581. var i = this.tip()
  582. , n = i[0].offsetWidth
  583. , r = i[0].offsetHeight
  584. , o = parseInt(i.css("margin-top"), 10)
  585. , a = parseInt(i.css("margin-left"), 10);
  586. isNaN(o) && (o = 0),
  587. isNaN(a) && (a = 0),
  588. e.top = e.top + o,
  589. e.left = e.left + a,
  590. m.offset.setOffset(i[0], m.extend({
  591. using: function(e) {
  592. i.css({
  593. top: Math.round(e.top),
  594. left: Math.round(e.left)
  595. })
  596. }
  597. }, e), 0),
  598. i.addClass("in");
  599. var s = i[0].offsetWidth
  600. , l = i[0].offsetHeight;
  601. "top" == t && l != r && (e.top = e.top + r - l);
  602. var c = this.getViewportAdjustedDelta(t, e, s, l);
  603. c.left ? e.left += c.left : e.top += c.top;
  604. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  605. , u = c.left ? "left" : "top"
  606. , d = c.left ? "offsetWidth" : "offsetHeight";
  607. i.offset(e),
  608. this.replaceArrow(h, i[0][d], u)
  609. }
  610. ,
  611. r.prototype.replaceArrow = function(e, t, i) {
  612. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  613. }
  614. ,
  615. r.prototype.setContent = function() {
  616. var e = this.tip()
  617. , t = this.getTitle();
  618. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  619. e.removeClass("fade in top bottom left right")
  620. }
  621. ,
  622. r.prototype.hide = function() {
  623. function e() {
  624. "in" != t.hoverState && i.detach(),
  625. t.$element.trigger("hidden.bs." + t.type)
  626. }
  627. var t = this
  628. , i = this.tip()
  629. , n = m.Event("hide.bs." + this.type);
  630. if (this.$element.removeAttr("aria-describedby"),
  631. this.$element.trigger(n),
  632. !n.isDefaultPrevented())
  633. return i.removeClass("in"),
  634. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  635. this.hoverState = null,
  636. this
  637. }
  638. ,
  639. r.prototype.fixTitle = function() {
  640. var e = this.$element;
  641. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  642. }
  643. ,
  644. r.prototype.hasContent = function() {
  645. return this.getTitle()
  646. }
  647. ,
  648. r.prototype.getPosition = function(e) {
  649. var t = (e = e || this.$element)[0]
  650. , i = "BODY" == t.tagName;
  651. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  652. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  653. width: i ? m(window).width() : e.outerWidth(),
  654. height: i ? m(window).height() : e.outerHeight()
  655. }, i ? {
  656. top: 0,
  657. left: 0
  658. } : e.offset())
  659. }
  660. ,
  661. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  662. return "bottom" == e ? {
  663. top: t.top + t.height,
  664. left: t.left + t.width / 2 - i / 2
  665. } : "top" == e ? {
  666. top: t.top - n,
  667. left: t.left + t.width / 2 - i / 2
  668. } : "left" == e ? {
  669. top: t.top + t.height / 2 - n / 2,
  670. left: t.left - i
  671. } : {
  672. top: t.top + t.height / 2 - n / 2,
  673. left: t.left + t.width
  674. }
  675. }
  676. ,
  677. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  678. var r = {
  679. top: 0,
  680. left: 0
  681. };
  682. if (!this.$viewport)
  683. return r;
  684. var o = this.options.viewport && this.options.viewport.padding || 0
  685. , a = this.getPosition(this.$viewport);
  686. if (/right|left/.test(e)) {
  687. var s = t.top - o - a.scroll
  688. , l = t.top + o - a.scroll + n;
  689. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  690. } else {
  691. var c = t.left - o
  692. , h = t.left + o + i;
  693. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  694. }
  695. return r
  696. }
  697. ,
  698. r.prototype.getTitle = function() {
  699. var e = this.$element
  700. , t = this.options;
  701. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  702. }
  703. ,
  704. r.prototype.getUID = function(e) {
  705. for (; e += ~~(1e6 * Math.random()),
  706. document.getElementById(e); )
  707. ;
  708. return e
  709. }
  710. ,
  711. r.prototype.tip = function() {
  712. return this.$tip = this.$tip || m(this.options.template)
  713. }
  714. ,
  715. r.prototype.arrow = function() {
  716. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  717. }
  718. ,
  719. r.prototype.validate = function() {
  720. this.$element[0].parentNode || (this.hide(),
  721. this.$element = null,
  722. this.options = null)
  723. }
  724. ,
  725. r.prototype.enable = function() {
  726. this.enabled = !0
  727. }
  728. ,
  729. r.prototype.disable = function() {
  730. this.enabled = !1
  731. }
  732. ,
  733. r.prototype.toggleEnabled = function() {
  734. this.enabled = !this.enabled
  735. }
  736. ,
  737. r.prototype.toggle = function(e) {
  738. var t = this;
  739. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  740. m(e.currentTarget).data("bs." + this.type, t))),
  741. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  742. }
  743. ,
  744. r.prototype.destroy = function() {
  745. clearTimeout(this.timeout),
  746. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  747. }
  748. ;
  749. var e = m.fn.tooltip;
  750. m.fn.tooltip = function(n) {
  751. return this.each(function() {
  752. var e = m(this)
  753. , t = e.data("bs.tooltip")
  754. , i = "object" == typeof n && n;
  755. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  756. "string" == typeof n && t[n]())
  757. })
  758. }
  759. ,
  760. m.fn.tooltip.Constructor = r,
  761. m.fn.tooltip.noConflict = function() {
  762. return m.fn.tooltip = e,
  763. this
  764. }
  765. }(jQuery),
  766. function(e, t, i) {
  767. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  768. }(0, this, function() {
  769. "use strict";
  770. function Keen() {
  771. return _init.apply(this, arguments)
  772. }
  773. function _init(e) {
  774. if (_isUndefined(e))
  775. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  776. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  777. throw new Error("Please provide a projectId");
  778. this.configure(e)
  779. }
  780. function _extend(e) {
  781. for (var t = 1; t < arguments.length; t++)
  782. for (var i in arguments[t])
  783. e[i] = arguments[t][i];
  784. return e
  785. }
  786. function _isUndefined(e) {
  787. return void 0 === e
  788. }
  789. function _type(e) {
  790. var t = e && e.constructor ? e.constructor.toString() : void 0;
  791. return t ? t.match(/function (.*)\(/)[1] : "Null"
  792. }
  793. function _each(e, t, i) {
  794. var n;
  795. if (!e)
  796. return 0;
  797. if (i = i || e,
  798. "array" === _type(e)) {
  799. for (n = 0; n < e.length; n++)
  800. if (!1 === t.call(i, e[n], n, e))
  801. return 0
  802. } else
  803. for (n in e)
  804. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  805. return 0;
  806. return 1
  807. }
  808. function _parse_params(e) {
  809. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  810. return decodeURIComponent(e.replace(n, " "))
  811. }, a = e.split("?")[1]; t = r.exec(a); )
  812. i[o(t[1])] = o(t[2]);
  813. return i
  814. }
  815. function _set_protocol(e) {
  816. switch (e) {
  817. case "http":
  818. return "http";
  819. case "auto":
  820. return location.protocol.replace(/:/g, "");
  821. case "https":
  822. case void 0:
  823. default:
  824. return "https"
  825. }
  826. }
  827. function _set_request_type(e) {
  828. var t = e || "jsonp"
  829. , i = !1;
  830. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  831. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  832. }
  833. function _build_url(e) {
  834. return this.client.endpoint + "/projects/" + this.client.projectId + e
  835. }
  836. function _uploadEvent(e, t, i, n, r) {
  837. var o = _build_url.apply(this, ["/events/" + e])
  838. , a = {};
  839. for (var s in i = !1 !== i,
  840. this.client.globalProperties && (a = this.client.globalProperties(e)),
  841. t)
  842. t.hasOwnProperty(s) && (a[s] = t[s]);
  843. switch (this.client.requestType) {
  844. case "xhr":
  845. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  846. break;
  847. case "jsonp":
  848. var l = JSON.stringify(a)
  849. , c = Keen.Base64.encode(l);
  850. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  851. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  852. break;
  853. case "beacon":
  854. l = JSON.stringify(a),
  855. c = Keen.Base64.encode(l);
  856. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  857. o += "&c=clv1",
  858. _request.beacon.apply(this, [o, null, n, r])
  859. }
  860. }
  861. Keen.prototype.configure = function(e) {
  862. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  863. e.protocol = _set_protocol(e.protocol),
  864. e.requestType = _set_request_type(e.requestType),
  865. this.client = {
  866. projectId: e.projectId,
  867. writeKey: e.writeKey,
  868. readKey: e.readKey,
  869. globalProperties: null,
  870. endpoint: e.protocol + "://" + e.host,
  871. requestType: e.requestType
  872. },
  873. Keen.trigger("client", this, e),
  874. this.trigger("ready"),
  875. this
  876. }
  877. ;
  878. var _request = {
  879. xhr: function(e, t, i, n, r, o, a, s) {
  880. if (!r)
  881. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  882. var l = new XMLHttpRequest;
  883. if (l.onreadystatechange = function() {
  884. if (4 == l.readyState)
  885. if (200 <= l.status && l.status < 300) {
  886. var e;
  887. try {
  888. e = JSON.parse(l.responseText)
  889. } catch (e) {
  890. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  891. s && s(l, e)
  892. }
  893. a && e && a(e)
  894. } else
  895. Keen.log("HTTP request failed."),
  896. s && s(l, null)
  897. }
  898. ,
  899. l.open(e, t, o),
  900. r && l.setRequestHeader("Authorization", r),
  901. n && l.setRequestHeader("Content-Type", "application/json"),
  902. i)
  903. for (var c in i)
  904. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  905. var h = n ? JSON.stringify(n) : null;
  906. l.send(h)
  907. },
  908. jsonp: function(e, t, i, n) {
  909. if (!t)
  910. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  911. if (t && e.indexOf("api_key") < 0) {
  912. var r = 0 < e.indexOf("?") ? "&" : "?";
  913. e = e + r + "api_key=" + t
  914. }
  915. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  916. o += "a";
  917. var a = !1;
  918. window[o] = function(e) {
  919. a = !0,
  920. i && e && i(e),
  921. window[o] = void 0
  922. }
  923. ,
  924. e = e + "&jsonp=" + o;
  925. var s = document.createElement("script");
  926. s.id = "keen-jsonp",
  927. s.src = e,
  928. document.getElementsByTagName("head")[0].appendChild(s),
  929. s.onreadystatechange = function() {
  930. !1 === a && "loaded" === this.readyState && (a = !0,
  931. n && n())
  932. }
  933. ,
  934. s.onerror = function() {
  935. !1 === a && (a = !0,
  936. n && n())
  937. }
  938. },
  939. beacon: function(e, t, i, n) {
  940. if (t && e.indexOf("api_key") < 0) {
  941. var r = 0 < e.indexOf("?") ? "&" : "?";
  942. e = e + r + "api_key=" + t
  943. }
  944. var o = document.createElement("img");
  945. o.onload = function() {
  946. if (!0,
  947. "naturalHeight"in this) {
  948. if (this.naturalHeight + this.naturalWidth === 0)
  949. return void this.onerror()
  950. } else if (this.width + this.height === 0)
  951. return void this.onerror();
  952. i && i({
  953. created: !0
  954. })
  955. }
  956. ,
  957. o.onerror = function() {
  958. !0,
  959. n && n()
  960. }
  961. ,
  962. o.src = e
  963. }
  964. }
  965. , Events = Keen.Events = {
  966. on: function(e, t) {
  967. return this.listeners || (this.listeners = {}),
  968. (this.listeners[e] || (this.listeners[e] = [])).push({
  969. callback: t
  970. }),
  971. this
  972. },
  973. off: function(e, t) {
  974. if (!e && !t)
  975. return this.listeners = void 0,
  976. delete this.listeners,
  977. this;
  978. for (var i = this.listeners[e] || [], n = i.length; n--; )
  979. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  980. t && 0 != i.length || (this.listeners[e] = void 0,
  981. delete this.listeners[e]);
  982. return this
  983. },
  984. trigger: function(e) {
  985. if (!this.listeners)
  986. return this;
  987. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  988. i[n].callback.apply(this, t);
  989. return this
  990. }
  991. };
  992. _extend(Keen.prototype, Events),
  993. _extend(Keen, Events),
  994. Keen.loaded = !0,
  995. Keen.utils = {
  996. each: _each,
  997. extend: _extend,
  998. parseParams: _parse_params
  999. },
  1000. Keen.ready = function(e) {
  1001. Keen.loaded ? e() : Keen.on("ready", e)
  1002. }
  1003. ,
  1004. Keen.log = function(e) {
  1005. "object" == typeof console && console.log("[Keen IO]", e)
  1006. }
  1007. ;
  1008. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1009. Keen.prototype.addEvent = function() {
  1010. _uploadEvent.apply(this, arguments)
  1011. }
  1012. ,
  1013. Keen.prototype.addEventSync = function(e, t, i, n) {
  1014. _uploadEvent.apply(this, [e, t, !1, i, n])
  1015. }
  1016. ,
  1017. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1018. var o = e
  1019. , a = o.metaKey
  1020. , s = o.target
  1021. , l = !1
  1022. , c = function() {};
  1023. return void 0 === n && (n = 500),
  1024. "A" === s.nodeName ? c = function() {
  1025. a || l || (l = !0,
  1026. window.location = s.href)
  1027. }
  1028. : "FORM" === s.nodeName && (c = function() {
  1029. l || (l = !0,
  1030. s.submit())
  1031. }
  1032. ),
  1033. r && (c = function() {
  1034. l || (l = !0,
  1035. r())
  1036. }
  1037. ),
  1038. _uploadEvent.call(this, t, i, c, c),
  1039. setTimeout(function() {
  1040. c()
  1041. }, n),
  1042. !!a && void 0
  1043. }
  1044. ,
  1045. Keen.prototype.setGlobalProperties = function(e) {
  1046. if (!this.client)
  1047. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1048. if (!e || "function" != typeof e)
  1049. throw new Error("Invalid value for global properties: " + e);
  1050. this.client.globalProperties = e
  1051. }
  1052. ,
  1053. Keen.Base64 = {
  1054. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1055. encode: function(e) {
  1056. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1057. for (e = this.utf8.encode(e); c < e.length; )
  1058. t = e.charCodeAt(c++),
  1059. i = e.charCodeAt(c++),
  1060. n = e.charCodeAt(c++),
  1061. r = t >> 2,
  1062. o = (3 & t) << 4 | i >> 4,
  1063. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1064. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1065. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1066. return l
  1067. },
  1068. decode: function(e) {
  1069. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1070. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1071. t = c.indexOf(e.charAt(l++)),
  1072. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1073. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1074. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1075. return this.utf8.decode(s)
  1076. },
  1077. utf8: {
  1078. encode: function(e) {
  1079. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1080. 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);
  1081. return i
  1082. },
  1083. decode: function(e) {
  1084. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1085. 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];
  1086. return i
  1087. }
  1088. }
  1089. },
  1090. "object" != typeof JSON && (JSON = {}),
  1091. function() {
  1092. function f(e) {
  1093. return e < 10 ? "0" + e : e
  1094. }
  1095. function quote(e) {
  1096. return escapable.lastIndex = 0,
  1097. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1098. var t = meta[e];
  1099. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1100. }) + '"' : '"' + e + '"'
  1101. }
  1102. function str(e, t) {
  1103. var i, n, r, o, a, s = gap, l = t[e];
  1104. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1105. "function" == typeof rep && (l = rep.call(t, e, l)),
  1106. typeof l) {
  1107. case "string":
  1108. return quote(l);
  1109. case "number":
  1110. return isFinite(l) ? String(l) : "null";
  1111. case "boolean":
  1112. case "null":
  1113. return String(l);
  1114. case "object":
  1115. if (!l)
  1116. return "null";
  1117. if (gap += indent,
  1118. a = [],
  1119. "[object Array]" === Object.prototype.toString.apply(l)) {
  1120. for (o = l.length,
  1121. i = 0; i < o; i += 1)
  1122. a[i] = str(i, l) || "null";
  1123. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1124. gap = s,
  1125. r
  1126. }
  1127. if (rep && "object" == typeof rep)
  1128. for (o = rep.length,
  1129. i = 0; i < o; i += 1)
  1130. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1131. else
  1132. for (n in l)
  1133. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1134. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1135. gap = s,
  1136. r
  1137. }
  1138. }
  1139. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1140. 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
  1141. }
  1142. ,
  1143. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1144. return this.valueOf()
  1145. }
  1146. );
  1147. 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 = {
  1148. "\b": "\\b",
  1149. "\t": "\\t",
  1150. "\n": "\\n",
  1151. "\f": "\\f",
  1152. "\r": "\\r",
  1153. '"': '\\"',
  1154. "\\": "\\\\"
  1155. }, rep;
  1156. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1157. var n;
  1158. if (indent = gap = "",
  1159. "number" == typeof i)
  1160. for (n = 0; n < i; n += 1)
  1161. indent += " ";
  1162. else
  1163. "string" == typeof i && (indent = i);
  1164. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1165. throw new Error("JSON.stringify");
  1166. return str("", {
  1167. "": e
  1168. })
  1169. }
  1170. ),
  1171. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1172. function walk(e, t) {
  1173. var i, n, r = e[t];
  1174. if (r && "object" == typeof r)
  1175. for (i in r)
  1176. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1177. return reviver.call(e, t, r)
  1178. }
  1179. var j;
  1180. if (text = String(text),
  1181. cx.lastIndex = 0,
  1182. cx.test(text) && (text = text.replace(cx, function(e) {
  1183. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1184. })),
  1185. /^[\],:{}\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, "")))
  1186. return j = eval("(" + text + ")"),
  1187. "function" == typeof reviver ? walk({
  1188. "": j
  1189. }, "") : j;
  1190. throw new SyntaxError("JSON.parse")
  1191. }
  1192. )
  1193. }(),
  1194. Hh = Keen.utils,
  1195. Ih = function(i) {
  1196. function e(e) {
  1197. for (u = 1; e = n.shift(); )
  1198. e()
  1199. }
  1200. 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]);
  1201. return r[l] && r[l](s, t = function() {
  1202. r.removeEventListener(s, t, !1),
  1203. e()
  1204. }
  1205. , !1),
  1206. a && r.attachEvent(c, t = function() {
  1207. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1208. e())
  1209. }
  1210. ),
  1211. i = a ? function(t) {
  1212. self != top ? u ? t() : n.push(t) : function() {
  1213. try {
  1214. o.doScroll("left")
  1215. } catch (e) {
  1216. return setTimeout(function() {
  1217. i(t)
  1218. }, 50)
  1219. }
  1220. t()
  1221. }()
  1222. }
  1223. : function(e) {
  1224. u ? e() : n.push(e)
  1225. }
  1226. }
  1227. ,
  1228. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1229. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1230. if (loaded && cached) {
  1231. for (var instance in clients = cached.clients || {},
  1232. ready = cached.ready || [],
  1233. clients)
  1234. if (clients.hasOwnProperty(instance)) {
  1235. var client = clients[instance];
  1236. for (var method in Keen.prototype)
  1237. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1238. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1239. ,
  1240. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1241. ,
  1242. client._config && (client.configure.call(client, client._config),
  1243. delete client._config),
  1244. client._setGlobalProperties) {
  1245. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1246. client.setGlobalProperties.apply(client, globals[i]);
  1247. delete client._setGlobalProperties
  1248. }
  1249. if (client._addEvent) {
  1250. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1251. client.addEvent.apply(client, queue[i]);
  1252. delete client._addEvent
  1253. }
  1254. var callback = client._on || [];
  1255. if (client._on) {
  1256. for (var i = 0; i < callback.length; i++)
  1257. client.on.apply(client, callback[i]);
  1258. client.trigger("ready"),
  1259. delete client._on
  1260. }
  1261. }
  1262. for (var i = 0; i < ready.length; i++) {
  1263. var callback = ready[i];
  1264. Keen.on("ready", function() {
  1265. callback()
  1266. })
  1267. }
  1268. }
  1269. return Keen.loaded && setTimeout(function() {
  1270. Keen.utils.domready(function() {
  1271. Keen.trigger("ready")
  1272. })
  1273. }, 0),
  1274. Keen
  1275. }),
  1276. function() {
  1277. var i = window.analytics = window.analytics || [];
  1278. if (!i.initialize) {
  1279. if (i.invoked)
  1280. return window.console && console.error && console.error("Segment snippet included twice.");
  1281. i.invoked = !0,
  1282. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1283. i.factory = function(t) {
  1284. return function() {
  1285. var e = Array.prototype.slice.call(arguments);
  1286. return e.unshift(t),
  1287. i.push(e),
  1288. i
  1289. }
  1290. }
  1291. ;
  1292. for (var e = 0; e < i.methods.length; e++) {
  1293. var t = i.methods[e];
  1294. i[t] = i.factory(t)
  1295. }
  1296. i.load = function(e) {
  1297. var t = document.createElement("script");
  1298. t.type = "text/javascript",
  1299. t.async = !0,
  1300. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1301. var i = document.getElementsByTagName("script")[0];
  1302. i.parentNode.insertBefore(t, i)
  1303. }
  1304. ,
  1305. i.SNIPPET_VERSION = "4.0.0"
  1306. }
  1307. }(),
  1308. function(i, u) {
  1309. "use strict";
  1310. var d = "function"
  1311. , p = "undefined"
  1312. , f = "object"
  1313. , e = "major"
  1314. , t = "model"
  1315. , n = "name"
  1316. , r = "type"
  1317. , o = "vendor"
  1318. , a = "version"
  1319. , s = "architecture"
  1320. , l = "console"
  1321. , c = "mobile"
  1322. , h = "tablet"
  1323. , g = {
  1324. has: function(e, t) {
  1325. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1326. },
  1327. lowerize: function(e) {
  1328. return e.toLowerCase()
  1329. }
  1330. }
  1331. , m = {
  1332. rgx: function() {
  1333. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1334. var c = l[s]
  1335. , h = l[s + 1];
  1336. if (typeof e == p)
  1337. for (n in e = {},
  1338. h)
  1339. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1340. for (t = i = 0; t < c.length; t++)
  1341. if (o = c[t].exec(this.getUA())) {
  1342. for (n = 0; n < h.length; n++)
  1343. a = o[++i],
  1344. 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;
  1345. break
  1346. }
  1347. if (o)
  1348. break
  1349. }
  1350. return e
  1351. },
  1352. str: function(e, t) {
  1353. for (var i in t)
  1354. if (typeof t[i] == f && 0 < t[i].length) {
  1355. for (var n = 0; n < t[i].length; n++)
  1356. if (g.has(t[i][n], e))
  1357. return "?" === i ? u : i
  1358. } else if (g.has(t[i], e))
  1359. return "?" === i ? u : i;
  1360. return e
  1361. }
  1362. }
  1363. , v = {
  1364. browser: {
  1365. oldsafari: {
  1366. major: {
  1367. 1: ["/8", "/1", "/3"],
  1368. 2: "/4",
  1369. "?": "/"
  1370. },
  1371. version: {
  1372. "1.0": "/8",
  1373. 1.2: "/1",
  1374. 1.3: "/3",
  1375. "2.0": "/412",
  1376. "2.0.2": "/416",
  1377. "2.0.3": "/417",
  1378. "2.0.4": "/419",
  1379. "?": "/"
  1380. }
  1381. }
  1382. },
  1383. device: {
  1384. sprint: {
  1385. model: {
  1386. "Evo Shift 4G": "7373KT"
  1387. },
  1388. vendor: {
  1389. HTC: "APA",
  1390. Sprint: "Sprint"
  1391. }
  1392. }
  1393. },
  1394. os: {
  1395. windows: {
  1396. version: {
  1397. ME: "4.90",
  1398. "NT 3.11": "NT3.51",
  1399. "NT 4.0": "NT4.0",
  1400. 2e3: "NT 5.0",
  1401. XP: ["NT 5.1", "NT 5.2"],
  1402. Vista: "NT 6.0",
  1403. 7: "NT 6.1",
  1404. 8: "NT 6.2",
  1405. 8.1: "NT 6.3",
  1406. RT: "ARM"
  1407. }
  1408. }
  1409. }
  1410. }
  1411. , y = {
  1412. 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]],
  1413. 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]],
  1414. 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]],
  1415. 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]],
  1416. 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]]
  1417. }
  1418. , A = function(e) {
  1419. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1420. return this instanceof A ? (this.getBrowser = function() {
  1421. return m.rgx.apply(this, y.browser)
  1422. }
  1423. ,
  1424. this.getCPU = function() {
  1425. return m.rgx.apply(this, y.cpu)
  1426. }
  1427. ,
  1428. this.getDevice = function() {
  1429. return m.rgx.apply(this, y.device)
  1430. }
  1431. ,
  1432. this.getEngine = function() {
  1433. return m.rgx.apply(this, y.engine)
  1434. }
  1435. ,
  1436. this.getOS = function() {
  1437. return m.rgx.apply(this, y.os)
  1438. }
  1439. ,
  1440. this.getResult = function() {
  1441. return {
  1442. ua: this.getUA(),
  1443. browser: this.getBrowser(),
  1444. engine: this.getEngine(),
  1445. os: this.getOS(),
  1446. device: this.getDevice(),
  1447. cpu: this.getCPU()
  1448. }
  1449. }
  1450. ,
  1451. this.getUA = function() {
  1452. return t
  1453. }
  1454. ,
  1455. this.setUA = function(e) {
  1456. return t = e,
  1457. this
  1458. }
  1459. ,
  1460. void this.setUA(t)) : new A(e).getResult()
  1461. };
  1462. if (typeof exports != p)
  1463. typeof module != p && module.exports && (exports = module.exports = A),
  1464. exports.UAParser = A;
  1465. else if (i.UAParser = A,
  1466. typeof define == d && define.amd && define(function() {
  1467. return A
  1468. }),
  1469. typeof i.jQuery != p) {
  1470. var C = i.jQuery
  1471. , I = new A;
  1472. C.ua = I.getResult(),
  1473. C.ua.get = function() {
  1474. return I.getUA()
  1475. }
  1476. ,
  1477. C.ua.set = function(e) {
  1478. I.setUA(e);
  1479. var t = I.getResult();
  1480. for (var i in t)
  1481. C.ua[i] = t[i]
  1482. }
  1483. }
  1484. }(this),
  1485. window.Modernizr = function(e, t) {
  1486. function i(e, t) {
  1487. return typeof e === t
  1488. }
  1489. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1490. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1491. return t in e && i(e.constructor.prototype[t], "undefined")
  1492. }
  1493. : function(e, t) {
  1494. return p.call(e, t)
  1495. }
  1496. ,
  1497. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1498. var r = this;
  1499. if ("function" != typeof r)
  1500. throw new TypeError;
  1501. var o = d.call(arguments, 1)
  1502. , a = function() {
  1503. if (this instanceof a) {
  1504. function e() {}
  1505. e.prototype = r.prototype;
  1506. var t = new e
  1507. , i = r.apply(t, o.concat(d.call(arguments)));
  1508. return Object(i) === i ? i : t
  1509. }
  1510. return r.apply(n, o.concat(d.call(arguments)))
  1511. };
  1512. return a
  1513. }
  1514. ),
  1515. h.webgl = function() {
  1516. return !!e.WebGLRenderingContext
  1517. }
  1518. ,
  1519. h)
  1520. r(h, f) && (n = f.toLowerCase(),
  1521. a[n] = h[f](),
  1522. u.push((a[n] ? "" : "no-") + n));
  1523. return a.addTest = function(e, t) {
  1524. if ("object" == typeof e)
  1525. for (var i in e)
  1526. r(e, i) && a.addTest(i, e[i]);
  1527. else {
  1528. if (e = e.toLowerCase(),
  1529. void 0 !== a[e])
  1530. return a;
  1531. t = "function" == typeof t ? t() : t,
  1532. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1533. a[e] = t
  1534. }
  1535. return a
  1536. }
  1537. ,
  1538. o = "",
  1539. c.cssText = o,
  1540. l = null,
  1541. a._version = "2.8.2",
  1542. a
  1543. }(this, this.document),
  1544. function(xe, e, Se) {
  1545. "use strict";
  1546. function Me(s, e, n) {
  1547. function a(e) {
  1548. var t = Q.length;
  1549. if (G.old = xe.extend({}, G),
  1550. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1551. Y = W[F.horizontal ? "width" : "height"](),
  1552. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1553. Q.length = 0,
  1554. G.start = 0,
  1555. G.end = nt(z - H, 0),
  1556. le) {
  1557. $.length,
  1558. J = U.children(F.itemSelector),
  1559. $.length = 0;
  1560. 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;
  1561. z = 0,
  1562. J.each(function(e, t) {
  1563. var i = xe(t)
  1564. , n = t.getBoundingClientRect()
  1565. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1566. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1567. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1568. , s = r + o + a
  1569. , l = !o || !a
  1570. , c = {};
  1571. c.el = t,
  1572. c.size = l ? r : s,
  1573. c.half = c.size / 2,
  1574. c.start = z + (l ? o : 0),
  1575. c.center = c.start - it(H / 2 - c.size / 2),
  1576. c.end = c.start - H + c.size,
  1577. e || (z += u),
  1578. z += s,
  1579. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1580. e === g && (c.end += d,
  1581. z += d,
  1582. f = l ? a : 0),
  1583. $.push(c),
  1584. h = c
  1585. }),
  1586. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1587. z -= f,
  1588. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1589. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1590. }
  1591. if (G.center = it(G.end / 2 + G.start / 2),
  1592. v(),
  1593. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1594. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1595. X.end = Y - q,
  1596. _e || c()),
  1597. !V && 0 < H) {
  1598. var n = G.start
  1599. , r = "";
  1600. if (le)
  1601. xe.each($, function(e, t) {
  1602. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1603. Q.push(n),
  1604. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1605. });
  1606. else
  1607. for (; n - H < G.end; )
  1608. Q.push(n),
  1609. n += H;
  1610. if (Z[0] && t !== Q.length) {
  1611. for (var o = 0; o < Q.length; o++)
  1612. r += F.pageBuilder.call(B, o);
  1613. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1614. }
  1615. }
  1616. if (ee.slideeSize = z,
  1617. ee.frameSize = H,
  1618. ee.sbSize = Y,
  1619. ee.handleSize = q,
  1620. le) {
  1621. e && null != F.startAt && (m(F.startAt),
  1622. B[se ? "toCenter" : "toStart"](F.startAt));
  1623. var a = $[ee.activeItem];
  1624. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1625. } else
  1626. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1627. L("load")
  1628. }
  1629. function l(e, t, i) {
  1630. if (le && Ie.released && !i) {
  1631. var n = d(e)
  1632. , r = e > G.start && e < G.end;
  1633. se ? (r && (e = $[n.centerItem].center),
  1634. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1635. }
  1636. 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),
  1637. Ae.start = +new Date,
  1638. Ae.time = 0,
  1639. Ae.from = G.cur,
  1640. Ae.to = e,
  1641. Ae.delta = e - G.cur,
  1642. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1643. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1644. Ie.tweese = 0,
  1645. e !== G.dest && (G.dest = e,
  1646. L("change"),
  1647. _e || o()),
  1648. g(),
  1649. v(),
  1650. p(),
  1651. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1652. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1653. L("activePage", ye.page))
  1654. }
  1655. function o() {
  1656. if (B.initialized) {
  1657. if (!_e)
  1658. return _e = Ge(o),
  1659. void (Ie.released && L("moveStart"));
  1660. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1661. $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),
  1662. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1663. Ae.to === G.cur ? (G.cur = Ae.to,
  1664. Ie.tweese = _e = 0) : _e = Ge(o),
  1665. L("move"),
  1666. 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"),
  1667. !_e && Ie.released && L("moveEnd"),
  1668. c()
  1669. }
  1670. }
  1671. function c() {
  1672. 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,
  1673. X.cur = Fe(it(X.cur), X.start, X.end),
  1674. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1675. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1676. }
  1677. function t() {
  1678. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1679. Te = Ie.init ? Ge(t) : 0,
  1680. Ce.now = +new Date,
  1681. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1682. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1683. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1684. Ce.lastTime = Ce.now
  1685. }
  1686. function i(e, t, i) {
  1687. if ("boolean" === Re(t) && (i = t,
  1688. t = Se),
  1689. t === Se)
  1690. l(G[e], i);
  1691. else {
  1692. if (se && "center" !== e)
  1693. return;
  1694. var n = B.getPos(t);
  1695. n && l(n[e], i, !se)
  1696. }
  1697. }
  1698. function h(e) {
  1699. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1700. }
  1701. function u(e) {
  1702. return h(De(e) && e < 0 ? e + $.length : e)
  1703. }
  1704. function m(e, t) {
  1705. var i = h(e);
  1706. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1707. J.eq(i).addClass(F.activeClass),
  1708. ye.active = ee.activeItem = i,
  1709. p(),
  1710. L("active", i)),
  1711. i)
  1712. }
  1713. function d(e) {
  1714. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1715. var t = {}
  1716. , i = ae ? 0 : H / 2;
  1717. if (!V)
  1718. for (var n = 0, r = Q.length; n < r; n++) {
  1719. if (e >= G.end || n === Q.length - 1) {
  1720. t.activePage = Q.length - 1;
  1721. break
  1722. }
  1723. if (e <= Q[n] + i) {
  1724. t.activePage = n;
  1725. break
  1726. }
  1727. }
  1728. if (le) {
  1729. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1730. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1731. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1732. l === c - 1 || e <= $[l].end + $[l].half) {
  1733. a = l;
  1734. break
  1735. }
  1736. t.firstItem = De(o) ? o : 0,
  1737. t.centerItem = De(s) ? s : t.firstItem,
  1738. t.lastItem = De(a) ? a : t.centerItem
  1739. }
  1740. return t
  1741. }
  1742. function v(e) {
  1743. xe.extend(ee, d(e))
  1744. }
  1745. function p() {
  1746. var e = G.dest <= G.start
  1747. , t = G.dest >= G.end
  1748. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1749. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1750. ge.is("button,input") && ge.prop("disabled", e),
  1751. me.is("button,input") && me.prop("disabled", t),
  1752. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1753. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1754. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1755. de.is("button,input") && de.prop("disabled", e),
  1756. ue.is("button,input") && ue.prop("disabled", t)),
  1757. le && null != ee.activeItem) {
  1758. var n = 0 === ee.activeItem
  1759. , r = ee.activeItem >= $.length - 1
  1760. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1761. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1762. pe.is("button,input") && pe.prop("disabled", n),
  1763. fe.is("button,input") && fe.prop("disabled", r),
  1764. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1765. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1766. }
  1767. }
  1768. function r(e, t, i) {
  1769. if (e = u(e),
  1770. t = u(t),
  1771. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1772. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1773. var n = e < t ? e : i ? t : t - 1
  1774. , r = t < e ? e : i ? t + 1 : t
  1775. , o = t < e;
  1776. 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)),
  1777. a()
  1778. }
  1779. }
  1780. function f(e, t) {
  1781. for (var i = 0, n = ve[e].length; i < n; i++)
  1782. if (ve[e][i] === t)
  1783. return i;
  1784. return -1
  1785. }
  1786. function g() {
  1787. Ie.released && !B.isPaused && B.resume()
  1788. }
  1789. function y(e) {
  1790. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1791. }
  1792. function A() {
  1793. Ie.history[0] = Ie.history[1],
  1794. Ie.history[1] = Ie.history[2],
  1795. Ie.history[2] = Ie.history[3],
  1796. Ie.history[3] = Ie.delta
  1797. }
  1798. function C(e) {
  1799. Ie.released = 0,
  1800. Ie.source = e,
  1801. Ie.slidee = "slidee" === e
  1802. }
  1803. function I(e) {
  1804. var t = "touchstart" === e.type
  1805. , i = e.data.source
  1806. , n = "slidee" === i;
  1807. 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),
  1808. C(i),
  1809. Ie.init = 0,
  1810. Ie.$source = xe(e.target),
  1811. Ie.touch = t,
  1812. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1813. Ie.initX = Ie.pointer.pageX,
  1814. Ie.initY = Ie.pointer.pageY,
  1815. Ie.initPos = n ? G.cur : X.cur,
  1816. Ie.start = +new Date,
  1817. Ie.time = 0,
  1818. Ie.path = 0,
  1819. Ie.delta = 0,
  1820. Ie.locked = 0,
  1821. Ie.history = [0, 0, 0, 0],
  1822. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  1823. We.on(t ? qe : Ye, E),
  1824. B.pause(1),
  1825. (n ? U : j).addClass(F.draggedClass),
  1826. L("moveStart"),
  1827. n && (be = setInterval(A, 10)))
  1828. }
  1829. function E(e) {
  1830. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  1831. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  1832. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  1833. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  1834. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  1835. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  1836. Ie.released || !(Ie.path < 1)) {
  1837. if (!Ie.init) {
  1838. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  1839. return _();
  1840. Ie.init = 1
  1841. }
  1842. Pe(e),
  1843. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  1844. Ie.$source.on(Ze, Oe)),
  1845. Ie.released && (_(),
  1846. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  1847. Ie.delta += Ie.swing,
  1848. Ie.tweese = 10 < $e(Ie.swing))),
  1849. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  1850. }
  1851. }
  1852. function _() {
  1853. clearInterval(be),
  1854. Ie.released = !0,
  1855. We.off(Ie.touch ? qe : Ye, E),
  1856. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  1857. setTimeout(function() {
  1858. Ie.$source.off(Ze, Oe)
  1859. }),
  1860. G.cur === G.dest && Ie.init && L("moveEnd"),
  1861. B.resume(1),
  1862. Ie.init = 0
  1863. }
  1864. function b(e) {
  1865. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  1866. }
  1867. function w() {
  1868. B.stop(),
  1869. We.off("mouseup", w)
  1870. }
  1871. function T(e) {
  1872. switch (Pe(e),
  1873. this) {
  1874. case ue[0]:
  1875. case de[0]:
  1876. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  1877. We.on("mouseup", w);
  1878. break;
  1879. case pe[0]:
  1880. B.prev();
  1881. break;
  1882. case fe[0]:
  1883. B.next();
  1884. break;
  1885. case ge[0]:
  1886. B.prevPage();
  1887. break;
  1888. case me[0]:
  1889. B.nextPage()
  1890. }
  1891. }
  1892. function x(e) {
  1893. e.originalEvent[He] = B;
  1894. var t = +new Date;
  1895. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  1896. ot = t;
  1897. else if (F.scrollBy && G.start !== G.end) {
  1898. var i = function(e) {
  1899. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1900. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1901. le ? (Ue = +new Date,
  1902. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  1903. Ee.last = Ue,
  1904. Ee.delta += Ee.curDelta,
  1905. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  1906. Ee.delta %= 1),
  1907. Ee.finalDelta) : Ee.curDelta
  1908. }(e.originalEvent);
  1909. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  1910. B.slideBy(F.scrollBy * i)
  1911. }
  1912. }
  1913. function S(e) {
  1914. F.clickBar && e.target === W[0] && (Pe(e),
  1915. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  1916. }
  1917. function M(e) {
  1918. if (F.keyboardNavBy)
  1919. switch (e.which) {
  1920. case F.horizontal ? 37 : 38:
  1921. Pe(e),
  1922. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  1923. break;
  1924. case F.horizontal ? 39 : 40:
  1925. Pe(e),
  1926. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  1927. }
  1928. }
  1929. function R(e) {
  1930. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  1931. }
  1932. function P() {
  1933. this.parentNode === Z[0] && B.activatePage(K.index(this))
  1934. }
  1935. function O(e) {
  1936. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  1937. }
  1938. function L(e, t) {
  1939. if (ve[e]) {
  1940. for (N = ve[e].length,
  1941. Je.length = 0,
  1942. D = 0; D < N; D++)
  1943. Je.push(ve[e][D]);
  1944. for (D = 0; D < N; D++)
  1945. Je[D].call(B, e, t)
  1946. }
  1947. }
  1948. 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 = {
  1949. start: 0,
  1950. center: 0,
  1951. end: 0,
  1952. cur: 0,
  1953. dest: 0
  1954. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  1955. start: 0,
  1956. end: 0,
  1957. cur: 0
  1958. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  1959. firstItem: 0,
  1960. lastItem: 0,
  1961. centerItem: 0,
  1962. activeItem: null,
  1963. activePage: 0
  1964. }, 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 = {
  1965. released: 1
  1966. }, Ee = {
  1967. last: 0,
  1968. delta: 0,
  1969. resetTime: 200
  1970. }, _e = 0, be = 0, we = 0, Te = 0;
  1971. V || (s = k[0]),
  1972. B.initialized = 0,
  1973. B.frame = s,
  1974. B.slidee = U[0],
  1975. B.pos = G,
  1976. B.rel = ee,
  1977. B.items = $,
  1978. B.pages = Q,
  1979. B.isPaused = 0,
  1980. B.options = F,
  1981. B.dragging = Ie,
  1982. B.reload = function() {
  1983. a()
  1984. }
  1985. ,
  1986. B.getPos = function(e) {
  1987. if (le) {
  1988. var t = h(e);
  1989. return -1 !== t && $[t]
  1990. }
  1991. var i = U.find(e).eq(0);
  1992. if (i[0]) {
  1993. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  1994. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  1995. return {
  1996. start: n,
  1997. center: n - H / 2 + r / 2,
  1998. end: n - H + r,
  1999. size: r
  2000. }
  2001. }
  2002. return !1
  2003. }
  2004. ,
  2005. B.moveBy = function(e) {
  2006. Ce.speed = e,
  2007. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2008. Ce.startPos = G.cur,
  2009. C("button"),
  2010. Ie.init = 1,
  2011. L("moveStart"),
  2012. ze(Te),
  2013. t())
  2014. }
  2015. ,
  2016. B.stop = function() {
  2017. "button" === Ie.source && (Ie.init = 0,
  2018. Ie.released = 1)
  2019. }
  2020. ,
  2021. B.prev = function() {
  2022. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2023. }
  2024. ,
  2025. B.next = function() {
  2026. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2027. }
  2028. ,
  2029. B.prevPage = function() {
  2030. B.activatePage(ee.activePage - 1)
  2031. }
  2032. ,
  2033. B.nextPage = function() {
  2034. B.activatePage(ee.activePage + 1)
  2035. }
  2036. ,
  2037. B.slideBy = function(e, t) {
  2038. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2039. }
  2040. ,
  2041. B.slideTo = function(e, t) {
  2042. l(e, t)
  2043. }
  2044. ,
  2045. B.toStart = function(e, t) {
  2046. i("start", e, t)
  2047. }
  2048. ,
  2049. B.toEnd = function(e, t) {
  2050. i("end", e, t)
  2051. }
  2052. ,
  2053. B.toCenter = function(e, t) {
  2054. i("center", e, t)
  2055. }
  2056. ,
  2057. B.getIndex = h,
  2058. B.activate = function(e, t) {
  2059. var i = m(e);
  2060. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2061. }
  2062. ,
  2063. B.activatePage = function(e, t) {
  2064. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2065. }
  2066. ,
  2067. B.resume = function(e) {
  2068. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2069. we ? we = clearTimeout(we) : L("resume"),
  2070. we = setTimeout(function() {
  2071. switch (L("cycle"),
  2072. F.cycleBy) {
  2073. case "items":
  2074. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2075. break;
  2076. case "pages":
  2077. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2078. }
  2079. }, F.cycleInterval))
  2080. }
  2081. ,
  2082. B.pause = function(e) {
  2083. e < B.isPaused || (B.isPaused = e || 100,
  2084. we && (we = clearTimeout(we),
  2085. L("pause")))
  2086. }
  2087. ,
  2088. B.toggle = function() {
  2089. B[we ? "pause" : "resume"]()
  2090. }
  2091. ,
  2092. B.set = function(e, t) {
  2093. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2094. }
  2095. ,
  2096. B.add = function(e, t) {
  2097. var i = xe(e);
  2098. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2099. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2100. a()
  2101. }
  2102. ,
  2103. B.remove = function(e) {
  2104. if (le) {
  2105. var t = u(e);
  2106. if (-1 < t) {
  2107. J.eq(t).remove();
  2108. var i = t === ee.activeItem;
  2109. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2110. a(),
  2111. i && (ye.active = null,
  2112. B.activate(ee.activeItem))
  2113. }
  2114. } else
  2115. xe(e).remove(),
  2116. a()
  2117. }
  2118. ,
  2119. B.moveAfter = function(e, t) {
  2120. r(e, t, 1)
  2121. }
  2122. ,
  2123. B.moveBefore = function(e, t) {
  2124. r(e, t)
  2125. }
  2126. ,
  2127. B.on = function(e, t) {
  2128. if ("object" === Re(e))
  2129. for (var i in e)
  2130. e.hasOwnProperty(i) && B.on(i, e[i]);
  2131. else if ("function" === Re(t))
  2132. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2133. ve[n[r]] = ve[n[r]] || [],
  2134. -1 === f(n[r], t) && ve[n[r]].push(t);
  2135. else if ("array" === Re(t))
  2136. for (var a = 0, s = t.length; a < s; a++)
  2137. B.on(e, t[a])
  2138. }
  2139. ,
  2140. B.one = function(t, i) {
  2141. B.on(t, function e() {
  2142. i.apply(B, arguments),
  2143. B.off(t, e)
  2144. })
  2145. }
  2146. ,
  2147. B.off = function(e, t) {
  2148. if (t instanceof Array)
  2149. for (var i = 0, n = t.length; i < n; i++)
  2150. B.off(e, t[i]);
  2151. else
  2152. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2153. if (ve[r[o]] = ve[r[o]] || [],
  2154. null == t)
  2155. ve[r[o]].length = 0;
  2156. else {
  2157. var s = f(r[o], t);
  2158. -1 !== s && ve[r[o]].splice(s, 1)
  2159. }
  2160. }
  2161. ,
  2162. B.destroy = function() {
  2163. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2164. We.off("keydown", M),
  2165. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2166. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2167. Z.empty(),
  2168. V || (k.off("." + He),
  2169. te.restore(),
  2170. ie.restore(),
  2171. ne.restore(),
  2172. re.restore(),
  2173. xe.removeData(s, He)),
  2174. $.length = Q.length = 0,
  2175. ye = {},
  2176. B.initialized = 0,
  2177. B
  2178. }
  2179. ,
  2180. B.init = function() {
  2181. if (!B.initialized) {
  2182. B.on(n);
  2183. var e = ["overflow", "position"]
  2184. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2185. te.save.apply(te, e),
  2186. ne.save.apply(ne, e),
  2187. ie.save.apply(ie, t),
  2188. re.save.apply(re, t);
  2189. var i = j;
  2190. return V || (i = i.add(U),
  2191. k.css("overflow", "hidden"),
  2192. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2193. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2194. i.css({
  2195. position: "absolute"
  2196. })),
  2197. F.forward && ue.on(Ke, T),
  2198. F.backward && de.on(Ke, T),
  2199. F.prev && pe.on(Ze, T),
  2200. F.next && fe.on(Ze, T),
  2201. F.prevPage && ge.on(Ze, T),
  2202. F.nextPage && me.on(Ze, T),
  2203. ce.on(Xe, x),
  2204. W[0] && W.on(Ze, S),
  2205. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2206. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2207. he.on(je, {
  2208. source: "slidee"
  2209. }, I),
  2210. j && j.on(je, {
  2211. source: "handle"
  2212. }, I),
  2213. We.on("keydown", M),
  2214. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2215. k.on("scroll." + He, Le)),
  2216. B.initialized = 1,
  2217. a(!0),
  2218. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2219. B
  2220. }
  2221. }
  2222. }
  2223. function Re(e) {
  2224. 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
  2225. }
  2226. function Pe(e, t) {
  2227. e.preventDefault(),
  2228. t && e.stopPropagation()
  2229. }
  2230. function Oe(e) {
  2231. Pe(e, 1),
  2232. xe(this).off(e.type, Oe)
  2233. }
  2234. function Le() {
  2235. this.scrollLeft = 0,
  2236. this.scrollTop = 0
  2237. }
  2238. function De(e) {
  2239. return !isNaN(parseFloat(e)) && isFinite(e)
  2240. }
  2241. function Ne(e, t) {
  2242. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2243. }
  2244. function Fe(e, t, i) {
  2245. return e < t ? t : i < e ? i : e
  2246. }
  2247. function Be(t) {
  2248. var i = {
  2249. style: {},
  2250. save: function() {
  2251. if (t && t.nodeType) {
  2252. for (var e = 0; e < arguments.length; e++)
  2253. i.style[arguments[e]] = t.style[arguments[e]];
  2254. return i
  2255. }
  2256. },
  2257. restore: function() {
  2258. if (t && t.nodeType) {
  2259. for (var e in i.style)
  2260. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2261. return i
  2262. }
  2263. }
  2264. };
  2265. return i
  2266. }
  2267. 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;
  2268. function t(e) {
  2269. for (var t = 0, i = r.length; t < i; t++) {
  2270. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2271. if (null != o.style[n])
  2272. return n
  2273. }
  2274. }
  2275. We.on(Xe, function(e) {
  2276. var t = e.originalEvent[He]
  2277. , i = +new Date;
  2278. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2279. }),
  2280. function(t) {
  2281. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2282. var t = (new Date).getTime()
  2283. , i = Math.max(0, 16 - (t - r))
  2284. , n = setTimeout(e, i);
  2285. return r = t,
  2286. n
  2287. }
  2288. ;
  2289. var r = (new Date).getTime()
  2290. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2291. ze = function(e) {
  2292. i.call(t, e)
  2293. }
  2294. }(window),
  2295. r = ["", "webkit", "moz", "ms", "o"],
  2296. o = document.createElement("div"),
  2297. Ve = t("transform"),
  2298. ke = t("perspective") ? "translateZ(0) " : "",
  2299. e.Sly = Me,
  2300. xe.fn.sly = function(n, r) {
  2301. var o, a;
  2302. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2303. a = Array.prototype.slice.call(arguments, 1)),
  2304. n = {}),
  2305. this.each(function(e, t) {
  2306. var i = xe.data(t, He);
  2307. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2308. })
  2309. }
  2310. ,
  2311. Me.defaults = {
  2312. slidee: null,
  2313. horizontal: !1,
  2314. itemNav: null,
  2315. itemSelector: null,
  2316. smart: !1,
  2317. activateOn: null,
  2318. activateMiddle: !1,
  2319. scrollSource: null,
  2320. scrollBy: 0,
  2321. scrollHijack: 300,
  2322. scrollTrap: !1,
  2323. dragSource: null,
  2324. mouseDragging: !1,
  2325. touchDragging: !1,
  2326. releaseSwing: !1,
  2327. swingSpeed: .2,
  2328. elasticBounds: !1,
  2329. interactive: null,
  2330. scrollBar: null,
  2331. dragHandle: !1,
  2332. dynamicHandle: !1,
  2333. minHandleSize: 50,
  2334. clickBar: !1,
  2335. syncSpeed: .5,
  2336. pagesBar: null,
  2337. activatePageOn: null,
  2338. pageBuilder: function(e) {
  2339. return "<li>" + (e + 1) + "</li>"
  2340. },
  2341. forward: null,
  2342. backward: null,
  2343. prev: null,
  2344. next: null,
  2345. prevPage: null,
  2346. nextPage: null,
  2347. cycleBy: null,
  2348. cycleInterval: 5e3,
  2349. pauseOnHover: !1,
  2350. startPaused: !1,
  2351. moveBy: 300,
  2352. speed: 0,
  2353. easing: "swing",
  2354. startAt: null,
  2355. keyboardNavBy: null,
  2356. draggedClass: "dragged",
  2357. activeClass: "active",
  2358. disabledClass: "disabled"
  2359. }
  2360. }(jQuery, window),
  2361. function o(a, s, l) {
  2362. function c(i, e) {
  2363. if (!s[i]) {
  2364. if (!a[i]) {
  2365. var t = "function" == typeof require && require;
  2366. if (!e && t)
  2367. return t(i, !0);
  2368. if (h)
  2369. return h(i, !0);
  2370. var n = new Error("Cannot find module '" + i + "'");
  2371. throw n.code = "MODULE_NOT_FOUND",
  2372. n
  2373. }
  2374. var r = s[i] = {
  2375. exports: {}
  2376. };
  2377. a[i][0].call(r.exports, function(e) {
  2378. var t = a[i][1][e];
  2379. return c(t || e)
  2380. }, r, r.exports, o, a, s, l)
  2381. }
  2382. return s[i].exports
  2383. }
  2384. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2385. c(l[e]);
  2386. return c
  2387. }({
  2388. 1: [function(p, f, e) {
  2389. (function(e) {
  2390. "use strict";
  2391. function t(e) {
  2392. this.player = null,
  2393. this.director = null,
  2394. this.modelManager = null,
  2395. this.container = null,
  2396. this.tagManager = null,
  2397. this.fadeInSpeed = e,
  2398. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2399. }
  2400. var r = p("three")
  2401. , i = p("./util/logger")
  2402. , n = (p("./util/common"),
  2403. p("./enum/PlayerEvents"))
  2404. , o = p("./enum/DirectorEvents")
  2405. , a = p("./settings")
  2406. , s = p("./enum/Viewmode")
  2407. , l = (p("./enum/WarpStyle"),
  2408. p("./enum/BlackoutStyle"),
  2409. p("./enum/ModelManagerEvents"))
  2410. , c = p("./enum/tagEvents")
  2411. , h = p("./util/transitions")
  2412. , u = p("./util/lerp")
  2413. , d = new i(e);
  2414. window.THREE = r,
  2415. t.prototype.init = function(e, t, i, n, r) {
  2416. (window.app = this).player = t,
  2417. this.director = e,
  2418. this.modelManager = i,
  2419. this.tagManager = n,
  2420. this.container = r,
  2421. this.updateModel(),
  2422. this.bindEvents()
  2423. }
  2424. ,
  2425. t.prototype.bindEvents = function() {
  2426. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2427. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2428. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2429. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2430. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2431. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2432. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2433. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2434. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2435. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2436. }
  2437. ,
  2438. t.prototype.updateModel = function() {
  2439. this.model = this.modelManager.getActiveModel()
  2440. }
  2441. ,
  2442. t.prototype.handleWarpStarted = function() {
  2443. this.hidePlayerReticule()
  2444. }
  2445. ,
  2446. t.prototype.ontagActivated = function() {
  2447. this.hidePlayerReticule()
  2448. }
  2449. ,
  2450. t.prototype.onNavigationTotag = function() {
  2451. this.hidePlayerReticule()
  2452. }
  2453. ,
  2454. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2455. var n = this.modelManager.getActiveModel()
  2456. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2457. n.fadePanoMarkers(r),
  2458. n.setMode(t)
  2459. }
  2460. ,
  2461. t.prototype.handlePlayerModeChanged = function(e, t) {
  2462. var i = this.modelManager.getActiveModel()
  2463. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2464. i.setSide(n),
  2465. i.setMode(t)
  2466. }
  2467. ,
  2468. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2469. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2470. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2471. }
  2472. ,
  2473. t.prototype.handleActionInterruption = function() {}
  2474. ,
  2475. t.prototype.handleStartInside = function(e) {
  2476. var t = a[this.player.mode]
  2477. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2478. this.fadeIn(this.fadeInSpeed),
  2479. this.model.alpha = 0,
  2480. this.model.skybox.material.uniforms.opacity.value = 1,
  2481. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2482. var n = this.player.reticule;
  2483. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2484. }
  2485. ,
  2486. t.prototype.handleStartOutside = function(e) {
  2487. this.fadeIn(e)
  2488. }
  2489. ,
  2490. t.prototype.fadeIn = function(e) {
  2491. null != e || (e = 2e3,
  2492. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2493. $(this.container).fadeIn(e)
  2494. }
  2495. ,
  2496. t.prototype.hidePlayerReticule = function() {
  2497. this.player.reticule.hide()
  2498. }
  2499. ,
  2500. f.exports = t
  2501. }
  2502. ).call(this, "/js/DisplayController.js")
  2503. }
  2504. , {
  2505. "./enum/BlackoutStyle": 18,
  2506. "./enum/DirectorEvents": 23,
  2507. "./enum/tagEvents": 32,
  2508. "./enum/ModelManagerEvents": 33,
  2509. "./enum/PlayerEvents": 40,
  2510. "./enum/Viewmode": 51,
  2511. "./enum/WarpStyle": 52,
  2512. "./settings": 166,
  2513. "./util/common": 185,
  2514. "./util/lerp": 188,
  2515. "./util/logger": 189,
  2516. "./util/transitions": 195,
  2517. three: 217
  2518. }],
  2519. 2: [function(e, t, i) {
  2520. "use strict";
  2521. function n() {
  2522. this.baseStartTime = performance.timing.navigationStart,
  2523. this.loadingStartTime = null,
  2524. this.waitingStartTime = null,
  2525. this.appReadyTime = null
  2526. }
  2527. n.prototype.setBaseStartTime = function(e) {
  2528. this.baseStartTime = e || Date.now()
  2529. }
  2530. ,
  2531. n.prototype.setWaitingStartTime = function(e) {
  2532. this.waitingStartTime = e || Date.now()
  2533. }
  2534. ,
  2535. n.prototype.setLoadingStartTime = function(e) {
  2536. this.loadingStartTime = e || Date.now()
  2537. }
  2538. ,
  2539. n.prototype.setAppReadyTime = function(e) {
  2540. this.appReadyTime = e || Date.now()
  2541. }
  2542. ,
  2543. n.prototype.calcFullLoadingTime = function() {
  2544. var e = this.appReadyTime - this.baseStartTime;
  2545. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2546. e
  2547. }
  2548. ,
  2549. t.exports = n
  2550. }
  2551. , {}],
  2552. 3: [function(i, n, e) {
  2553. (function(e) {
  2554. "use strict";
  2555. function a() {
  2556. return 100 * Math.random()
  2557. }
  2558. var t = i("./util/logger")
  2559. , s = i("./util/browser")
  2560. , l = new t(e)
  2561. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2562. initialized: !1,
  2563. init: function(e, t) {
  2564. if (t = t || {},
  2565. !this.initialized) {
  2566. for (var i in this.initialized = !0,
  2567. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2568. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2569. e) {
  2570. var n = i.match("^sc_tilegen_([0-9]+)$");
  2571. n && (c.tilegen = a() < parseInt(n[1]));
  2572. var r = i.match("^sc_imgopt_([0-9]+)$");
  2573. r && (c.imgopt = a() < parseInt(r[1]))
  2574. }
  2575. for (var o in t)
  2576. c[o] = t[o],
  2577. l.debug("A/B override:", o, c[o])
  2578. }
  2579. },
  2580. changeIfTileGenerating: function(e) {
  2581. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2582. e += ""),
  2583. e
  2584. },
  2585. changeIfImageOptimzing: function(e) {
  2586. if(e.includes("blob:http"))return e;//add
  2587. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2588. e += ""),
  2589. e
  2590. },
  2591. tilegen: !1,
  2592. imgopt: !1
  2593. };
  2594. n.exports = c
  2595. }
  2596. ).call(this, "/js/ab.js")
  2597. }
  2598. , {
  2599. "./util/browser": 182,
  2600. "./util/logger": 189
  2601. }],
  2602. 4: [function(u, d, e) {
  2603. (function(e) {
  2604. "use strict";
  2605. function r(n, e, t, i) {
  2606. function r(e) {
  2607. a[e.sid] = !0;
  2608. var t = e.billboard.media && e.billboard.media.type
  2609. , i = {
  2610. tag_id: e.sid,
  2611. tags_visited: Object.keys(a).length,
  2612. tag_count: Object.keys(n.tags).length,
  2613. tag_view_count: ++d,
  2614. has_media: !!t
  2615. };
  2616. t && (i.media_type = t),
  2617. g("tag_opened", i)
  2618. }
  2619. var o, a = {}, s = Date.now() - P, l = null;
  2620. i && (l = Date.now() - window.navigationStart);
  2621. try {
  2622. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2623. } catch (n) {
  2624. o = !1
  2625. }
  2626. var c, h = n.supportsVR;
  2627. h || (c = "VR disabled at the model/account level",
  2628. 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"))),
  2629. g("model_loaded", {
  2630. duration: s,
  2631. duration_from_navigation_start: l,
  2632. has_hlr: o,
  2633. has_vr: h,
  2634. vr_reason: c
  2635. });
  2636. var u = 0;
  2637. n.panos.forEach(function(e) {
  2638. e.on("enter", function() {
  2639. f("pano_viewed", {
  2640. pano_id: e.id,
  2641. pano_view_count: ++u,
  2642. alignment_type: e.alignmentType,
  2643. interaction_source: R,
  2644. navigation_source: v
  2645. })
  2646. })
  2647. });
  2648. var d = 0;
  2649. for (var p in n.tags)
  2650. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2651. e.on("tour_auto", function(e) {
  2652. v = "tour_" + e
  2653. }),
  2654. e.on("tour_manual", function(e) {
  2655. R = "gui-" + e,
  2656. v = "tour_manual"
  2657. }),
  2658. t.on(C.InteractionKey, function() {
  2659. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2660. }),
  2661. t.on(C.InteractionDirect, function() {
  2662. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2663. }),
  2664. function(t) {
  2665. I.on(T.OPENED, function() {
  2666. f("showcase_share_intent", {
  2667. pano_id: t.currentPano && t.currentPano.id
  2668. })
  2669. }),
  2670. I.on(T.LINK_CLICKED, function(e) {
  2671. f("showcase_share_action", {
  2672. channel: e.channel,
  2673. pano_id: t.currentPano && t.currentPano.id
  2674. })
  2675. }),
  2676. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2677. f("showcase_share_origin_link_clicked")
  2678. })
  2679. }(e),
  2680. function() {
  2681. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2682. gui_action: "click_vr_button"
  2683. })),
  2684. _.on(S.LAUNCH, function(e) {
  2685. f("showcase_gui", {
  2686. gui_action: "launch_vr",
  2687. vr_platform: e.vr_platform,
  2688. vr_app: e.vr_app
  2689. })
  2690. }),
  2691. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2692. gui_action: "vr_modal_prev"
  2693. })),
  2694. _.on(S.NEXT, function(e) {
  2695. f("showcase_gui", {
  2696. gui_action: e.nextAction
  2697. })
  2698. }),
  2699. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2700. gui_action: "vr_modal_close"
  2701. })),
  2702. _.on(S.falseICECHOSEN, function(e) {
  2703. f("showcase_gui", {
  2704. gui_action: e.name + " "
  2705. })
  2706. }),
  2707. _.on(S.STORE, function(e) {
  2708. f("showcase_gui", {
  2709. gui_action: "launch_store",
  2710. store: e
  2711. })
  2712. })
  2713. }()
  2714. }
  2715. function f(e, t) {
  2716. if (t = t || {},
  2717. i)
  2718. try {
  2719. window.analytics.track(e, s.extendObject(t, c), {
  2720. context: {
  2721. app: {
  2722. name: "showcase",
  2723. version: "2.25.6-0-gd87e5b1"
  2724. },
  2725. screen: {
  2726. width: window.screen.width,
  2727. height: window.screen.height,
  2728. density: window.devicePixelRatio
  2729. }
  2730. }
  2731. })
  2732. } catch (t) {
  2733. console.warn("Failed to send data to segment for " + e)
  2734. }
  2735. }
  2736. function g(e, t) {
  2737. f(e, t = t || {})
  2738. }
  2739. function m(e, t) {
  2740. R = e === C.InteractionGui ? "gui-" + t : e,
  2741. v = "self_guided"
  2742. }
  2743. var v, o, a = (u("three"),
  2744. u("./util/ajax"),
  2745. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2746. 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"),
  2747. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2748. d.exports = {
  2749. report: function(e, t, i, n) {
  2750. !function(e, t) {
  2751. if (o)
  2752. try {
  2753. o.addEvent(e, s.extendObject({
  2754. host: window.location.host,
  2755. keen: {
  2756. addons: [{
  2757. name: "keen:ua_parser",
  2758. input: {
  2759. ua_string: "user_agent"
  2760. },
  2761. output: "parsed_user_agent"
  2762. }]
  2763. },
  2764. user_agent: "${keen.user_agent}",
  2765. referrer: {
  2766. url: s.normalizeUrl(document.referrer),
  2767. domain: s.domainFromUrl(document.referrer),
  2768. url_original: document.referrer
  2769. },
  2770. embedded: y.inIframe(),
  2771. is_mobile: y.isMobile(),
  2772. version: "2.25.6-0-gd87e5b1"
  2773. }, t))
  2774. } catch (e) {
  2775. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2776. }
  2777. }("Session starts", {
  2778. model: e,
  2779. status: t,
  2780. loadtime: Date.now() - (P || Date.now()),
  2781. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2782. autoplay: i,
  2783. quickstart: n,
  2784. ab_tilegen: a.tilegen,
  2785. ab_imgopt: a.imgopt
  2786. })
  2787. },
  2788. impression: function(e) {
  2789. g("impression", {
  2790. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2791. url_params: (void 0 !== e.immediate && e.immediate,
  2792. window.location.search.substr(1).split("&"))
  2793. })
  2794. },
  2795. initKeen: function(e) {
  2796. return e.token && e.appId ? void (o = new Keen({
  2797. projectId: e.appId,
  2798. writeKey: e.token,
  2799. readKey: "",
  2800. requestType: "xhr"
  2801. })) : void l.warn("no keen token/appId")
  2802. },
  2803. initSegment: function(e) {
  2804. return e.token ? (i = e.token,
  2805. window.analytics.load(e.token),
  2806. c = {
  2807. model_id: e.model,
  2808. start_source: e.startSource,
  2809. autoplay: e.autoplay,
  2810. quickstart: e.quickstart,
  2811. language_tag: t.languageTag,
  2812. is_mobile: y.isMobile(),
  2813. iframe: y.inIframe(),
  2814. aspect_ratio: y.aspectRatio(),
  2815. session_id: h,
  2816. window: {
  2817. width: $("#player").width(),
  2818. height: $("#player").height()
  2819. },
  2820. platform: {
  2821. browser: {
  2822. name: $.ua.browser.name,
  2823. major: $.ua.browser.major,
  2824. version: $.ua.browser.version
  2825. },
  2826. os: {
  2827. name: $.ua.os.name,
  2828. version: $.ua.os.version
  2829. },
  2830. device: {
  2831. vendor: $.ua.device.vendor,
  2832. model: $.ua.device.model,
  2833. type: $.ua.device.type
  2834. }
  2835. }
  2836. },
  2837. n = Math.random() < t.analytics.sessionTrackingRate,
  2838. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  2839. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  2840. },
  2841. sessionStart: function(e) {
  2842. l.debug("analytics user_session_start"),
  2843. f("session_started"),
  2844. P = Date.now(),
  2845. window.addEventListener("unload", function() {
  2846. !function(e, t) {
  2847. if (t = t || {},
  2848. navigator.sendBeacon && i)
  2849. try {
  2850. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2851. event: e,
  2852. anonymousId: window.analytics.user().anonymousId(),
  2853. properties: s.extendObject(t, c),
  2854. writeKey: i,
  2855. sentAt: Date.now(),
  2856. type: "track",
  2857. context: {
  2858. userAgent: y.userAgent(),
  2859. library: {
  2860. name: "showcase-beacon",
  2861. version: "2.25.6-0-gd87e5b1"
  2862. },
  2863. app: {
  2864. name: "showcase",
  2865. version: "2.25.6-0-gd87e5b1"
  2866. }
  2867. }
  2868. }))
  2869. } catch (e) {
  2870. console.warn("Failed to send async segment request")
  2871. }
  2872. }("session_ended", {
  2873. duration: Date.now() - P
  2874. })
  2875. })
  2876. },
  2877. modelLoaded: function(e, t, i, n) {
  2878. r(e, t, i, n)
  2879. },
  2880. loadComplete: function(e) {
  2881. f("load_times", {
  2882. time_to_app_start: e
  2883. })
  2884. },
  2885. track: function(e, t) {
  2886. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2887. f(e, t))
  2888. },
  2889. trackAlways: function(e, t) {
  2890. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2891. f(e, t)
  2892. },
  2893. getSessionId: function() {
  2894. return h
  2895. },
  2896. updateInteraction: m
  2897. }
  2898. }
  2899. ).call(this, "/js/analytics.js")
  2900. }
  2901. , {
  2902. "./ab": 3,
  2903. "./enum/ControlEvents": 21,
  2904. "./enum/PlayerEvents": 40,
  2905. "./enum/VROption": 47,
  2906. "./enum/VRPlatforms": 49,
  2907. "./enum/Viewmode": 51,
  2908. "./gui/sharing/ShareEvents": 76,
  2909. "./gui/sharing/modal": 77,
  2910. "./gui/title/TitleEvents": 80,
  2911. "./gui/title/titleBar": 82,
  2912. "./gui/vr/vrEvent": 85,
  2913. "./gui/vr/vrModal": 87,
  2914. "./localization/localize": 108,
  2915. "./tag/Billboard/BillboardEvent": 120,
  2916. "./settings": 166,
  2917. "./util/ajax": 181,
  2918. "./util/browser": 182,
  2919. "./util/common": 185,
  2920. "./util/logger": 189,
  2921. three: 217
  2922. }],
  2923. 5: [function(e, t, i) {
  2924. "use strict";
  2925. function n() {
  2926. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2927. this.controls = null
  2928. }
  2929. var r = e("three")
  2930. , o = e("../constants")
  2931. , a = e("../util/cameraLight");
  2932. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2933. this.aspect = e,
  2934. this.updateProjectionMatrix()
  2935. }
  2936. ,
  2937. t.exports = n
  2938. }
  2939. , {
  2940. "../constants": 8,
  2941. "../util/cameraLight": 184,
  2942. three: 217
  2943. }],
  2944. 6: [function(e, t, i) {
  2945. "use strict";
  2946. function n() {
  2947. var e = $("#player").width() / $("#player").height();
  2948. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  2949. this.controls = null,
  2950. this.updateAspect(e)
  2951. }
  2952. var r = e("three")
  2953. , o = e("../constants");
  2954. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  2955. this.aspect = e,
  2956. this.top = o.orthoBase / e,
  2957. this.bottom = -o.orthoBase / e,
  2958. this.updateProjectionMatrix()
  2959. }
  2960. ,
  2961. t.exports = n
  2962. }
  2963. , {
  2964. "../constants": 8,
  2965. three: 217
  2966. }],
  2967. 7: [function(e, t, i) {
  2968. "use strict";
  2969. function n() {
  2970. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  2971. this.controls = null
  2972. }
  2973. var r = e("three")
  2974. , o = e("../settings")
  2975. , a = e("../util/cameraLight");
  2976. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2977. this.aspect = e,
  2978. this.updateProjectionMatrix()
  2979. }
  2980. ,
  2981. t.exports = n
  2982. }
  2983. , {
  2984. "../settings": 166,
  2985. "../util/cameraLight": 184,
  2986. three: 217
  2987. }],
  2988. 8: [function(e, t, i) {
  2989. "use strict";
  2990. t.exports = {
  2991. signedUrlDefaultExpireTime: 24e4,
  2992. signedUrlCheckInterval: 1e4,
  2993. signedUrlRefreshBuffer: 15e3,
  2994. dollhouseFOV: 70,
  2995. dollhouseNear: 1,
  2996. dollhouseFar: 5e3,
  2997. insideFOV: 70,
  2998. insideFOVMax: 120,
  2999. insideNear: .1,
  3000. insideFar: 5e3,
  3001. insideLookSpeed: .12,
  3002. insideLookLimitUp: 40,
  3003. insideLookLimitDown: -40,
  3004. orthoNear: 1,
  3005. orthoFar: 5e3,
  3006. orthoBase: 10,
  3007. narrowLandscapeHeight: 290,
  3008. reallyNarrowLandscapeHeight: 250,
  3009. visionTilingStartDate: new Date("8/26/2016"),
  3010. visionTilingStartVersion: "1.1.407.13667",
  3011. windowHeightHighQualityThreshold: 900,
  3012. tourStepDelayDefault: 3500,
  3013. tourStepDelaySlideShow: 5e3,
  3014. workshopApsect: 9 / 16,
  3015. highQualityMaxZoom: 2,
  3016. ultraHighQualityMaxZoom: 3
  3017. }
  3018. }
  3019. , {}],
  3020. 9: [function(e, t, i) {
  3021. "use strict";
  3022. function n() {
  3023. this.activeControl = null,
  3024. this.controls = {},
  3025. this.cameras = {}
  3026. }
  3027. var a = e("./PanoramaControls")
  3028. , s = e("./DollhouseControls")
  3029. , l = e("./FloorplanControls")
  3030. , c = e("../cameras/PanoramaCamera")
  3031. , h = e("../cameras/DollhouseCamera")
  3032. , u = e("../cameras/FloorplanCamera")
  3033. , r = e("events").EventEmitter
  3034. , d = e("../enum/ControlEvents")
  3035. , o = e("../enum/ModelManagerEvents")
  3036. , p = e("../enum/Viewmode")
  3037. , f = e("../settings");
  3038. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3039. this.setUpControls(),
  3040. this.bindEvents(e, t)
  3041. }
  3042. ,
  3043. n.prototype.activateControls = function(e) {
  3044. this.activeControl && (this.activeControl.reset(),
  3045. this.activeControl.enabled = !1),
  3046. this.controls[e] && (this.controls[e].enabled = !0),
  3047. this.activeControl = this.controls[e]
  3048. }
  3049. ,
  3050. n.prototype.setUpControls = function() {
  3051. var i = {}
  3052. , n = {}
  3053. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3054. , r = [c, h, u]
  3055. , o = [a, s, l];
  3056. e.forEach(function(e, t) {
  3057. i[e] = new r[t],
  3058. n[e] = new o[t](i[e]),
  3059. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3060. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3061. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3062. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3063. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3064. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3065. }
  3066. .bind(this)),
  3067. this.controls = n,
  3068. this.cameras = i
  3069. }
  3070. ,
  3071. n.prototype.bindEvents = function(e, t) {
  3072. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3073. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3074. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3075. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3076. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3077. passive: !1
  3078. }),
  3079. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3080. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3081. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3082. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3083. e.addEventListener("contextmenu", function(e) {
  3084. e.preventDefault()
  3085. }),
  3086. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3087. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3088. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3089. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3090. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3091. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3092. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3093. t.on(o.ActiveModelChanged, function(e) {
  3094. this.setModelForControls(e.model)
  3095. }
  3096. .bind(this))
  3097. }
  3098. ,
  3099. n.prototype.setModelForControls = function(e) {
  3100. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3101. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3102. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3103. this.controls[e].setBounds(t)
  3104. }
  3105. .bind(this))
  3106. }
  3107. ,
  3108. n.prototype.onMouseDown = function(e) {
  3109. e.preventDefault(),
  3110. this.activeControl && this.activeControl.onMouseDown(e)
  3111. }
  3112. ,
  3113. n.prototype.onMouseMove = function(e) {
  3114. e.preventDefault(),
  3115. this.activeControl && this.activeControl.onMouseMove(e)
  3116. }
  3117. ,
  3118. n.prototype.onMouseUp = function(e) {
  3119. e.preventDefault(),
  3120. this.activeControl && this.activeControl.onMouseUp(e)
  3121. }
  3122. ,
  3123. n.prototype.onMouseOver = function(e) {
  3124. e.preventDefault(),
  3125. this.activeControl && this.activeControl.onMouseOver(e)
  3126. }
  3127. ,
  3128. n.prototype.onMouseWheel = function(e) {
  3129. e.preventDefault(),
  3130. this.activeControl && this.activeControl.onMouseWheel(e)
  3131. }
  3132. ,
  3133. n.prototype.onTouchStart = function(e) {
  3134. e.preventDefault(),
  3135. this.activeControl && this.activeControl.onTouchStart(e),
  3136. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3137. $("#hotListContent ul .active").removeClass("active"),
  3138. $("#hotList")[0].classList.remove("active")
  3139. }
  3140. ,
  3141. n.prototype.onTouchMove = function(e) {
  3142. e.preventDefault(),
  3143. this.activeControl && this.activeControl.onTouchMove(e)
  3144. }
  3145. ,
  3146. n.prototype.onTouchEnd = function(e) {
  3147. e.preventDefault(),
  3148. this.activeControl && this.activeControl.onTouchEnd(e)
  3149. }
  3150. ,
  3151. n.prototype.onPointerDown = function(e) {
  3152. if (e.preventDefault(),
  3153. this.activeControl)
  3154. switch (e.pointerType) {
  3155. case "mouse":
  3156. this.activeControl.onMouseDown(e);
  3157. break;
  3158. default:
  3159. this.activeControl.onPointerDown(e)
  3160. }
  3161. }
  3162. ,
  3163. n.prototype.onPointerMove = function(e) {
  3164. if (e.preventDefault(),
  3165. this.activeControl)
  3166. switch (e.pointerType) {
  3167. case "mouse":
  3168. this.activeControl.onMouseMove(e);
  3169. break;
  3170. default:
  3171. this.activeControl.onPointerMove(e)
  3172. }
  3173. }
  3174. ,
  3175. n.prototype.onPointerUp = function(e) {
  3176. if (e.preventDefault(),
  3177. this.activeControl)
  3178. switch (e.pointerType) {
  3179. case "mouse":
  3180. this.activeControl.onMouseUp(e);
  3181. break;
  3182. default:
  3183. this.activeControl.onPointerUp(e)
  3184. }
  3185. }
  3186. ,
  3187. n.prototype.onPointerCancel = function(e) {
  3188. e.preventDefault(),
  3189. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3190. }
  3191. ,
  3192. n.prototype.onKeyDown = function(e) {
  3193. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3194. this.activeControl && this.activeControl.onKeyDown(e))
  3195. }
  3196. ,
  3197. n.prototype.onKeyUp = function(e) {
  3198. e.preventDefault(),
  3199. this.activeControl && this.activeControl.onKeyUp(e)
  3200. }
  3201. ,
  3202. t.exports = n
  3203. }
  3204. , {
  3205. "../cameras/DollhouseCamera": 5,
  3206. "../cameras/FloorplanCamera": 6,
  3207. "../cameras/PanoramaCamera": 7,
  3208. "../enum/ControlEvents": 21,
  3209. "../enum/ModelManagerEvents": 33,
  3210. "../enum/Viewmode": 51,
  3211. "../settings": 166,
  3212. "./DollhouseControls": 10,
  3213. "./FloorplanControls": 11,
  3214. "./PanoramaControls": 13,
  3215. events: 202
  3216. }],
  3217. 10: [function(e, t, i) {
  3218. "use strict";
  3219. function n(e) {
  3220. a.call(this, e),
  3221. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3222. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3223. this.minDistance = o.dollhouseDefault.minDistance,
  3224. this.maxDistance = o.dollhouseDefault.maxDistance,
  3225. this.adjustedMinDistance = this.minDistance,
  3226. this.adjustedMaxDistance = this.maxDistance
  3227. }
  3228. var r = e("three")
  3229. , o = e("../settings")
  3230. , a = e("./OutsideControls");
  3231. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3232. this.camera.updateMatrix();
  3233. var i = this.camera.position.clone().sub(this.target).length();
  3234. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3235. this.panLeft(2 * e * i / $("#player").height()),
  3236. this.panUp(-2 * t * i / $("#player").height())
  3237. }
  3238. ,
  3239. n.prototype.updateZoom = function() {
  3240. return this.offset.length() * this.scale
  3241. }
  3242. ,
  3243. n.prototype.setZoomBounds = function(e) {
  3244. var t = e.min.distanceTo(e.max);
  3245. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3246. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3247. this.minDistance = this.adjustedMinDistance,
  3248. this.maxDistance = this.adjustedMaxDistance
  3249. }
  3250. ,
  3251. n.prototype.resetRanges = function(e, t) {
  3252. e ? (this.minDistance = Math.min(e, this.minDistance),
  3253. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3254. this.maxDistance = this.adjustedMaxDistance),
  3255. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3256. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3257. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3258. }
  3259. ,
  3260. n.prototype.toJSON = function() {
  3261. return a.prototype.toJSON.call(this)
  3262. }
  3263. ,
  3264. t.exports = n
  3265. }
  3266. , {
  3267. "../settings": 166,
  3268. "./OutsideControls": 12,
  3269. three: 217
  3270. }],
  3271. 11: [function(e, t, i) {
  3272. "use strict";
  3273. function n(e) {
  3274. c.call(this, e),
  3275. this.minDistance = 15,
  3276. this.maxDistance = 50,
  3277. this.noRotateUpDown = !0,
  3278. this.minPolarAngle = 0,
  3279. this.maxPolarAngle = 0,
  3280. this.mouseActions[u.LEFT] = h.PAN,
  3281. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3282. this.mouseActions[u.RIGHT] = h.ROTATE,
  3283. this.touchActions[1] = h.PAN,
  3284. this.touchActions[2] = h.ROTATE_DOLLY,
  3285. this.absoluteScale = 1,
  3286. this.currentScale = 1
  3287. }
  3288. 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");
  3289. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3290. var t = Math.max(e.x, e.z)
  3291. , i = Math.min(e.x, e.z)
  3292. , n = Math.max(t, i * this.camera.aspect)
  3293. , r = Math.max(i, t * this.camera.aspect);
  3294. this.absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2,
  3295. this.currentScale = this.absoluteScale
  3296. }
  3297. ,
  3298. n.prototype.rotateToView = function(e, t) {
  3299. var i = 0;
  3300. p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2,
  3301. this.rotateLeft(i),
  3302. this.update(0)
  3303. }
  3304. ,
  3305. n.prototype.pan = function(e, t) {
  3306. this.camera.updateMatrix(),
  3307. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3308. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3309. }
  3310. ,
  3311. n.prototype.updateZoom = function() {
  3312. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3313. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3314. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3315. this.camera.left = -l.orthoBase * this.currentScale,
  3316. this.camera.right = l.orthoBase * this.currentScale,
  3317. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3318. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3319. this.camera.updateProjectionMatrix(),
  3320. this.offset.length()
  3321. }
  3322. ,
  3323. n.prototype.toJSON = (r = new s.Quaternion,
  3324. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3325. a = new s.Quaternion,
  3326. function() {
  3327. var e = c.prototype.toJSON.call(this);
  3328. return r.copy(e.camera_quaternion),
  3329. a.copy(o),
  3330. a.multiply(r),
  3331. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3332. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3333. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3334. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3335. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3336. e
  3337. }
  3338. ),
  3339. t.exports = n
  3340. }
  3341. , {
  3342. "../enum/ControlActions": 20,
  3343. "../enum/MouseButton": 34,
  3344. "../settings": 166,
  3345. "../util/browser": 182,
  3346. "../util/math": 190,
  3347. "./OutsideControls": 12,
  3348. three: 217
  3349. }],
  3350. 12: [function(e, t, i) {
  3351. "use strict";
  3352. function n(e) {
  3353. this.camera = e,
  3354. (this.camera.controls = this).enabled = !1,
  3355. this.target = new a.Vector3,
  3356. this.targetBounds = new a.Box3,
  3357. this.zoomSpeed = 2,//编辑时缩放快一些
  3358. this.minDistance = 0,
  3359. this.maxDistance = 1 / 0,
  3360. this.noRotateUpDown = !1,
  3361. this.rotateSpeed = 1,
  3362. this.keyboardZoomSpeed = 0,
  3363. this.keyPanSpeed = 7,
  3364. this.autoRotate = !1,
  3365. this.autoRotateSpeed = 2,
  3366. this.autoPan = !1,
  3367. this.autoPanPosition = new a.Vector3,
  3368. this.minPolarAngle = a.Math.degToRad(25),
  3369. this.maxPolarAngle = a.Math.degToRad(65),
  3370. this.rotationAcceleration = new a.Vector2,
  3371. this.rotationSpeed = new a.Vector2,
  3372. this.panAcceleration = new a.Vector2,
  3373. this.panSpeed = new a.Vector2,
  3374. this.rotateStart = new a.Vector2,
  3375. this.rotateEnd = new a.Vector2,
  3376. this.rotateDelta = new a.Vector2,
  3377. this.panStart = new a.Vector2,
  3378. this.panEnd = new a.Vector2,
  3379. this.panDelta = new a.Vector2,
  3380. this.panOffset = new a.Vector3,
  3381. this.offset = new a.Vector3,
  3382. this.dollyStart = new a.Vector2,
  3383. this.dollyEnd = new a.Vector2,
  3384. this.dollyDelta = new a.Vector2,
  3385. this.phiDelta = 0,
  3386. this.thetaDelta = 0,
  3387. this.scale = 1,
  3388. this.panVector = new a.Vector3,
  3389. this.lastPosition = new a.Vector3,
  3390. this.state = u.NONE,
  3391. this.mouseActions = {},
  3392. this.mouseActions[d.LEFT] = u.ROTATE,
  3393. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3394. this.mouseActions[d.RIGHT] = u.PAN,
  3395. this.touchActions = {},
  3396. this.touchActions[1] = u.ROTATE,
  3397. this.touchActions[2] = u.PAN_DOLLY,
  3398. this.lastMoveTime = 0,
  3399. this.pointersLimit = 2,
  3400. this.pointers = []
  3401. }
  3402. 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;
  3403. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3404. this.targetBounds = e
  3405. }
  3406. ,
  3407. n.prototype.isEngaged = function() {
  3408. return this.state !== u.NONE
  3409. }
  3410. ,
  3411. n.prototype.rotateLeft = function(e) {
  3412. void 0 === e && (e = this.getAutoRotationAngle()),
  3413. this.thetaDelta -= e
  3414. }
  3415. ,
  3416. n.prototype.rotateUp = function(e) {
  3417. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3418. this.phiDelta -= e)
  3419. }
  3420. ,
  3421. n.prototype.panLeft = function(e) {
  3422. var t = this.camera.matrix.elements;
  3423. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3424. this.panOffset.multiplyScalar(-e),
  3425. this.panVector.add(this.panOffset)
  3426. }
  3427. ,
  3428. n.prototype.panUp = function(e) {
  3429. var t = this.camera.matrix.elements;
  3430. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3431. this.panOffset.multiplyScalar(-e),
  3432. this.panVector.add(this.panOffset)
  3433. }
  3434. ,
  3435. n.prototype.startRotating = function(e, t) {
  3436. e && this.navRotationAcc("x", e),
  3437. t && this.navRotationAcc("y", t)
  3438. }
  3439. ,
  3440. n.prototype.stopRotating = function(e) {
  3441. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3442. this.navRotationAcc("x", 0),
  3443. this.navRotationAcc("y", 0)
  3444. }
  3445. ,
  3446. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3447. o = new a.Vector3,
  3448. function(e, t) {
  3449. r.copy(this.camera.position),
  3450. void 0 === e && null === e || r.setX(e),
  3451. void 0 === t && null === t || r.setZ(t);
  3452. var i = this.camera.position.distanceTo(this.target)
  3453. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3454. this.targetClamped = !1,
  3455. o.copy(r).addScaledVector(n, i),
  3456. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3457. r.copy(o).addScaledVector(n, -i),
  3458. this.targetClamped = !0),
  3459. this.autoPanPosition.x = r.x,
  3460. this.autoPanPosition.z = r.z,
  3461. this.autoPan && this.stopAutoPanning()
  3462. }
  3463. ),
  3464. n.prototype.stopAutoPanning = function() {
  3465. var e = this.autoPan;
  3466. this.autoPan = !1,
  3467. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3468. }
  3469. ,
  3470. n.prototype.dollyIn = function(e) {
  3471. void 0 === e && (e = this.getZoomScale()),
  3472. this.scale /= e
  3473. }
  3474. ,
  3475. n.prototype.dollyOut = function(e) {
  3476. void 0 === e && (e = this.getZoomScale()),
  3477. this.scale *= e
  3478. }
  3479. ,
  3480. n.prototype.updatePan = function(e) {
  3481. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3482. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3483. this.autoPan) {
  3484. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3485. t.setY(0).clampLength(0, 50 * e),
  3486. this.target.add(t),
  3487. this.camera.position.add(t),
  3488. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3489. this.stopAutoPanning())
  3490. }
  3491. }
  3492. ,
  3493. n.prototype.update = function(e) {
  3494. e = e || 1 / 60,
  3495. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3496. this.rotateLeft(-this.rotationSpeed.x),
  3497. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3498. this.updatePan(e);
  3499. var t = this.camera.position;
  3500. this.offset.copy(t).sub(this.target);
  3501. var i = Math.atan2(this.offset.x, this.offset.z)
  3502. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3503. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3504. i += this.thetaDelta,
  3505. n += this.phiDelta,
  3506. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3507. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3508. var r = this.updateZoom();
  3509. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3510. this.target.add(this.panVector),
  3511. this.targetBounds.clampPoint(this.target, this.target),
  3512. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3513. this.offset.y = r * Math.cos(n),
  3514. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3515. t.copy(this.target).add(this.offset),
  3516. this.camera.lookAt(this.target),
  3517. this.thetaDelta = 0,
  3518. this.phiDelta = 0,
  3519. this.scale = 1,
  3520. this.panVector.set(0, 0, 0),
  3521. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3522. }
  3523. ,
  3524. n.prototype.getAutoRotationAngle = function() {
  3525. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3526. }
  3527. ,
  3528. n.prototype.getZoomScale = function() {
  3529. return Math.pow(.95, this.zoomSpeed)
  3530. }
  3531. ,
  3532. n.prototype.onMouseDown = function(e) {
  3533. if (this.enabled) {
  3534. switch (e.preventDefault(),
  3535. this.stopAutoPanning(),
  3536. this.mouseDown = !0,
  3537. this.state = this.mouseActions[e.button],
  3538. this.state) {
  3539. case u.ROTATE:
  3540. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3541. this.rotationSpeed.set(0, 0);
  3542. break;
  3543. case u.DOLLY:
  3544. this.dollyStart.set(e.clientX, e.clientY);
  3545. break;
  3546. case u.PAN:
  3547. this.panStart.set(e.clientX, e.clientY)
  3548. }
  3549. this.emit(f.InputStart, "mouse")
  3550. }
  3551. }
  3552. ,
  3553. n.prototype.onMouseMove = function(e) {
  3554. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3555. switch (e.preventDefault(),
  3556. this.state) {
  3557. case u.ROTATE:
  3558. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3559. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3560. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3561. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3562. this.rotateStart.copy(this.rotateEnd);
  3563. break;
  3564. case u.DOLLY:
  3565. this.dollyEnd.set(e.clientX, e.clientY),
  3566. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3567. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3568. this.dollyStart.copy(this.dollyEnd);
  3569. break;
  3570. case u.PAN:
  3571. this.panEnd.set(e.clientX, e.clientY),
  3572. this.panDelta.subVectors(this.panEnd, this.panStart),
  3573. this.pan(this.panDelta.x, this.panDelta.y),
  3574. this.panStart.copy(this.panEnd)
  3575. }
  3576. this.emit(f.Move, "mouse"),
  3577. this.lastMoveTime = e.timeStamp,
  3578. this.update()
  3579. }
  3580. }
  3581. ,
  3582. n.prototype.onMouseUp = function(e) {
  3583. this.enabled && (this.mouseDown = !1,
  3584. this.state = u.NONE,
  3585. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3586. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3587. this.update(),
  3588. this.rotationAcceleration.set(0, 0),
  3589. this.rotateDelta.set(0, 0)))
  3590. }
  3591. ,
  3592. n.prototype.onMouseOver = function(e) {
  3593. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3594. }
  3595. ,
  3596. n.prototype.onMouseWheel = function(e) {
  3597. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3598. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3599. this.update())
  3600. }
  3601. ,
  3602. n.prototype.onKeyDown = function(e) {
  3603. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3604. this.handleKeyDown(e.which)))
  3605. }
  3606. ,
  3607. n.prototype.navRotationAcc = function(e, t) {
  3608. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3609. }
  3610. ,
  3611. n.prototype.navPanAcc = function(e, t) {
  3612. this.stopAutoPanning(),
  3613. this.panAcceleration[e] = t
  3614. }
  3615. ,
  3616. n.prototype.handleKeyDown = function(e) {
  3617. var t = !0;
  3618. switch (e) {
  3619. case p.UPARROW:
  3620. case p.I:
  3621. this.navRotationAcc("y", 1);
  3622. break;
  3623. case p.DOWNARROW:
  3624. case p.K:
  3625. this.navRotationAcc("y", -1);
  3626. break;
  3627. case p.LEFTARROW:
  3628. case p.J:
  3629. this.navRotationAcc("x", -1);
  3630. break;
  3631. case p.RIGHTARROW:
  3632. case p.L:
  3633. this.navRotationAcc("x", 1);
  3634. break;
  3635. case p.W:
  3636. this.navPanAcc("y", 1);
  3637. break;
  3638. case p.S:
  3639. this.navPanAcc("y", -1);
  3640. break;
  3641. case p.A:
  3642. this.navPanAcc("x", -1);
  3643. break;
  3644. case p.D:
  3645. this.navPanAcc("x", 1);
  3646. break;
  3647. default:
  3648. t = !1
  3649. }
  3650. t && this.emit(f.Move, "key")
  3651. }
  3652. ,
  3653. n.prototype.onKeyUp = function(e) {
  3654. this.enabled && (e.preventDefault(),
  3655. e.stopPropagation(),
  3656. this.handleKeyUp(e.which))
  3657. }
  3658. ,
  3659. n.prototype.handleKeyUp = function(e) {
  3660. switch (e) {
  3661. case p.I:
  3662. case p.K:
  3663. case p.UPARROW:
  3664. case p.DOWNARROW:
  3665. this.keyboardZoomSpeed = 0,
  3666. this.rotationAcceleration.y = 0;
  3667. break;
  3668. case p.J:
  3669. case p.L:
  3670. case p.LEFTARROW:
  3671. case p.RIGHTARROW:
  3672. this.rotationAcceleration.x = 0;
  3673. break;
  3674. case p.S:
  3675. case p.W:
  3676. this.panAcceleration.y = 0;
  3677. break;
  3678. case p.A:
  3679. case p.D:
  3680. this.panAcceleration.x = 0
  3681. }
  3682. }
  3683. ,
  3684. n.prototype.onTouchStart = function(i) {
  3685. if (this.enabled || this.state === u.NONE) {
  3686. i.preventDefault(),
  3687. i.stopPropagation(),
  3688. this.stopAutoPanning();
  3689. var e = function() {
  3690. if (2 === i.touches.length) {
  3691. var e = i.touches[0].pageX - i.touches[1].pageX
  3692. , t = i.touches[0].pageY - i.touches[1].pageY;
  3693. this.dollyStart.set(e, t)
  3694. }
  3695. }
  3696. .bind(this)
  3697. , t = function() {
  3698. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3699. }
  3700. .bind(this)
  3701. , n = function() {
  3702. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3703. }
  3704. .bind(this);
  3705. switch (this.state = this.touchActions[i.touches.length],
  3706. this.state) {
  3707. case u.PAN_DOLLY:
  3708. e();
  3709. case u.PAN:
  3710. t();
  3711. break;
  3712. case u.ROTATE_DOLLY:
  3713. e();
  3714. case u.ROTATE:
  3715. n()
  3716. }
  3717. this.rotationSpeed.set(0, 0),
  3718. this.emit(f.InputStart, "touch")
  3719. }
  3720. }
  3721. ,
  3722. n.prototype.onTouchMove = function(a) {
  3723. if (this.enabled && this.state !== u.NONE) {
  3724. a.preventDefault(),
  3725. a.stopPropagation();
  3726. var s = function() {
  3727. var e = a.touches[0].pageX - a.touches[1].pageX
  3728. , t = a.touches[0].pageY - a.touches[1].pageY;
  3729. this.dollyEnd.set(e, t);
  3730. var i = this.dollyStart.length() - this.dollyEnd.length();
  3731. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3732. this.dollyStart.copy(this.dollyEnd)
  3733. }
  3734. .bind(this)
  3735. , e = function() {
  3736. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3737. this.panDelta.subVectors(this.panEnd, this.panStart),
  3738. this.pan(this.panDelta.x, this.panDelta.y),
  3739. this.panStart.copy(this.panEnd),
  3740. this.rotateDelta.set(0, 0)
  3741. }
  3742. .bind(this)
  3743. , l = function() {
  3744. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3745. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3746. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3747. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3748. this.rotateStart.copy(this.rotateEnd)
  3749. }
  3750. .bind(this)
  3751. , t = function() {
  3752. if (2 === a.touches.length) {
  3753. var e = window.devicePixelRatio || 1
  3754. , t = a.touches[1].pageX - a.touches[0].pageX
  3755. , i = a.touches[1].pageY - a.touches[0].pageY
  3756. , n = Math.sqrt(t * t + i * i);
  3757. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3758. this.state = u.DOLLY,
  3759. s();
  3760. else {
  3761. var r = h.average(a.touches, "pageX")
  3762. , o = h.average(a.touches, "pageY");
  3763. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3764. this.rotateStart.set(r, o),
  3765. l())
  3766. }
  3767. }
  3768. }
  3769. .bind(this);
  3770. switch (this.state) {
  3771. case u.PAN_DOLLY:
  3772. s();
  3773. case u.PAN:
  3774. e();
  3775. break;
  3776. case u.ROTATE_DOLLY:
  3777. t();
  3778. break;
  3779. case u.DOLLY:
  3780. s();
  3781. break;
  3782. case u.ROTATE:
  3783. l();
  3784. break;
  3785. default:
  3786. this.state = u.NONE
  3787. }
  3788. this.lastMoveTime = a.timeStamp,
  3789. this.emit(f.Move, "touch")
  3790. }
  3791. }
  3792. ,
  3793. n.prototype.onTouchEnd = function(e) {
  3794. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3795. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3796. this.state = u.NONE,
  3797. this.update(),
  3798. this.rotationAcceleration.set(0, 0),
  3799. this.rotateDelta.set(0, 0))
  3800. }
  3801. ,
  3802. n.prototype.onPointerDown = function(e) {
  3803. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3804. id: e.pointerId,
  3805. pageX: e.pageX,
  3806. pageY: e.pageY
  3807. }),
  3808. e.touches = this.pointers,
  3809. this.onTouchStart(e)),
  3810. this.emit(f.InputStart, "pointer"))
  3811. }
  3812. ,
  3813. n.prototype.onPointerMove = function(t) {
  3814. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  3815. t.pointerId === e.id && (e.pageX = t.pageX,
  3816. e.pageY = t.pageY)
  3817. }),
  3818. t.touches = this.pointers,
  3819. this.onTouchMove(t))
  3820. }
  3821. ,
  3822. n.prototype.onPointerUp = function(i) {
  3823. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  3824. i.pointerId === e.id && this.pointers.splice(t, 1)
  3825. }
  3826. .bind(this)),
  3827. i.touches = this.pointers,
  3828. this.onTouchEnd(i))
  3829. }
  3830. ,
  3831. n.prototype.reset = function() {
  3832. this.state = u.NONE,
  3833. this.stopAutoPanning(),
  3834. this.rotationSpeed.set(0, 0),
  3835. this.rotationAcceleration.set(0, 0),
  3836. this.panSpeed.set(0, 0),
  3837. this.panAcceleration.set(0, 0)
  3838. }
  3839. ,
  3840. n.prototype.toJSON = function() {
  3841. return {
  3842. camera_position: {
  3843. x: s.toPrecision(this.camera.position.x, 4),
  3844. y: s.toPrecision(this.camera.position.y, 4),
  3845. z: s.toPrecision(this.camera.position.z, 4)
  3846. },
  3847. camera_quaternion: {
  3848. x: s.toPrecision(this.camera.quaternion.x, 4),
  3849. y: s.toPrecision(this.camera.quaternion.y, 4),
  3850. z: s.toPrecision(this.camera.quaternion.z, 4),
  3851. w: s.toPrecision(this.camera.quaternion.w, 4)
  3852. }
  3853. }
  3854. }
  3855. ,
  3856. t.exports = n
  3857. }
  3858. , {
  3859. "../enum/ControlActions": 20,
  3860. "../enum/ControlEvents": 21,
  3861. "../enum/Keys": 30,
  3862. "../enum/MouseButton": 34,
  3863. "../enum/Vectors": 50,
  3864. "../settings": 166,
  3865. "../util/common": 185,
  3866. "../util/math": 190,
  3867. events: 202,
  3868. three: 217
  3869. }],
  3870. 13: [function(u, d, e) {
  3871. (function(e) {
  3872. "use strict";
  3873. function t(e) {
  3874. this.camera = e,
  3875. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  3876. this.lookVector = new s.Vector3,
  3877. this.lookSpeed = .05,
  3878. this.rotationAcc = new s.Vector2,
  3879. this.rotationSpeed = new s.Vector2,
  3880. this.lat = 0,
  3881. this.lon = 0,
  3882. this.phi = 0,
  3883. this.theta = 0,
  3884. this.enabled = !1,
  3885. this.locked = !1,
  3886. this.pointer = new s.Vector2(0,0),
  3887. this.rotationHistory = [],
  3888. this.rotationDifference = new s.Vector2,
  3889. this.pointerDragOn = !1,
  3890. this.pointerDragStart = new s.Vector2(0,0),
  3891. this.pinchDistance = 0,
  3892. this.moveStart = new s.Vector2,
  3893. this.moveTolerance = .01,
  3894. this.pointersLimit = 2,
  3895. this.pointers = []
  3896. }
  3897. var s = u("three")
  3898. , i = u("../util/logger")
  3899. , n = u("../settings")
  3900. , r = u("../util/common")
  3901. , o = u("../util/math")
  3902. , a = (u("../enum/Vectors"),
  3903. u("../enum/MouseButton"))
  3904. , l = u("../enum/Keys")
  3905. , c = u("../enum/ControlEvents")
  3906. , h = u("events").EventEmitter;
  3907. new i(e),
  3908. (t.prototype = Object.create(h.prototype)).usable = function() {
  3909. return this.enabled && !this.locked
  3910. }
  3911. ,
  3912. t.prototype.lookAt = function(e) {
  3913. var t = this.camera.position.clone().sub(e)
  3914. , i = Math.atan(t.z / t.x);
  3915. i += t.x < 0 ? Math.PI : 0,
  3916. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  3917. this.lon = s.Math.radToDeg(i) + 180;
  3918. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  3919. , r = Math.atan(t.y / n);
  3920. this.lat = -s.Math.radToDeg(r)
  3921. }
  3922. ,
  3923. t.prototype.startRotationFrom = function(e, t) {
  3924. o.convertScreenPositionToNDC(e, t, this.pointer),
  3925. this.pointerDragOn = !0,
  3926. this.pointerDragStart.copy(this.pointer),
  3927. this.moveStart.copy(this.pointer),
  3928. this.rotationHistory = [],
  3929. this.rotationSpeed.set(0, 0)
  3930. }
  3931. ,
  3932. t.prototype.onMouseOver = function(e) {
  3933. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3934. }
  3935. ,
  3936. t.prototype.onTouchStart = function(e) {
  3937. if (this.usable()) {
  3938. switch (e.preventDefault(),
  3939. e.stopPropagation(),
  3940. e.touches.length) {
  3941. case 1:
  3942. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  3943. break;
  3944. case 2:
  3945. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  3946. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  3947. this.pinchDistance = Math.sqrt(t * t + i * i)
  3948. }
  3949. this.emit(c.InputStart, "touch")
  3950. }
  3951. }
  3952. ,
  3953. t.prototype.onPointerDown = function(e) {
  3954. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3955. id: e.pointerId,
  3956. clientX: e.clientX,
  3957. clientY: e.clientY
  3958. }),
  3959. e.touches = this.pointers,
  3960. this.onTouchStart(e),
  3961. this.emit(c.InputStart, "pointer"))
  3962. }
  3963. ,
  3964. t.prototype.onMouseDown = function(e) {
  3965. if (this.usable()) {
  3966. switch (e.preventDefault(),
  3967. e.stopPropagation(),
  3968. e.button) {
  3969. case a.LEFT:
  3970. this.startRotationFrom(e.clientX, e.clientY)
  3971. }
  3972. this.emit(c.InputStart, "mouse")
  3973. }
  3974. }
  3975. ,
  3976. t.prototype.updateRotation = function() {
  3977. if (this.usable() && this.pointerDragOn) {
  3978. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  3979. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  3980. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  3981. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  3982. , r = Math.atan2(e.y, i)
  3983. , o = Math.atan2(t.y, n);
  3984. this.rotationDifference.y = s.Math.radToDeg(r - o),
  3985. e.y = 0,
  3986. t.y = 0;
  3987. var a = Math.acos(e.dot(t) / e.length() / t.length());
  3988. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  3989. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  3990. this.pointerDragStart.copy(this.pointer)
  3991. }
  3992. }
  3993. ,
  3994. t.prototype.onMouseMove = function(e) {
  3995. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  3996. 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"))
  3997. }
  3998. ,
  3999. t.prototype.onTouchMove = function(e) {
  4000. if (this.usable())
  4001. switch (this.emit(c.Move, "touch"),
  4002. e.touches.length) {
  4003. case 1:
  4004. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4005. break;
  4006. case 2:
  4007. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4008. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4009. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4010. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4011. this.emit(c.Pinch, n),
  4012. this.pinchDistance -= n)
  4013. }
  4014. }
  4015. ,
  4016. t.prototype.onPointerMove = function(t) {
  4017. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4018. t.pointerId === e.id && (e.clientX = t.clientX,
  4019. e.clientY = t.clientY)
  4020. }),
  4021. t.touches = this.pointers,
  4022. this.onTouchMove(t))
  4023. }
  4024. ,
  4025. t.prototype.endRotation = function() {
  4026. this.pointerDragOn = !1;
  4027. var e = r.averageVectors(this.rotationHistory);
  4028. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4029. }
  4030. ,
  4031. t.prototype.onTouchEnd = function(e) {
  4032. this.usable() && (e.preventDefault(),
  4033. e.stopPropagation(),
  4034. this.endRotation())
  4035. }
  4036. ,
  4037. t.prototype.onMouseUp = function(e) {
  4038. this.usable() && (e.preventDefault(),
  4039. e.stopPropagation(),
  4040. this.endRotation())
  4041. }
  4042. ,
  4043. t.prototype.onPointerUp = function(i) {
  4044. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4045. i.pointerId === e.id && this.pointers.splice(t, 1)
  4046. }
  4047. .bind(this)),
  4048. i.touches = this.pointers,
  4049. this.onTouchEnd(i))
  4050. }
  4051. ,
  4052. t.prototype.update = function(e) {
  4053. for (this.lon,
  4054. this.lat,
  4055. this.updateRotation(),
  4056. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4057. this.rotationHistory.shift();
  4058. this.lon += this.rotationDifference.x,
  4059. this.lat += this.rotationDifference.y,
  4060. this.rotationDifference.set(0, 0),
  4061. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4062. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4063. this.lon += this.rotationSpeed.x * e,
  4064. this.lat += this.rotationSpeed.y * e,
  4065. this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4066. this.phi = s.Math.degToRad(90 - this.lat),
  4067. this.theta = s.Math.degToRad(this.lon),
  4068. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4069. this.lookVector.y = Math.cos(this.phi),
  4070. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4071. this.target.copy(this.lookVector).add(this.camera.position),
  4072. this.camera.lookAt(this.target)
  4073. }
  4074. ,
  4075. t.prototype.onMouseWheel = function(e) {
  4076. if (this.usable()) {
  4077. var t = e.wheelDelta || -e.detail;
  4078. this.emit(c.InteractionDirect),
  4079. this.emit(c.Scroll, t)
  4080. }
  4081. }
  4082. ,
  4083. t.prototype.onKeyDown = function(e) {
  4084. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4085. this.handleKeyDown(e.which)))
  4086. }
  4087. ,
  4088. t.prototype.handleKeyDown = function(e) {
  4089. var t = function(e, t) {
  4090. this.rotationAcc[e] = t
  4091. }
  4092. .bind(this);
  4093. this.emit(c.InteractionKey);
  4094. var i = !0;
  4095. switch (e) {
  4096. case l.LEFTARROW:
  4097. case l.J:
  4098. t("x", -1);
  4099. break;
  4100. case l.RIGHTARROW:
  4101. case l.L:
  4102. t("x", 1);
  4103. break;
  4104. case l.I:
  4105. t("y", 1);
  4106. break;
  4107. case l.K:
  4108. t("y", -1);
  4109. break;
  4110. default:
  4111. i = !1
  4112. }
  4113. i && this.emit(c.Move, "key")
  4114. }
  4115. ,
  4116. t.prototype.onKeyUp = function(e) {
  4117. this.usable() && (e.preventDefault(),
  4118. e.stopPropagation(),
  4119. this.handleKeyUp(e.which))
  4120. }
  4121. ,
  4122. t.prototype.handleKeyUp = function(e) {
  4123. switch (e) {
  4124. case l.LEFTARROW:
  4125. case l.J:
  4126. case l.RIGHTARROW:
  4127. case l.L:
  4128. this.rotationAcc.x = 0;
  4129. break;
  4130. case l.I:
  4131. case l.K:
  4132. this.rotationAcc.y = 0
  4133. }
  4134. }
  4135. ,
  4136. t.prototype.startRotating = function(e, t) {
  4137. e && (this.rotationAcc.x = e),
  4138. t && (this.rotationAcc.y = t)
  4139. }
  4140. ,
  4141. t.prototype.stopRotating = function(e) {
  4142. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4143. this.rotationAcc.set(0, 0)
  4144. }
  4145. ,
  4146. t.prototype.reset = function() {
  4147. this.pointerDragOn = !1,
  4148. this.rotationAcc.set(0, 0),
  4149. this.rotationSpeed.set(0, 0),
  4150. this.pointers = []
  4151. }
  4152. ,
  4153. t.prototype.toJSON = function() {
  4154. return {
  4155. camera_position: {
  4156. x: o.toPrecision(this.camera.position.x, 4),
  4157. y: o.toPrecision(this.camera.position.y, 4),
  4158. z: o.toPrecision(this.camera.position.z, 4)
  4159. },
  4160. camera_quaternion: {
  4161. x: o.toPrecision(this.camera.quaternion.x, 4),
  4162. y: o.toPrecision(this.camera.quaternion.y, 4),
  4163. z: o.toPrecision(this.camera.quaternion.z, 4),
  4164. w: o.toPrecision(this.camera.quaternion.w, 4)
  4165. }
  4166. }
  4167. }
  4168. ,
  4169. t.prototype.setStateFromJSON = function(e) {
  4170. this.camera.position.copy(e.camera_position),
  4171. this.camera.quaternion.copy(e.camera_quaternion)
  4172. }
  4173. ,
  4174. d.exports = t
  4175. }
  4176. ).call(this, "/js/controls/PanoramaControls.js")
  4177. }
  4178. , {
  4179. "../enum/ControlEvents": 21,
  4180. "../enum/Keys": 30,
  4181. "../enum/MouseButton": 34,
  4182. "../enum/Vectors": 50,
  4183. "../settings": 166,
  4184. "../util/common": 185,
  4185. "../util/logger": 189,
  4186. "../util/math": 190,
  4187. events: 202,
  4188. three: 217
  4189. }],
  4190. 14: [function(t, i, e) {
  4191. (function(e) {
  4192. "use strict";
  4193. var c = t("three")
  4194. , h = t("../enum/Viewmode")
  4195. , u = new (t("../util/logger"))(e);
  4196. i.exports = {
  4197. serialize: function(e) {
  4198. return encodeURI(JSON.stringify(e))
  4199. },
  4200. deserialize: function(e) {
  4201. function t(e) {
  4202. return e.reduce(function(e, t) {
  4203. return e && "number" == typeof t && !isNaN(t)
  4204. }, !0)
  4205. }
  4206. try {
  4207. var i = JSON.parse(decodeURI(e))
  4208. , n = {
  4209. mode: h.fromInt(i.camera_mode),
  4210. panoId: i.scan_id,
  4211. position: (new c.Vector3).copy(i.camera_position),
  4212. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4213. zoom: i.ortho_zoom,
  4214. floorVisibility: i.floor_visibility
  4215. }
  4216. , r = n.position;
  4217. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4218. var o = n.quaternion;
  4219. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4220. n
  4221. } catch (i) {
  4222. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4223. try {
  4224. var a = e.split(",")
  4225. , s = {
  4226. x: parseFloat(a[2]),
  4227. y: parseFloat(a[3]),
  4228. z: parseFloat(a[4])
  4229. }
  4230. , l = {
  4231. x: parseFloat(a[5]),
  4232. y: parseFloat(a[6]),
  4233. z: parseFloat(a[7]),
  4234. w: parseFloat(a[8])
  4235. };
  4236. return t([s.x, s.y, s.z]) || (s.x = 0,
  4237. s.y = 0,
  4238. s.z = 0),
  4239. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4240. l.y = 0,
  4241. l.z = 0,
  4242. l.w = 1),
  4243. {
  4244. mode: h.fromInt(a[0]),
  4245. panoId: a[1],
  4246. position: (new c.Vector3).copy(s),
  4247. quaternion: (new c.Quaternion).copy(l)
  4248. }
  4249. } catch (t) {
  4250. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4251. }
  4252. }
  4253. return null
  4254. }
  4255. }
  4256. }
  4257. ).call(this, "/js/controls/serializer.js")
  4258. }
  4259. , {
  4260. "../enum/Viewmode": 51,
  4261. "../util/logger": 189,
  4262. three: 217
  4263. }],
  4264. 15: [function(C, I, e) {
  4265. (function(e) {
  4266. "use strict";
  4267. function t() {
  4268. this.endlessLoop = r.warp.loop,
  4269. this.clock = new i.Clock(!0),
  4270. this.model = null,
  4271. this.player = null,
  4272. this.currentItem = null,
  4273. this.destinationItem = null,
  4274. this.tourIsPlaying = !1,
  4275. this.transitionStage = v.None,
  4276. this.nextFunc = null,
  4277. this.onTheBus = !1,
  4278. this.tourInProgress = !1,
  4279. this.reachSource = null,
  4280. this.interrupted = !1,
  4281. this.nItems = 0,
  4282. this.walkingSectionPaused = !1
  4283. }
  4284. var i = C("three")
  4285. , n = C("./util/logger")
  4286. , r = C("./settings")
  4287. , o = C("./util/transitions")
  4288. , a = C("events").EventEmitter
  4289. , s = C("./enum/Viewmode")
  4290. , l = C("./analytics")
  4291. , c = C("./enum/WarpStyle")
  4292. , h = (o = C("./util/transitions"),
  4293. C("./model/ModelManager"),
  4294. C("./enum/ModelManagerEvents"))
  4295. , u = C("./enum/DirectorEvents")
  4296. , d = C("./enum/PlayerEvents")
  4297. , p = (C("./enum/ControlEvents"),
  4298. C("./enum/BlackoutStyle"))
  4299. , f = C("./enum/PathDiscardMode")
  4300. , g = C("./enum/PathDisplayMode")
  4301. , m = (C("./player"),
  4302. new n(e))
  4303. , v = Object.freeze({
  4304. None: 0,
  4305. Moving: 1,
  4306. Aiming: 2,
  4307. Interlude: 3
  4308. })
  4309. , y = Object.freeze({
  4310. Forward: 1,
  4311. NoChange: 0,
  4312. Backwards: -1
  4313. })
  4314. , A = o.getUniqueId();
  4315. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4316. this.player = e,
  4317. this.modelManager = t,
  4318. this.updateModel(),
  4319. this.resetAll(),
  4320. this.bindEvents()
  4321. }
  4322. ,
  4323. t.prototype.resetAll = function() {
  4324. if (this.currentItem = null,
  4325. this.destinationItem = null,
  4326. this.tourIsPlaying = !1,
  4327. this.bgmReplay(),
  4328. this.transitionStage = v.None,
  4329. this.nextFunc = null,
  4330. this.onTheBus = !1,
  4331. this.reachSource = null,
  4332. this.interrupted = !1,
  4333. this.model) {
  4334. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4335. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4336. } else
  4337. this.defaultWarpStyle = c.BLACK,
  4338. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4339. this.resetSpecialTransition()
  4340. }
  4341. ,
  4342. t.prototype.updateModel = function() {
  4343. this.model = this.modelManager.getActiveModel(),
  4344. this.nItems = this.model.heroLocations.length
  4345. }
  4346. ,
  4347. t.prototype.bindEvents = function() {
  4348. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4349. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4350. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4351. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4352. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4353. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4354. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4355. this.player.once(d.Move, function() {
  4356. o.cancelById(A)
  4357. })
  4358. }
  4359. ,
  4360. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4361. return e === c.WALK && (this.interrupt(p.NONE),
  4362. this.pauseWalkingSection(),
  4363. this.player.fastForwardActivePanoFlight(),
  4364. !0)
  4365. }
  4366. ,
  4367. t.prototype.handlePlayerMove = function(e) {
  4368. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4369. this.emit("update.controls")
  4370. }
  4371. ,
  4372. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4373. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4374. this.emit("update.controls"))
  4375. }
  4376. ,
  4377. t.prototype.handlePlayerModeChanged = function(e, t) {
  4378. this.intermediateState() || e === t || (this.onTheBus = !1,
  4379. this.emit("update.controls"))
  4380. }
  4381. ,
  4382. t.prototype.handlePlayerInputStart = function(e) {
  4383. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4384. }
  4385. ,
  4386. t.prototype.handlePlayerFlyingStarted = function() {
  4387. this.clearWalkingSectionPaused()
  4388. }
  4389. ,
  4390. t.prototype.describe = function() {
  4391. return {
  4392. nItems: this.nItems,
  4393. currentItem: this.currentItem,
  4394. destinationItem: this.destinationItem,
  4395. tourIsPlaying: this.tourIsPlaying,
  4396. onTheBus: this.onTheBus,
  4397. endlessLoop: this.endlessLoop,
  4398. viewMode: this.player.mode,
  4399. inTransition: this._inTransition(),
  4400. transitionStage: this.transitionStage,
  4401. tourInProgress: this.tourInProgress
  4402. }
  4403. }
  4404. ,
  4405. t.prototype._inTransition = function() {
  4406. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4407. }
  4408. ,
  4409. t.prototype.bounceable = function() {
  4410. var e = this.clock.getDelta();
  4411. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4412. }
  4413. ,
  4414. t.prototype.currentMoveDirection = function() {
  4415. return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4416. }
  4417. ,
  4418. t.prototype.clearPath = function() {
  4419. this._inTransition() || this.player.path.discardPathObject()
  4420. }
  4421. ,
  4422. t.prototype.allFloors = function() {
  4423. this.model.toggleAllFloors()
  4424. }
  4425. ,
  4426. t.prototype.actionComplete = function(e) {
  4427. if (this.interrupted = !1,
  4428. this.transitionStage = v.None,
  4429. this.resetSpecialTransition(),
  4430. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4431. this.tourIsPlaying || (this.player.disablePreRendering(),
  4432. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4433. this.emit("update.controls"),
  4434. this.nextFunc) {
  4435. var t = this.nextFunc;
  4436. this.nextFunc = null,
  4437. t()
  4438. }
  4439. }
  4440. ,
  4441. t.prototype.awaitCompletion = function(e, t) {
  4442. this.nextFunc = t,
  4443. e()
  4444. }
  4445. ,
  4446. t.prototype.updateSuccessFunction = function(e) {
  4447. this.nextFunc = e
  4448. }
  4449. ,
  4450. t.prototype.interrupt = function(e, t) {
  4451. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4452. this.tourIsPlaying = !1,
  4453. this.bgmReplay(),
  4454. this.interrupted = !0,
  4455. this.nextFunc = null,
  4456. this.emit(u.ActionInterrupted),
  4457. null != e || (e = p.BEGINNING),
  4458. this.player.interruptAndFastForward(e, t),
  4459. !0)
  4460. }
  4461. ,
  4462. t.prototype.wouldInterrupt = function() {
  4463. return this.transitionStage !== v.None
  4464. }
  4465. ,
  4466. t.prototype.intermediateState = function() {
  4467. return this.transitionStage !== v.None
  4468. }
  4469. ,
  4470. t.prototype.isInterrupted = function() {
  4471. return this.interrupted
  4472. }
  4473. ,
  4474. t.prototype.pauseWalkingSection = function() {
  4475. this.walkingSectionPaused = !0
  4476. }
  4477. ,
  4478. t.prototype.clearWalkingSectionPaused = function() {
  4479. this.walkingSectionPaused = !1
  4480. }
  4481. ,
  4482. t.prototype.autoTour = function() {
  4483. var i = Date.now();
  4484. this.model.auxDataPromise.then(function() {
  4485. i = Date.now() - i;
  4486. var e = r.warp.auto
  4487. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4488. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4489. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4490. done: function() {
  4491. this.playTour()
  4492. }
  4493. .bind(this),
  4494. name: "_atr",
  4495. id: A
  4496. })
  4497. }
  4498. .bind(this))
  4499. }
  4500. ,
  4501. t.prototype.atDestinationPano = function() {
  4502. if (!this.player.currentPano || null === this.destinationItem)
  4503. return !1;
  4504. var e = this.player.currentPano.id;
  4505. if (void 0 === e)
  4506. return !1;
  4507. var t = this.model.heroLocations;
  4508. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4509. }
  4510. ,
  4511. t.prototype.redirectToItem = function(e, t) {
  4512. if (null != e)
  4513. if (this.wouldInterrupt())
  4514. if (this.player.mode !== s.TRANSITIONING) {
  4515. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4516. var i = function() {
  4517. o.setTimeout(function() {
  4518. this.setDestinationItem(e),
  4519. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4520. }
  4521. .bind(this), 0)
  4522. }
  4523. .bind(this);
  4524. this.interrupt(p.END, 0),
  4525. this.updateSuccessFunction(i)
  4526. } else
  4527. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4528. else
  4529. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4530. else
  4531. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4532. }
  4533. ,
  4534. t.prototype.useSpecialTransition = function(e) {
  4535. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4536. this.nextWarpStyle = c.BLACK
  4537. }
  4538. ,
  4539. t.prototype.resetSpecialTransition = function() {
  4540. this.nextWarpStyle = this.defaultWarpStyle
  4541. }
  4542. ,
  4543. t.prototype.arrivedAtDestination = function(e) {
  4544. if (this.player.flying || this.player.isWarping())
  4545. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4546. else {
  4547. this.transitionStage = v.Aiming;
  4548. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4549. this.player.model.fadePanoMarkers(0),
  4550. this.awaitCompletion(function() {
  4551. this.resetSpecialTransition(),
  4552. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4553. }
  4554. .bind(this), t)
  4555. }
  4556. }
  4557. ,
  4558. t.prototype.goToDestination = function(e, t, i, n) {
  4559. if (void 0 !== g_data2.tourAudio && null !== g_data2.tourAudio) {
  4560. var r = g_data2.tourAudio[this.model.heroLocations[this.destinationItem].sid];
  4561. if (r && 0 < r.music.length) {
  4562. var o = r.music.includes(g_Prefix.slice(-10)) ? r.music : g_Prefix + r.music;
  4563. g_tourAudio.src = o;
  4564. g_tourAudio.load(),
  4565. g_tourAudio.crossOrigin = "anonymous",
  4566. g_tourAudio.oncanplaythrough = function() {
  4567. g_tourAudio.play();
  4568. if(g_bgAudio && !g_bgAudio.paused){
  4569. manage.switchBgmState(false);
  4570. g_bgAudio.pauseByTour = true
  4571. }
  4572. g_playAudio = g_tourAudio;
  4573. }
  4574. }
  4575. }
  4576. if (this.onTheBus = !0,
  4577. this.emit("update.controls"),
  4578. this.player.updateLastView(),
  4579. n || !this.atDestinationPano())
  4580. if (this.player.flying || this.player.isWarping())
  4581. m.warn("Cannot go to new destination while player is flying or warping.");
  4582. else {
  4583. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4584. , s = null
  4585. , l = null;
  4586. if (a.isPano()) {
  4587. o = window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  4588. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o, !0, i, this.actionComplete.bind(this)),
  4589. s = this.arrivedAtDestination.bind(this, !0)
  4590. } else
  4591. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4592. s = this.arrivedAtDestination.bind(this, !1);
  4593. this.transitionStage = v.Moving,
  4594. this.model.fadePanoMarkers(0),
  4595. this.awaitCompletion(function() {
  4596. l()
  4597. }
  4598. .bind(this), s),
  4599. this.emit("update.controls")
  4600. }
  4601. else
  4602. this.arrivedAtDestination(!0)
  4603. }
  4604. ,
  4605. t.prototype.tourInterlude = function() {
  4606. if (l.trackAlways("reach_highlight", {
  4607. reach_source: this.reachSource
  4608. }),
  4609. this.model.fadePanoMarkers(0),
  4610. this.emit("update.controls"),
  4611. this.tourIsPlaying)
  4612. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4613. this.stopTour(),
  4614. this.emit(u.TourEnd),
  4615. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4616. this.transitionStage = v.Interlude,
  4617. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4618. }
  4619. .bind(this), this.goNext.bind(this))
  4620. }
  4621. ,
  4622. t.prototype.playTour = function() {
  4623. if (!this.bounceable())
  4624. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4625. this.tourInProgress = !0,
  4626. this.reachSource = "play",
  4627. this.tourIsPlaying = !0,
  4628. this.wasZoomEnabled = this.player.zoomEnabled,
  4629. this.player.zoomEnabled = !1,
  4630. this.resetSpecialTransition(),
  4631. this.emit("update.controls"),
  4632. this.emit(u.TourStart),
  4633. this.player.enablePreRendering(),
  4634. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4635. this.goToDestination()) : this.goNext()))
  4636. }
  4637. ,
  4638. t.prototype.bgmReplay = function() {
  4639. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  4640. g_playAudio = g_bgAudio;
  4641. g_tourAudio && g_tourAudio.pause();
  4642. //window.tourAudio && window.tourAudio.pause();
  4643. manage.switchBgmState(true);
  4644. }
  4645. }
  4646. ,
  4647. t.prototype.stopTour = function() {
  4648. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4649. this.tourIsPlaying = !1,
  4650. this.bgmReplay(),
  4651. this.interrupt(),
  4652. this.clearWalkingSectionPaused(),
  4653. this.resetSpecialTransition(),
  4654. this.emit("update.controls")),
  4655. window.tourAudio && window.tourAudio.pause(),
  4656. g_tourAudio && 0 == g_tourAudio.paused && (g_tourAudio.pause(),
  4657. g_tourAudio.src = "")
  4658. }
  4659. ,
  4660. t.prototype.endTourProgress = function() {
  4661. this.tourInProgress = !1,
  4662. this.emit("update.controls"),
  4663. this.emit(u.TourEnd)
  4664. }
  4665. ,
  4666. t.prototype.goToHighlight = function(e) {
  4667. if (this.wouldInterrupt())
  4668. e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4669. else {
  4670. if (m.debug("<tour.goto " + e + ">"),
  4671. this.isInterrupted())
  4672. return;
  4673. this.clearWalkingSectionPaused(),
  4674. this.setDestinationItem(e),
  4675. this.useSpecialTransition("Hilight"),
  4676. this.goToDestination(),
  4677. l.trackAlways("reach_highlight", {
  4678. reach_source: "thumb"
  4679. })
  4680. }
  4681. }
  4682. ,
  4683. t.prototype.prevHighlight = function() {
  4684. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4685. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4686. this.reachSource = "prev",
  4687. this.goPrev()))
  4688. }
  4689. ,
  4690. t.prototype.nextHighlight = function() {
  4691. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4692. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4693. this.reachSource = "next",
  4694. this.goNext()))
  4695. }
  4696. ,
  4697. t.prototype.changeMode = function(e) {
  4698. var t = $.Deferred()
  4699. , i = t.resolve.bind(t)
  4700. , n = t.reject.bind(t);
  4701. if (this.emit(u.StartModeChange),
  4702. !function() {
  4703. return this.clearWalkingSectionPaused(),
  4704. !!this.wouldInterrupt() && (this.interrupt(),
  4705. !0)
  4706. }
  4707. .bind(this)()) {
  4708. switch (e) {
  4709. case s.PANORAMA:
  4710. 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);
  4711. break;
  4712. case s.DOLLHOUSE:
  4713. case s.FLOORPLAN:
  4714. this.player.flyToNewMode({
  4715. mode: e
  4716. }).done(i).fail(n);
  4717. break;
  4718. case s.OUTDOOR:
  4719. 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)
  4720. }
  4721. return t.promise()
  4722. }
  4723. }
  4724. ,
  4725. t.prototype.atEndOfTour = function() {
  4726. return this.currentItem >= this.nItems - 1
  4727. }
  4728. ,
  4729. t.prototype.firstDestination = function() {
  4730. return 0 < this.nItems ? 0 : null
  4731. }
  4732. ,
  4733. t.prototype.finalDestination = function() {
  4734. return 0 < this.nItems ? this.nItems - 1 : null
  4735. }
  4736. ,
  4737. t.prototype.goPrev = function() {
  4738. this.tourAdvance(-1)
  4739. }
  4740. ,
  4741. t.prototype.goNext = function() {
  4742. this.tourAdvance(1)
  4743. }
  4744. ,
  4745. t.prototype.setDestinationItem = function(e) {
  4746. this.destinationItem = e,
  4747. this.emit("update.controls")
  4748. }
  4749. ,
  4750. t.prototype.setCurrentItem = function(e) {
  4751. this.currentItem = e,
  4752. this.emit("update.controls")
  4753. }
  4754. ,
  4755. t.prototype.nextItem = function(e) {
  4756. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4757. }
  4758. ,
  4759. t.prototype.prevItem = function(e) {
  4760. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4761. }
  4762. ,
  4763. t.prototype.tourAdvance = function(e) {
  4764. if (m.debug("tourAdvance(" + e + ")"),
  4765. null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
  4766. this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
  4767. this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4768. this.useSpecialTransition("looping back to start")),
  4769. "black" === window.MP_PREFETCHED_MODELDATA.momentTour) {
  4770. var i = this.player.zoomLevel;
  4771. this.player.zoomEnabled = !0;
  4772. var t = function(e, t) {
  4773. this.player.zoomTo((1 - e) * i, !0)
  4774. }
  4775. .bind(this);
  4776. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  4777. }
  4778. this.goToDestination()
  4779. }
  4780. ,
  4781. I.exports = t
  4782. }
  4783. ).call(this, "/js/director.js")
  4784. }
  4785. , {
  4786. "./analytics": 4,
  4787. "./enum/BlackoutStyle": 18,
  4788. "./enum/ControlEvents": 21,
  4789. "./enum/DirectorEvents": 23,
  4790. "./enum/ModelManagerEvents": 33,
  4791. "./enum/PathDiscardMode": 38,
  4792. "./enum/PathDisplayMode": 39,
  4793. "./enum/PlayerEvents": 40,
  4794. "./enum/Viewmode": 51,
  4795. "./enum/WarpStyle": 52,
  4796. "./model/ModelManager": 140,
  4797. "./player": 155,
  4798. "./settings": 166,
  4799. "./util/logger": 189,
  4800. "./util/transitions": 195,
  4801. events: 202,
  4802. three: 217
  4803. }],
  4804. 16: [function(e, t, i) {
  4805. "use strict";
  4806. var n = e("three")
  4807. , r = e("./enum/Viewmode")
  4808. , o = (e("./settings"),
  4809. e("./util/transitions"))
  4810. , a = e("./enum/PlayerEvents")
  4811. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4812. , l = new n.ShaderPass(n.VerticalBlurShader);
  4813. l.renderToScreen = !0;
  4814. var c = $("#player").width() / $("#player").height();
  4815. isNaN(c) && (c = 1);
  4816. var h = {
  4817. currentBlur: 0,
  4818. aspect: c,
  4819. blurStrength: 1,
  4820. hblurPass: s,
  4821. vblurPass: l,
  4822. bindEvents: function(e) {
  4823. e.on(a.ModeChanged, function(e, t) {
  4824. e === r.PANORAMA && (o.cancel(h.blur),
  4825. o.cancel(h.addBlur),
  4826. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4827. })
  4828. },
  4829. blur: function(e) {
  4830. var t = (h.currentBlur = e) * h.blurStrength;
  4831. l.uniforms.v.value = t / 512 * h.aspect,
  4832. s.uniforms.h.value = t / 512
  4833. },
  4834. addBlur: function(e) {
  4835. e = Math.max(e, h.currentBlur),
  4836. h.blur(e)
  4837. },
  4838. removeBlur: function(e) {
  4839. e = Math.min(1 - e, h.currentBlur),
  4840. h.blur(e)
  4841. }
  4842. };
  4843. h.blur(0),
  4844. t.exports = h
  4845. }
  4846. , {
  4847. "./enum/PlayerEvents": 40,
  4848. "./enum/Viewmode": 51,
  4849. "./settings": 166,
  4850. "./util/transitions": 195,
  4851. three: 217
  4852. }],
  4853. 17: [function(e, t, i) {
  4854. "use strict";
  4855. t.exports = {
  4856. UNKNOWN: 0,
  4857. ALIGNED: 1,
  4858. UNALIGNED: 2,
  4859. PLACED: 3
  4860. }
  4861. }
  4862. , {}],
  4863. 18: [function(e, t, i) {
  4864. "use strict";
  4865. t.exports = {
  4866. NONE: 0,
  4867. MIDDLE: 1,
  4868. END: 2,
  4869. BEGINNING: 3,
  4870. FADEIN: 4
  4871. }
  4872. }
  4873. , {}],
  4874. 19: [function(e, t, i) {
  4875. "use strict";
  4876. var r = e("three");
  4877. t.exports = {
  4878. newBlue: new r.Color(4967932),
  4879. altBlue: new r.Color(47355),
  4880. tagDefault: new r.Color(223357),
  4881. classicBlue: new r.Color(53759),
  4882. mpYellow: new r.Color(16502016),
  4883. mpOrange: new r.Color(16428055),
  4884. mpBlue: new r.Color(12096),
  4885. mpLtGrey: new r.Color(13751252),
  4886. mpDkGrey: new r.Color(10000019),
  4887. mpRed: new r.Color(12525854),
  4888. mpOrangeDesat: new r.Color(16764529),
  4889. mpBlueDesat: new r.Color(4034734),
  4890. mpRedDesat: new r.Color(14705505),
  4891. white: new r.Color(16777215),
  4892. black: new r.Color(0),
  4893. _desat: function(e, t) {
  4894. var i = t || .3
  4895. , n = (new r.Color).copy(e).getHSL();
  4896. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  4897. },
  4898. _darken: function(e, t) {
  4899. var i = t || .2
  4900. , n = e.getHSL();
  4901. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  4902. }
  4903. }
  4904. }
  4905. , {
  4906. three: 217
  4907. }],
  4908. 20: [function(e, t, i) {
  4909. "use strict";
  4910. t.exports = {
  4911. NONE: -1,
  4912. ROTATE: 0,
  4913. DOLLY: 1,
  4914. PAN: 2,
  4915. ROTATE_DOLLY: 3,
  4916. PAN_DOLLY: 4
  4917. }
  4918. }
  4919. , {}],
  4920. 21: [function(e, t, i) {
  4921. "use strict";
  4922. t.exports = {
  4923. Move: "move",
  4924. InteractionDirect: "interaction.direct",
  4925. InteractionKey: "interaction.key",
  4926. InteractionGui: "interaction.gui",
  4927. FlyInDirection: "fly.direction",
  4928. InputStart: "input.start",
  4929. Pinch: "input.pinch",
  4930. Scroll: "input.scroll",
  4931. AutoPanInterrupt: "autopan.interrupt",
  4932. AutoPanComplete: "autopan.complete",
  4933. AutoPanClamped: "autopan.clamped",
  4934. LongTap: "longtap"
  4935. }
  4936. }
  4937. , {}],
  4938. 22: [function(e, t, i) {
  4939. "use strict";
  4940. t.exports = Object.freeze({
  4941. FORWARD: "FORWARD",
  4942. LEFT: "LEFT",
  4943. RIGHT: "RIGHT",
  4944. BACK: "BACK",
  4945. UP: "UP",
  4946. DOWN: "DOWN"
  4947. })
  4948. }
  4949. , {}],
  4950. 23: [function(e, t, i) {
  4951. "use strict";
  4952. t.exports = {
  4953. ActionInterrupted: "action.interrupted",
  4954. TourStart: "tour.start",
  4955. TourEnd: "tour.end",
  4956. StartModeChange: "mode.startChange"
  4957. }
  4958. }
  4959. , {}],
  4960. 24: [function(e, t, i) {
  4961. "use strict";
  4962. t.exports = Object.freeze({
  4963. None: 0,
  4964. Queued: 1,
  4965. ForceQueued: 2,
  4966. Downloading: 3,
  4967. Downloaded: 4,
  4968. DownloadFailed: 5
  4969. })
  4970. }
  4971. , {}],
  4972. 25: [function(e, t, i) {
  4973. "use strict";
  4974. t.exports = {
  4975. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  4976. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  4977. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  4978. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  4979. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  4980. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  4981. }
  4982. }
  4983. , {}],
  4984. 26: [function(e, t, i) {
  4985. "use strict";
  4986. t.exports = {
  4987. Texture2D: 0,
  4988. TextureCube: 1
  4989. }
  4990. }
  4991. , {}],
  4992. 27: [function(e, t, i) {
  4993. "use strict";
  4994. t.exports = {
  4995. SMALL: "small",
  4996. LARGE: "large"
  4997. }
  4998. }
  4999. , {}],
  5000. 28: [function(e, t, i) {
  5001. "use strict";
  5002. var n = e("./Viewmode")
  5003. , r = {
  5004. LANDING: {},
  5005. NAVIGATION: "navigation",
  5006. MORE_HELP: "moreHelp",
  5007. TOUR_INTERACTION: {}
  5008. };
  5009. r.LANDING[n.PANORAMA] = "panorama.landing",
  5010. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5011. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5012. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5013. r.TOUR_INTERACTION.standard = "standard.tour",
  5014. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5015. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5016. t.exports = r
  5017. }
  5018. , {
  5019. "./Viewmode": 51
  5020. }],
  5021. 29: [function(e, t, i) {
  5022. "use strict";
  5023. var n = {
  5024. UP: 1,
  5025. DOWN: -1,
  5026. LEFT: "L",
  5027. RIGHT: "R",
  5028. FORWARD: "F",
  5029. BACK: "B",
  5030. reverse: {},
  5031. opposite: function(e) {
  5032. return this.reverse[e.toString()]
  5033. }
  5034. };
  5035. n.reverse[n.UP] = n.DOWN,
  5036. n.reverse[n.DOWN] = n.UP,
  5037. n.reverse[n.LEFT] = n.RIGHT,
  5038. n.reverse[n.RIGHT] = n.LEFT,
  5039. n.reverse[n.FORWARD] = n.BACK,
  5040. n.reverse[n.BACK] = n.FORWARD,
  5041. t.exports = n
  5042. }
  5043. , {}],
  5044. 30: [function(e, t, i) {
  5045. "use strict";
  5046. var n = {
  5047. ZERO: 48,
  5048. ONE: 49,
  5049. TWO: 50,
  5050. THREE: 51,
  5051. FOUR: 52,
  5052. FIVE: 53,
  5053. SIX: 54,
  5054. SEVEN: 55,
  5055. EIGHT: 56,
  5056. NINE: 57,
  5057. LEFTARROW: 37,
  5058. UPARROW: 38,
  5059. RIGHTARROW: 39,
  5060. DOWNARROW: 40,
  5061. A: 65,
  5062. B: 66,
  5063. C: 67,
  5064. D: 68,
  5065. E: 69,
  5066. F: 70,
  5067. G: 71,
  5068. H: 72,
  5069. I: 73,
  5070. J: 74,
  5071. K: 75,
  5072. L: 76,
  5073. M: 77,
  5074. N: 78,
  5075. O: 79,
  5076. P: 80,
  5077. Q: 81,
  5078. R: 82,
  5079. S: 83,
  5080. T: 84,
  5081. U: 85,
  5082. V: 86,
  5083. W: 87,
  5084. X: 88,
  5085. Y: 89,
  5086. Z: 90,
  5087. SPACE: 32,
  5088. RETURN: 13,
  5089. SEMICOLON: 186,
  5090. PLUSEQUALS: 187,
  5091. DASHUNDERSCORE: 189,
  5092. OPENBRACKET: 219
  5093. };
  5094. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5095. n.PLUSEQUALS = 61,
  5096. n.DASHUNDERSCORE = 173),
  5097. t.exports = n
  5098. }
  5099. , {
  5100. "../util/browser": 182
  5101. }],
  5102. 31: [function(e, t, i) {
  5103. "use strict";
  5104. t.exports = {
  5105. EN_US: "en-US",
  5106. ES_MX: "es-MX",
  5107. FR_FR: "fr-FR",
  5108. DE_DE: "de-DE",
  5109. RU_RU: "ru-RU",
  5110. CN_CN: "cn-CN",
  5111. JP_JP: "jp-JP"
  5112. }
  5113. }
  5114. , {}],
  5115. 32: [function(e, t, i) {
  5116. "use strict";
  5117. t.exports = {
  5118. TagActivated: "tag.activated",
  5119. TagDismissed: "tag.dismissed",
  5120. TagNavigation: "tag.navigation"
  5121. }
  5122. }
  5123. , {}],
  5124. 33: [function(e, t, i) {
  5125. "use strict";
  5126. t.exports = {
  5127. ModelAdded: "model-added",
  5128. ActiveModelChanged: "active-model-changed"
  5129. }
  5130. }
  5131. , {}],
  5132. 34: [function(e, t, i) {
  5133. "use strict";
  5134. t.exports = {
  5135. LEFT: 0,
  5136. MIDDLE: 1,
  5137. RIGHT: 2
  5138. }
  5139. }
  5140. , {}],
  5141. 35: [function(e, t, i) {
  5142. "use strict";
  5143. t.exports = {
  5144. PanoRenderComplete: "panorama.render.complete",
  5145. TileRenderFailure: "panorama.tile.render.failed",
  5146. TileRenderSuccess: "panorama.tile.render.success",
  5147. TileUploadAttempted: "panorama.tile.upload.attempted",
  5148. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5149. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5150. }
  5151. }
  5152. , {}],
  5153. 36: [function(e, t, i) {
  5154. "use strict";
  5155. t.exports = {
  5156. BASE: 1,
  5157. STANDARD: 2,
  5158. HIGH: 3,
  5159. ULTRAHIGH: 4
  5160. }
  5161. }
  5162. , {}],
  5163. 37: [function(e, t, i) {
  5164. "use strict";
  5165. t.exports = {
  5166. LoadComplete: "panorama.load.complete",
  5167. LoadFailed: "panorama.load.failed",
  5168. TileLoaded: "panorama.tile.loaded"
  5169. }
  5170. }
  5171. , {}],
  5172. 38: [function(e, t, i) {
  5173. "use strict";
  5174. t.exports = Object.freeze({
  5175. Standard: 0,
  5176. Slow: 1,
  5177. Retain: 2
  5178. })
  5179. }
  5180. , {}],
  5181. 39: [function(e, t, i) {
  5182. "use strict";
  5183. t.exports = Object.freeze({
  5184. Show: 0,
  5185. Hide: 1,
  5186. Retain: 2
  5187. })
  5188. }
  5189. , {}],
  5190. 40: [function(e, t, i) {
  5191. "use strict";
  5192. t.exports = {
  5193. Move: "move",
  5194. MoveComplete: "move.complete",
  5195. ModeChanged: "mode.changed",
  5196. ModeChanging: "mode.changing",
  5197. PanoChosen: "pano.chosen",
  5198. ClosestPanoChanging: "closest.pano.changing",
  5199. WarpStarted: "warp.started",
  5200. WarpInterrupted: "warp.interrupted",
  5201. WarpEnded: "warp.ended",
  5202. FlyinFinished: "flyin.finished",
  5203. FlyingStarted: "flying.started",
  5204. FlyingInterrupted: "flying.interrupted",
  5205. FlyingEnded: "flying.ended",
  5206. Ready: "ready",
  5207. StartInside: "start.inside",
  5208. StartOutside: "start.outside",
  5209. ViewChanged: "view.changed",
  5210. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5211. InputStart: "input.start"
  5212. }
  5213. }
  5214. , {}],
  5215. 41: [function(e, t, i) {
  5216. "use strict";
  5217. t.exports = Object.freeze({
  5218. DEFAULT: 0,
  5219. PANOMARKERS: 1,
  5220. RETICULE: 2,
  5221. TAG: 3
  5222. })
  5223. }
  5224. , {}],
  5225. 42: [function(e, t, i) {
  5226. "use strict";
  5227. t.exports = {
  5228. visibleFloor: 1,
  5229. ghostFloor: 3,
  5230. boundingSkybox: 1,
  5231. panoMarker: 2,
  5232. reticule: 3,
  5233. tagStem: 4,
  5234. tagDisc: 5,
  5235. ribbon: 100
  5236. }
  5237. }
  5238. , {}],
  5239. 43: [function(e, t, i) {
  5240. "use strict";
  5241. t.exports = {
  5242. ContextCreated: "scene-renderer-context-created",
  5243. AfterRender: "after-render",
  5244. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5245. }
  5246. }
  5247. , {}],
  5248. 44: [function(e, t, i) {
  5249. "use strict";
  5250. t.exports = {
  5251. IDLE: "idle",
  5252. BROWSE: "browse",
  5253. EXAMINE: "examine"
  5254. }
  5255. }
  5256. , {}],
  5257. 45: [function(e, t, i) {
  5258. "use strict";
  5259. t.exports = {
  5260. TileDownloadSuccess: "tiledownloader.download.success",
  5261. TileDownloadFailure: "tiledownloader.download.failure",
  5262. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5263. }
  5264. }
  5265. , {}],
  5266. 46: [function(e, t, i) {
  5267. "use strict";
  5268. t.exports = {
  5269. CardboardAndroid: "googlevr",
  5270. GearVR: "gearvr",
  5271. CardboardIOS: "googlevrios",
  5272. Cardboard: "googlevr"
  5273. }
  5274. }
  5275. , {}],
  5276. 47: [function(e, t, i) {
  5277. "use strict";
  5278. t.exports = {
  5279. NONE: 0,
  5280. CONTEXTUAL: 1,
  5281. ANDROID: 2
  5282. }
  5283. }
  5284. , {}],
  5285. 48: [function(e, t, i) {
  5286. "use strict";
  5287. var n = {
  5288. Title: 0,
  5289. Cardboard: 1
  5290. }
  5291. , r = {
  5292. Title: 0,
  5293. Cardboard: 1,
  5294. Gear: 2
  5295. };
  5296. [n, r].forEach(function(e) {
  5297. e.pageCount = Object.keys(e).length
  5298. }),
  5299. t.exports.ios = n,
  5300. t.exports.standard = r
  5301. }
  5302. , {}],
  5303. 49: [function(e, t, i) {
  5304. "use strict";
  5305. t.exports = {
  5306. Android: "android",
  5307. IOS: "ios",
  5308. Desktop: "desktop",
  5309. UnsupportedAndroid: "android-unsupported"
  5310. }
  5311. }
  5312. , {}],
  5313. 50: [function(e, t, i) {
  5314. "use strict";
  5315. var n = e("three");
  5316. t.exports = {
  5317. UP: new n.Vector3(0,1,0),
  5318. DOWN: new n.Vector3(0,-1,0),
  5319. LEFT: new n.Vector3(-1,0,0),
  5320. RIGHT: new n.Vector3(1,0,0),
  5321. FORWARD: new n.Vector3(0,0,-1),
  5322. BACK: new n.Vector3(0,0,1)
  5323. }
  5324. }
  5325. , {
  5326. three: 217
  5327. }],
  5328. 51: [function(e, t, i) {
  5329. "use strict";
  5330. var n = e("../exception/ViewmodeConvertException")
  5331. , r = e("./coreViewmodes")
  5332. , o = {
  5333. MESH: "mesh",
  5334. OUTDOOR: "outdoor",
  5335. TRANSITIONING: "transitioning",
  5336. toInt: function(e) {
  5337. switch (e) {
  5338. case this.PANORAMA:
  5339. return 1;
  5340. case this.DOLLHOUSE:
  5341. return 2;
  5342. case this.FLOORPLAN:
  5343. return 3;
  5344. case this.OUTDOOR:
  5345. return 4;
  5346. case this.TRANSITIONING:
  5347. return -1
  5348. }
  5349. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5350. },
  5351. fromInt: function(e) {
  5352. switch (e) {
  5353. case "1":
  5354. case 1:
  5355. return this.PANORAMA;
  5356. case "2":
  5357. case 2:
  5358. return this.DOLLHOUSE;
  5359. case "3":
  5360. case 3:
  5361. return this.FLOORPLAN;
  5362. case "4":
  5363. case 4:
  5364. return this.OUTDOOR
  5365. }
  5366. throw new n("No known conversion for int to viewmode for int: " + e)
  5367. },
  5368. convertWorkshopModeInt: function(e) {
  5369. switch (e) {
  5370. case "0":
  5371. case 0:
  5372. case void 0:
  5373. return this.PANORAMA;
  5374. case "1":
  5375. case 1:
  5376. return this.FLOORPLAN;
  5377. case "2":
  5378. case 2:
  5379. return this.DOLLHOUSE;
  5380. case "3":
  5381. case 3:
  5382. return this.MESH
  5383. }
  5384. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5385. }
  5386. };
  5387. e("../util/common").extendObject(o, r),
  5388. t.exports = o
  5389. }
  5390. , {
  5391. "../exception/ViewmodeConvertException": 58,
  5392. "../util/common": 185,
  5393. "./coreViewmodes": 54
  5394. }],
  5395. 52: [function(e, t, i) {
  5396. "use strict";
  5397. t.exports = {
  5398. BLACK: "black",
  5399. STD: "std",
  5400. WALK: "walk"
  5401. }
  5402. }
  5403. , {}],
  5404. 53: [function(e, t, i) {
  5405. "use strict";
  5406. t.exports = {
  5407. ZoomIn: "zoom.in",
  5408. ZoomOut: "zoom.out",
  5409. ZoomMax: "zoom.max",
  5410. ZoomMin: "zoom.min"
  5411. }
  5412. }
  5413. , {}],
  5414. 54: [function(e, t, i) {
  5415. "use strict";
  5416. t.exports = {
  5417. PANORAMA: "panorama",
  5418. DOLLHOUSE: "dollhouse",
  5419. FLOORPLAN: "floorplan"
  5420. }
  5421. }
  5422. , {}],
  5423. 55: [function(e, t, i) {
  5424. "use strict";
  5425. t.exports = function(e) {
  5426. this.message = e
  5427. }
  5428. }
  5429. , {}],
  5430. 56: [function(e, t, i) {
  5431. "use strict";
  5432. function n(e) {
  5433. r.call(this, e)
  5434. }
  5435. var r = e("./BasicException");
  5436. n.prototype = Object.create(r.prototype),
  5437. t.exports = n
  5438. }
  5439. , {
  5440. "./BasicException": 55
  5441. }],
  5442. 57: [function(e, t, i) {
  5443. "use strict";
  5444. function n(e) {
  5445. r.call(this, e)
  5446. }
  5447. var r = e("./BasicException");
  5448. n.prototype = Object.create(r.prototype),
  5449. t.exports = n
  5450. }
  5451. , {
  5452. "./BasicException": 55
  5453. }],
  5454. 58: [function(e, t, i) {
  5455. "use strict";
  5456. function n(e) {
  5457. r.call(this, e)
  5458. }
  5459. var r = e("./BasicException");
  5460. n.prototype = Object.create(r.prototype),
  5461. t.exports = n
  5462. }
  5463. , {
  5464. "./BasicException": 55
  5465. }],
  5466. 59: [function(a, s, e) {
  5467. (function(e) {
  5468. "use strict";
  5469. var i = a("./util/ajax")
  5470. , n = a("./util/showcase")
  5471. , t = a("./util/logger")
  5472. , r = new t(e)
  5473. , o = {};
  5474. s.exports = {
  5475. loadFeatureFlags: function(e) {
  5476. var t = $.Deferred();
  5477. return i.get(e.urlBase + "", {
  5478. responseType: "json",
  5479. prefetchFrom: "user",
  5480. auth: n.getAuthorizationHeader()
  5481. }).done(function(e) {
  5482. (o = function(e) {
  5483. var t = {};
  5484. if (e) {
  5485. var i = e.flags;
  5486. if (i)
  5487. for (var n in i)
  5488. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5489. return t
  5490. }
  5491. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5492. null
  5493. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5494. }).fail(function() {
  5495. r.debug("Retrieval of feature flags failed."),
  5496. t.reject("loading-failed")
  5497. }),
  5498. t.promise()
  5499. },
  5500. getFlags: function() {
  5501. return o
  5502. },
  5503. updateDependentSettings: function(e, t) {
  5504. (e = e || o).labels && (t.labels.enabled = !0),
  5505. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5506. e.showcase_sdk && (t.sdkInit = !0),
  5507. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5508. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5509. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5510. e.hide_sc_sharing && (t.share.enabled = !1)
  5511. }
  5512. }
  5513. }
  5514. ).call(this, "/js/featureflags.js")
  5515. }
  5516. , {
  5517. "./util/ajax": 181,
  5518. "./util/logger": 189,
  5519. "./util/showcase": 193
  5520. }],
  5521. 60: [function(e, t, i) {
  5522. "use strict";
  5523. var n = (e("../util/common"),
  5524. {
  5525. status: 0,
  5526. set: function(e) {
  5527. if (isNaN(e))
  5528. return !1;
  5529. var t = $(".progressbar");
  5530. e < 0 && (e = 0),
  5531. 100 < e && (e = 100);
  5532. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5533. , n = Math.round(e)
  5534. , r = parseInt(i) - 15;
  5535. t.find(".bar").css("width", i),
  5536. t.find(".label").css("left", r),
  5537. t.find(".perc").text(n + "%"),
  5538. this.status = e
  5539. },
  5540. done: function(e) {
  5541. return e || this.status ? (this.status = null,
  5542. this.set(100)) : this
  5543. }
  5544. });
  5545. t.exports.circleLoader = n
  5546. }
  5547. , {
  5548. "../util/common": 185
  5549. }],
  5550. 61: [function(e, t, i) {
  5551. "use strict";
  5552. t.exports = Object.freeze({
  5553. CLOSE: "modal.closer.close"
  5554. })
  5555. }
  5556. , {}],
  5557. 62: [function(e, t, i) {
  5558. "use strict";
  5559. function n(t, e) {
  5560. function i() {
  5561. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5562. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5563. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5564. c.classList.remove("closeByFooter")))
  5565. }
  5566. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5567. }
  5568. var r = e("../../settings")
  5569. , o = (e("../../tag/Media/MediaEvent"),
  5570. e("../../util/browser"))
  5571. , a = e("../../util/common")
  5572. , s = e("./ModalCloserEvent")
  5573. , l = e("events").EventEmitter
  5574. , c = document.getElementsByClassName("footer")[0]
  5575. , h = c.querySelectorAll(".close")[0]
  5576. , u = null
  5577. , d = null
  5578. , p = null
  5579. , f = (o.isMobile(),
  5580. {
  5581. open: function(e) {
  5582. e && (n(e),
  5583. u && h.removeEventListener("click", u, !0),
  5584. u = function(e, t) {
  5585. t && (t.stopPropagation(),
  5586. t.preventDefault()),
  5587. e && this.emit(s.CLOSE, e),
  5588. f.reset()
  5589. }
  5590. .bind(this, e.id),
  5591. h.addEventListener("click", u, !0),
  5592. d && window.removeEventListener("resize", d, !0),
  5593. d = n.bind(this, e),
  5594. window.addEventListener("resize", d, !0))
  5595. },
  5596. reset: function() {
  5597. c.classList.remove("closeByFooter"),
  5598. h.removeEventListener("click", u, !0),
  5599. window.removeEventListener("resize", d, !0),
  5600. u = d = p = null
  5601. }
  5602. });
  5603. a.extendObject(f, l.prototype),
  5604. t.exports = f
  5605. }
  5606. , {
  5607. "../../tag/Media/MediaEvent": 131,
  5608. "../../settings": 166,
  5609. "../../util/browser": 182,
  5610. "../../util/common": 185,
  5611. "./ModalCloserEvent": 61,
  5612. events: 202
  5613. }],
  5614. 63: [function(e, t, i) {
  5615. "use strict";
  5616. var A = e("../lib/dat.gui")
  5617. , C = e("three")
  5618. , I = e("../util/easing")
  5619. , E = e("../enum/Viewmode")
  5620. , _ = e("../enum/Colors")
  5621. , b = e("../enum/WarpStyle")
  5622. , w = e("../settings");
  5623. e("../tag/tag"),
  5624. A.GUI.prototype.removeFolder = function(e) {
  5625. var t = this.__folders[e];
  5626. t && (t.close(),
  5627. this.__ul.removeChild(t.domElement.parentNode),
  5628. delete this.__folders[e],
  5629. this.onResize())
  5630. }
  5631. ,
  5632. t.exports.toggle = function(t, e, i) {
  5633. var n = new A.GUI({
  5634. width: 400
  5635. })
  5636. , r = n.addFolder("Flydown from Dollhouse");
  5637. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5638. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5639. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5640. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5641. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5642. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5643. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5644. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5645. var o = n.addFolder("Transition between panos");
  5646. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5647. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5648. w.transition.flyTime = 0,
  5649. o.__controllers.forEach(function(e) {
  5650. e.updateDisplay()
  5651. })
  5652. }),
  5653. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5654. w.transition.flySpeed = 0,
  5655. o.__controllers.forEach(function(e) {
  5656. e.updateDisplay()
  5657. })
  5658. }),
  5659. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5660. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5661. o.add(w.transition, "movementEasing", Object.keys(I));
  5662. var a = n.addFolder("Path Display");
  5663. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5664. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5665. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5666. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5667. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5668. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5669. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5670. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5671. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5672. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5673. w.path.color = _[w.path.color],
  5674. w.path.colorUp = _._desat(w.path.color),
  5675. w.path.colorDown = _.darken(w.path.color)
  5676. }),
  5677. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5678. w.reticuleColor = _[w.reticuleColor]
  5679. });
  5680. var s = n.addFolder("Warping")
  5681. , l = s.addFolder("Warp/Teleport");
  5682. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5683. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5684. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5685. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5686. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5687. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5688. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5689. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5690. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5691. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5692. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  5693. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5694. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5695. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  5696. w.path.typ = b[w.path.typ]
  5697. }),
  5698. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5699. e.endlessLoop = w.warp.loop
  5700. }),
  5701. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5702. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5703. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5704. var c = s.addFolder("Long Warp Only");
  5705. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5706. w.warp.flySpeed = 0,
  5707. c.__controllers.forEach(function(e) {
  5708. e.updateDisplay()
  5709. })
  5710. }),
  5711. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5712. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5713. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5714. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5715. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5716. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5717. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5718. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5719. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5720. var h = n.addFolder("Warp Esoterica");
  5721. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5722. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  5723. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5724. w.warp.minWarpTime = 0,
  5725. h.__controllers.forEach(function(e) {
  5726. e.updateDisplay()
  5727. })
  5728. }),
  5729. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  5730. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5731. h.add(w.warp, "movementEasing", Object.keys(I));
  5732. var u = n.addFolder("Misc");
  5733. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  5734. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  5735. }),
  5736. u.add(w, "insideFOV", 10, 180).onChange(function() {
  5737. i.cameras[E.PANORAMA].fov = w.insideFOV
  5738. }),
  5739. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5740. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5741. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5742. var d = n.addFolder("Navigation");
  5743. d.add(w.navigation, "panoScores").onFinishChange(function() {
  5744. w.navigation.panoScores || t.panos.forEach(function(e) {
  5745. e.floor.remove(e.text3d),
  5746. e.text3d = null
  5747. })
  5748. }),
  5749. d.add(w.navigation, "mouseDirection"),
  5750. d.add(w.navigation, "filterStrictness", 0, 1),
  5751. d.add(w.navigation, "angleFactor", -60, 0),
  5752. d.add(w.navigation, "directionFactor", 1, 20),
  5753. d.add(w.navigation, "distanceFactor", -5, 5),
  5754. d.add(w.navigation, "optionalityFactor", .1, 10);
  5755. var p = n.addFolder("tags")
  5756. , f = p.addFolder("Tag Creation");
  5757. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  5758. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5759. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5760. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5761. var g = p.addFolder("Visibility");
  5762. g.add(w.tags.visibility, "anyDistance"),
  5763. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5764. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5765. g.add(w.tags.visibility, "hideViaFloor"),
  5766. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5767. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5768. var m = p.addFolder("Disc Parameters");
  5769. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5770. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5771. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5772. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  5773. }),
  5774. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5775. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  5776. }),
  5777. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  5778. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  5779. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5780. var v = p.addFolder("Navigate");
  5781. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  5782. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  5783. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  5784. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5785. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5786. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5787. var y = n.addFolder("Debug");
  5788. y.add(w, "wireframe").onFinishChange(function() {
  5789. t.chunks.forEach(function(e) {
  5790. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  5791. e.wireframeTwin.material.depthWrite = !1,
  5792. e.wireframeTwin.material.depthTest = !1,
  5793. e.wireframeTwin.material.opacity = .5,
  5794. e.wireframeTwin.material.transparent = !0),
  5795. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  5796. })
  5797. }),
  5798. y.add(w, "skyboxWireframe").onFinishChange(function() {
  5799. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  5800. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  5801. t.skybox.wireframe = null)
  5802. }),
  5803. y.add(w, "showSweeps").onFinishChange(function() {
  5804. t.setSweepVisibility(w.showSweeps)
  5805. }),
  5806. y.add(w, "showMesh").onFinishChange(function() {
  5807. t.chunks.forEach(function(e) {
  5808. e.visible = w.showMesh
  5809. })
  5810. }),
  5811. y.add(w, "showFloors").onFinishChange(function() {
  5812. t.floors.forEach(function(e) {
  5813. e.collider.children.forEach(function(e) {
  5814. e.material.visible = w.showFloors
  5815. })
  5816. })
  5817. }),
  5818. y.add(w, "showSkyboxes").onFinishChange(function() {
  5819. t.panos.forEach(function(e) {
  5820. e.skyboxMesh.visible = w.showSkyboxes
  5821. })
  5822. }),
  5823. y.add(w, "showNeighbors").onChange(function() {}),
  5824. y.add(t, "alpha", 0, 1)
  5825. }
  5826. }
  5827. , {
  5828. "../enum/Colors": 19,
  5829. "../enum/Viewmode": 51,
  5830. "../enum/WarpStyle": 52,
  5831. "../lib/dat.gui": 93,
  5832. "../tag/tag": 123,
  5833. "../settings": 166,
  5834. "../util/easing": 186,
  5835. three: 217
  5836. }],
  5837. 64: [function(c, h, e) {
  5838. (function(e) {
  5839. "use strict";
  5840. function i(e, t, i, n) {
  5841. $(".gui-error .error-problem-text").text(e),
  5842. $(".gui-error .error-solution-text").text(t),
  5843. $(".gui-error .error-explanation").text(i),
  5844. $(".gui-error .error-actions").html(n),
  5845. $(window).resize(),
  5846. $(".gui-error").fadeIn(),
  5847. $("#bottom-logo").fadeIn()
  5848. }
  5849. function n(e) {
  5850. 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("");
  5851. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  5852. r.isMobile() || $("[rel=tiletip]").tooltip({
  5853. placement: "bottom",
  5854. delay: {
  5855. show: 50,
  5856. hide: 0
  5857. },
  5858. trigger: "hover",
  5859. viewport: {
  5860. selector: "body",
  5861. padding: 10
  5862. }
  5863. })
  5864. }
  5865. function t() {
  5866. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  5867. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  5868. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  5869. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  5870. e.preventDefault(),
  5871. e.stopPropagation(),
  5872. n(" ")
  5873. })
  5874. }
  5875. var r = c("./../util/browser")
  5876. , o = c("./../analytics")
  5877. , a = c("./../settings")
  5878. , s = c("../localization/localize")
  5879. , l = new (c("./../util/logger"))(e);
  5880. h.exports.error = function(e) {
  5881. if ($("head title").text(a.pageTitle),
  5882. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  5883. $("#gui-loading").fadeOut(250),
  5884. $("#quick-blackout").hide(),
  5885. o.track("showcase_error", {
  5886. error_key: e
  5887. }),
  5888. s.locale || s.init(),
  5889. "webgl-unsupported" === e)
  5890. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  5891. else if ("webgl-ios" === e)
  5892. 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>.");
  5893. else if ("webgl-safari" === e)
  5894. 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>.");
  5895. else if ("webgl-generic" === e)
  5896. t();
  5897. else if ("missing-urls" === e)
  5898. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  5899. else if ("loading-failed" === e)
  5900. 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>.");
  5901. else {
  5902. if ("loading-failed-maintenance" !== e)
  5903. return void l.error("Unhandled error: " + e);
  5904. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  5905. }
  5906. }
  5907. }
  5908. ).call(this, "/js/gui/error.js")
  5909. }
  5910. , {
  5911. "../localization/localize": 108,
  5912. "./../analytics": 4,
  5913. "./../settings": 166,
  5914. "./../util/browser": 182,
  5915. "./../util/logger": 189
  5916. }],
  5917. 65: [function(Oe, Le, e) {
  5918. (function(e) {
  5919. "use strict";
  5920. function c() {
  5921. for (var e in Ce)
  5922. if (Ce.hasOwnProperty(e)) {
  5923. var t = Ce[e];
  5924. if (!t.visible)
  5925. for (var i = 0; i < t.elements.length; i++)
  5926. $(t.elements[i]).hide()
  5927. }
  5928. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  5929. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  5930. ge = [],
  5931. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  5932. ge.push(".hideTarget", ".pinTop.right")
  5933. }
  5934. function v(e, t) {
  5935. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  5936. $("#gui-zoomin").toggle(i),
  5937. $("#gui-zoomout").toggle(i)
  5938. }
  5939. function l() {
  5940. n(),
  5941. $(".pinBottom").toggleClass("open"),
  5942. $("#drawer").toggleClass("open"),
  5943. $(".footer").toggleClass("open"),
  5944. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  5945. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  5946. O.resetDrawer()),
  5947. setTimeout(function() {
  5948. $("#pullTab").toggleClass("opened")
  5949. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  5950. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  5951. }
  5952. function t(e) {
  5953. var t;
  5954. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  5955. t = e.position().top + e.outerHeight(),
  5956. e.attr("style", "display: none")),
  5957. $("#player").outerHeight() - 130 < t + 25
  5958. }
  5959. function y(e) {
  5960. "touchstart" === e.type && e.preventDefault(),
  5961. e.stopPropagation()
  5962. }
  5963. function n() {
  5964. w && (w.reload(),
  5965. w.init())
  5966. }
  5967. function r() {
  5968. $("#gui-spinner").stop(!0, !0),
  5969. $("#gui-spinner").fadeOut(1e3),
  5970. !(Ae = !0)
  5971. }
  5972. function A(e, t) {
  5973. var i = e.mode
  5974. , n = t || e.currentPano;
  5975. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  5976. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  5977. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  5978. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  5979. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  5980. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  5981. $("#gui-modes-outside").removeClass("desktop-only")),
  5982. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  5983. pe = i,
  5984. $("#gui-modes-outside").addClass("hidden"),
  5985. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  5986. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  5987. }
  5988. function C(t, i) {
  5989. function e() {
  5990. document.getElementById("vr").classList.remove("hidden"),
  5991. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  5992. S.supportsFullscreen() ? function(e) {
  5993. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  5994. Q.init(t.data, i, e, x),
  5995. Q.on(J.OPENED, _e.bind(gui, "vr")),
  5996. Q.on(J.SHOW_TERMS, W.show.bind(W))
  5997. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  5998. $(".improper-embed").toggleClass("hidden", !1),
  5999. n())
  6000. }, function(e) {
  6001. n()
  6002. }) : n()
  6003. }
  6004. function n() {
  6005. var e;
  6006. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6007. X.init(t.data, x),
  6008. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6009. function() {
  6010. _e("vr"),
  6011. V.open(e)
  6012. }
  6013. )),
  6014. X.on(Z.CLOSED, V.reset)
  6015. }
  6016. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6017. switch (M.vr.option) {
  6018. case le.CONTEXTUAL:
  6019. e();
  6020. break;
  6021. case le.ANDROID:
  6022. S.detectAndroid() && e();
  6023. break;
  6024. case le.NONE:
  6025. }
  6026. }
  6027. function h(e, i) {
  6028. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6029. if ("372" !== getQueryVariable("m")) {
  6030. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6031. $(".gui-floor").find(".container").prepend(r)
  6032. }
  6033. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6034. n.on("click", function(e) {
  6035. y(e),
  6036. _e("floor"),
  6037. n.toggleClass("open")
  6038. }),
  6039. $(".floorChoice").on("click", function(e) {
  6040. y(e);
  6041. var t = $(this).data("index");
  6042. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6043. i.player.gotoFloor(t),
  6044. R.track("showcase_gui", {
  6045. gui_action: "click_floor_select_button",
  6046. interaction_source: "gui"
  6047. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6048. _e("move"),
  6049. i.allFloors(),
  6050. R.track("showcase_gui", {
  6051. gui_action: "click_toggle_all_floors_button",
  6052. interaction_source: "gui"
  6053. })),
  6054. n.removeClass("open")
  6055. })
  6056. }
  6057. function I(e, t) {
  6058. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6059. $(".gui-floor-icon").hide(),
  6060. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6061. $(".gui-floor-icon").show(),
  6062. $(".gui-floor-title").hide()),
  6063. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6064. $(".gui-floor-number").text(se.FLOOR_ALL),
  6065. $(".floorChoice").removeClass("active"),
  6066. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6067. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6068. $(".floorChoice").removeClass("active"),
  6069. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6070. }
  6071. function E() {
  6072. var e = $("#player").width() - 20
  6073. , t = $("#scroller")
  6074. , i = $("#drawer")
  6075. , n = $(".pinBottom");
  6076. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6077. i.addClass("noScroll"),
  6078. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6079. i.toggleClass("noScroll"),
  6080. n.toggleClass("noScroll"))
  6081. }
  6082. function _(e) {
  6083. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6084. e = e || 0,
  6085. Ae = !1,
  6086. window.setTimeout(function() {
  6087. Ae || (!0,
  6088. $("#gui-spinner").stop(!0, !0).show())
  6089. }
  6090. .bind(this), e)
  6091. }(M.modelComponentLoadSpinnerDelay)
  6092. }
  6093. function b(e, t) {
  6094. for (var i = []; e; )
  6095. i.push(e),
  6096. e = e.parentNode;
  6097. for (; t && -1 === i.indexOf(t); )
  6098. t = t.parentNode;
  6099. return t
  6100. }
  6101. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6102. Oe("../util/ajax"),
  6103. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6104. Oe("../util/camera"),
  6105. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6106. 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"),
  6107. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6108. Oe("../enum/PathDisplayMode"),
  6109. Oe("../enum/DirectorEvents"),
  6110. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6111. Oe("../enum/WarpStyle"),
  6112. Oe("../enum/AlignmentType"),
  6113. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6114. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6115. coBrand: {
  6116. visible: !0,
  6117. elements: [".co-brand", "#loaderCoBrand"]
  6118. },
  6119. help: {
  6120. visible: !0,
  6121. elements: [".nav-help", "#nav-help"]
  6122. },
  6123. tourControls: {
  6124. visible: !0,
  6125. elements: [".next", ".previous", "#play"]
  6126. },
  6127. highlight: {
  6128. visible: !0,
  6129. elements: ["#drawer", "#pullTab"]
  6130. },
  6131. share: {
  6132. visible: !0,
  6133. elements: [".socialButton", "#share"]
  6134. },
  6135. fullScreen: {
  6136. visible: !0,
  6137. elements: ["#gui-fullscreen"]
  6138. },
  6139. floors: {
  6140. visible: !0,
  6141. elements: [".gui-floor"]
  6142. }
  6143. }, Ie = (g = document.getElementById("drawer"),
  6144. function() {
  6145. $("#player").height() < 400 && g.classList.contains("open") && l()
  6146. }
  6147. ), Ee = (f = document.getElementById("meta-info"),
  6148. function() {
  6149. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6150. }
  6151. ), _e = (i = document.getElementById("meta-info"),
  6152. s = document.getElementById("interaction-modal"),
  6153. u = $("#drawer").eq(0),
  6154. d = $(".gui-floor").eq(0),
  6155. p = $(".vr-popup").eq(0),
  6156. function(e) {
  6157. switch (e) {
  6158. case "info":
  6159. we(),
  6160. Te(),
  6161. Ie(),
  6162. Me(),
  6163. Re(),
  6164. xe(),
  6165. Pe();
  6166. break;
  6167. case "terms":
  6168. be(),
  6169. Te(),
  6170. Se(),
  6171. Me(),
  6172. Re(),
  6173. xe(),
  6174. Pe();
  6175. break;
  6176. case "help":
  6177. be(),
  6178. we(),
  6179. Me(),
  6180. Re(),
  6181. xe(),
  6182. Pe();
  6183. break;
  6184. case "vr":
  6185. be(),
  6186. we(),
  6187. Me(),
  6188. Re(),
  6189. Te(),
  6190. Pe(),
  6191. t(p) && Se();
  6192. break;
  6193. case "highlights":
  6194. Ee(),
  6195. we(),
  6196. Me(),
  6197. Re();
  6198. break;
  6199. case "share":
  6200. be(),
  6201. we(),
  6202. Te(),
  6203. Re(),
  6204. xe(),
  6205. Pe();
  6206. break;
  6207. case "floor":
  6208. we(),
  6209. Me(),
  6210. xe();
  6211. break;
  6212. case "view":
  6213. Re(),
  6214. Me(),
  6215. we(),
  6216. xe();
  6217. break;
  6218. case "tour":
  6219. case "move":
  6220. we(),
  6221. Me(),
  6222. Re(),
  6223. xe();
  6224. break;
  6225. case "resize":
  6226. be(),
  6227. Ie(),
  6228. Re();
  6229. break;
  6230. case "tag":
  6231. we(),
  6232. Te(),
  6233. Me(),
  6234. Re(),
  6235. xe()
  6236. }
  6237. }
  6238. );
  6239. function be() {
  6240. i.classList.contains("expand") && z.toggleMeta(!0)
  6241. }
  6242. function we() {
  6243. W.hide()
  6244. }
  6245. function Te() {
  6246. U.close()
  6247. }
  6248. function xe() {
  6249. X.dismiss()
  6250. }
  6251. function Se() {
  6252. u.hasClass("open") && l()
  6253. }
  6254. function Me() {
  6255. K.hide()
  6256. }
  6257. function Re() {
  6258. d.hasClass("open") && d.removeClass("open")
  6259. }
  6260. function Pe() {
  6261. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6262. }
  6263. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6264. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6265. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6266. setTimeout(function() {
  6267. $(".icon:visible").hide().show(0)
  6268. }, 100)
  6269. }),
  6270. $("#gui-fullscreen").find("a").on("click", function(e) {
  6271. y(e),
  6272. S.requestFullscreen($("body")[0]),
  6273. R.track("showcase_gui", {
  6274. gui_action: "click_enter_fullscreen",
  6275. interaction_source: "gui"
  6276. })
  6277. }),
  6278. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6279. y(e),
  6280. S.exitFullscreen(),
  6281. R.track("showcase_gui", {
  6282. gui_action: "click_exit_fullscreen",
  6283. interaction_source: "gui"
  6284. })
  6285. }),
  6286. $(window).on("resize", function(e) {
  6287. var t = e.target.innerHeight
  6288. , i = e.target.innerWidth;
  6289. t === o && i === a || (Ce.highlight.visible && E(),
  6290. _e("resize"),
  6291. $(".pinTop.right").removeClass("hideUnderMeta"),
  6292. n(),
  6293. o = t,
  6294. a = i)
  6295. }).resize(),
  6296. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6297. $("#pullTab").on("click", function(e) {
  6298. y(e),
  6299. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6300. gui_action: "hide_highlight_reel"
  6301. }),
  6302. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6303. gui_action: "show_highlight_reel"
  6304. }),
  6305. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6306. l()
  6307. }),
  6308. window.MP_PREFETCHED_MODELDATA.showHotListSta && ($("#hotList").css("display", ""),
  6309. $("#hotList").on("click", function(e) {
  6310. y(e);
  6311. var t = $("#hotListWrap")[0];
  6312. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6313. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6314. this.classList.add("active"))
  6315. }),
  6316. $("#hotListContent ul").on("mouseover", function(e) {
  6317. y(e);
  6318. var t = e.target
  6319. , i = document.getElementById("hotListWrap");
  6320. if ("SPAN" === t.tagName) {
  6321. var n = t.parentElement.parentElement;
  6322. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6323. } else if ("LI" === t.tagName) {
  6324. n = t.parentElement;
  6325. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6326. } else
  6327. i.style.width = ""
  6328. }),
  6329. $("#hotListContent ul").on("click", function(e) {
  6330. y(e),
  6331. this.preElem && this.preElem.classList.remove("active"),
  6332. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6333. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player, !0),
  6334. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6335. e.target.hot && e.target.hot.examine(window.player, !0),
  6336. this.preElem = e.target)
  6337. }),
  6338. $("#hotListClose").on("click", function(e) {
  6339. y(e),
  6340. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6341. $("#hotListContent ul .active").removeClass("active"),
  6342. $("#hotList")[0].classList.remove("active")
  6343. })),
  6344. "true" === window.MP_PREFETCHED_MODELDATA.supportsVR && $("#vr").css("display", ""),
  6345. $("#more-menu-button").on("click", function(e) {
  6346. y(e),
  6347. $("#more-menu").toggleClass("open")
  6348. }),
  6349. Le.exports.init = function(s, l, c, e, t, i, n) {
  6350. var r;
  6351. x = n,
  6352. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6353. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6354. F.init(),
  6355. D.init(s, i),
  6356. ce.init(s, l, e),
  6357. $(".icon").on("mouseover", function() {
  6358. l.player && l.player.reticule.hide()
  6359. }),
  6360. function(e, t) {
  6361. var i = t.player;
  6362. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6363. y(e),
  6364. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6365. R.track("USER", {
  6366. event_type: "showcase_gui",
  6367. gui_action: "click_inside_mode_button"
  6368. }),
  6369. t.changeMode(ie.PANORAMA)
  6370. }),
  6371. $("#gui-modes-outside").find("a").on("click", function(e) {
  6372. y(e),
  6373. R.track("showcase_gui", {
  6374. gui_action: "click_outside_mode_button"
  6375. }),
  6376. t.changeMode(pe)
  6377. }),
  6378. $("#gui-modes-floorplan").on("click", function(e) {
  6379. y(e),
  6380. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6381. gui_action: "click_floorplan_mode_button"
  6382. }),
  6383. t.changeMode(ie.FLOORPLAN))
  6384. }),
  6385. $("#gui-modes-dollhouse").on("click", function(e) {
  6386. y(e),
  6387. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6388. gui_action: "click_dollhouse_mode_button"
  6389. }),
  6390. t.changeMode(ie.DOLLHOUSE))
  6391. })
  6392. }(0, l),
  6393. function(e, t) {
  6394. $("#play").on("mousedown touchstart", function(e) {
  6395. y(e),
  6396. _e("tour"),
  6397. q.play(),
  6398. R.trackAlways("showcase_gui", {
  6399. gui_action: "play_highlights"
  6400. })
  6401. }),
  6402. window.startAndPlay = function(e) {
  6403. _e("tour"),
  6404. q.play(),
  6405. R.trackAlways("showcase_gui", {
  6406. gui_action: "play_highlights"
  6407. })
  6408. }
  6409. ,
  6410. $("#pause").on("mousedown touchstart", function(e) {
  6411. y(e),
  6412. q.pause(),
  6413. R.trackAlways("showcase_gui", {
  6414. gui_action: "pause_highlights"
  6415. })
  6416. }),
  6417. $("#gui-zoomin").find("a").on("click", function(e) {
  6418. y(e),
  6419. t.player.zoomInIncrementally()
  6420. }),
  6421. $("#gui-zoomout").find("a").on("click", function(e) {
  6422. y(e),
  6423. t.player.zoomOutIncrementally()
  6424. })
  6425. }(0, l),
  6426. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(s.data.name),
  6427. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6428. function() {
  6429. _e("share"),
  6430. V.open(r)
  6431. }
  6432. )),
  6433. K.on(ae.CLOSED, V.reset)),
  6434. //1 < s.heroLocations.length ? function(e, i, t) {
  6435. 0 < s.heroLocations.length ? function(e, i, t) {
  6436. var n = 100 / (fe = e.heroLocations.length) + "%"
  6437. , r = $("#thumb-container")
  6438. , o = $("#progressBar");
  6439. $("#status").find(".totalSteps").text(fe);
  6440. for (var a = 0; a < fe; a++) {
  6441. var s = e.heroLocations[a]
  6442. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6443. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6444. if (l.attr("data-index", a),
  6445. Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6446. s.name) {
  6447. var c = $('<div class="overlay"></div>').text(s.name);
  6448. l.prepend(c)
  6449. }
  6450. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6451. var h = e.panos.get(s.panoId)
  6452. , 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>';
  6453. l.prepend(u)
  6454. }
  6455. r.append(l),
  6456. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6457. }
  6458. T = 144 * fe,
  6459. 111 * fe,
  6460. $(".thumbImg").on("mouseover", function() {
  6461. !function(e) {
  6462. return e.describe().inTransition
  6463. }(i) && t.showPathToHeroLocation($(this).data("index"))
  6464. }),
  6465. $(".thumbImg").on("mouseout", function() {
  6466. i.clearPath()
  6467. }),
  6468. $(".thumbImg").on("click", function(e) {
  6469. y(e);
  6470. var t = $(this);
  6471. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6472. R.trackAlways("showcase_gui", {
  6473. gui_action: "click_highlight"
  6474. }),
  6475. i.goToHighlight(t.data("index"))
  6476. }),
  6477. $(".previous").find("a").on("click", function(e) {
  6478. y(e),
  6479. R.trackAlways("showcase_gui", {
  6480. gui_action: "prev_highlight"
  6481. }),
  6482. i.prevHighlight()
  6483. }),
  6484. $(".next").find("a").on("click", function(e) {
  6485. y(e),
  6486. R.trackAlways("showcase_gui", {
  6487. gui_action: "next_highlight"
  6488. }),
  6489. i.nextHighlight()
  6490. }),
  6491. $("#drawer").on("mouseleave", function(t) {
  6492. var i;
  6493. y(t);
  6494. try {
  6495. i = new MouseEvent("mouseup",{
  6496. clientX: t.clientX,
  6497. clientY: t.clientY,
  6498. screenX: t.screenX,
  6499. screenY: t.screenY
  6500. })
  6501. } catch (e) {
  6502. (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)
  6503. }
  6504. document.dispatchEvent(i)
  6505. }),
  6506. (w = new Sly($("#scrollFrame"),{
  6507. horizontal: !0,
  6508. itemNav: "centered",
  6509. smart: !0,
  6510. scrollTrap: !0,
  6511. scrollBy: 1,
  6512. mouseDragging: !0,
  6513. touchDragging: !0,
  6514. speed: 300,
  6515. dragHandle: !0,
  6516. dynamicHandle: !0,
  6517. clickBar: !0,
  6518. scrollBar: $("#scroller"),
  6519. activateOn: null
  6520. }).init()).on("active", function(e, t) {
  6521. t,
  6522. _e("tour"),
  6523. $(".step").removeClass("active"),
  6524. $("#status").find(".curIdx").text(t + 1);
  6525. for (var i = 0; i <= t; i++)
  6526. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6527. }),
  6528. E()
  6529. }(s, l, c) : (Ce.highlight.visible = !1,
  6530. Ce.tourControls.visible = !1),
  6531. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6532. function() {
  6533. var n;
  6534. document.body.addEventListener("mousedown", function(e) {
  6535. n = 0 === e.button || 1 === e.which ? e.target : null
  6536. }, !0),
  6537. document.body.addEventListener("mouseup", function(t) {
  6538. n !== t.target && (n = b(n, t.target));
  6539. var e = document.getElementById("gui-parent");
  6540. if (b(e, n) !== e && (n = null),
  6541. n) {
  6542. var i;
  6543. try {
  6544. i = new MouseEvent("click",t)
  6545. } catch (e) {
  6546. (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)
  6547. }
  6548. i.syntheticClick = !0,
  6549. n.dispatchEvent(i),
  6550. n = null
  6551. }
  6552. }, !0),
  6553. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6554. e.syntheticClick || (e.stopPropagation(),
  6555. "A" === e.target.nodeName && e.preventDefault())
  6556. }, !0)
  6557. }(),
  6558. A(c),
  6559. C(s, t),
  6560. s.on("floor.changed", I),
  6561. s.on("waiting", function(e) {
  6562. _(e)
  6563. }
  6564. .bind(this, s)),
  6565. s.on("waiting-done", function(e) {
  6566. _(e)
  6567. }
  6568. .bind(this, s)),
  6569. c.on(re.ModeChanged, function(e, t) {
  6570. A(c),
  6571. v(l, c),
  6572. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6573. U.updateMode(t)
  6574. }),
  6575. e.on(oe.Move, _e.bind(this, "move")),
  6576. c.on(re.Ready, function() {
  6577. O.init(e, c, c.tagManager, l),
  6578. c.on(re.ModeChanged, function(e, t) {
  6579. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6580. })
  6581. }),
  6582. c.on(re.PanoChosen, function(e, t) {
  6583. A(c, t),
  6584. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6585. }),
  6586. V.on(k.CLOSE, function(e) {
  6587. switch (e) {
  6588. case "vr-modal":
  6589. X.dismiss();
  6590. break;
  6591. case "share-modal":
  6592. K.hide();
  6593. break;
  6594. case "terms-modal":
  6595. W.hide()
  6596. }
  6597. });
  6598. 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();
  6599. l.on("update.controls", function() {
  6600. var e, t, i, n = l.describe();
  6601. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6602. u.show()),
  6603. n.tourInProgress && (d.forEach(function(e) {
  6604. e.classList.add("playing")
  6605. }),
  6606. p.addClass("playing"),
  6607. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6608. u.hide()),
  6609. n.tourInProgress || (q.stopTour(),
  6610. d.forEach(function(e) {
  6611. e.classList.remove("playing")
  6612. }),
  6613. p.removeClass("playing"),
  6614. f.removeClass("playing"))),
  6615. null !== n.currentItem) {
  6616. var r, o;
  6617. $("#status").find(".curIdx").text(n.currentItem + 1),
  6618. n.onTheBus ? (r = "active",
  6619. o = "recent") : (o = "active",
  6620. r = "recent");
  6621. var a = null === n.destinationItem || n.currentItem === n.destinationItem;
  6622. for (e = 0; e < s.heroLocations.length; e += 1)
  6623. i = g.eq(e),
  6624. t = m.eq(e),
  6625. i.removeClass(o),
  6626. t.removeClass(o),
  6627. n.onTheBus && e === n.destinationItem ? (i.addClass(r),
  6628. t.addClass(r),
  6629. w.activate(e)) : n.onTheBus && a && e === n.currentItem ? (i.addClass(r),
  6630. t.addClass(r)) : (i.removeClass(r),
  6631. t.removeClass(r))
  6632. } else
  6633. for (e = 0; e < s.heroLocations.length; e += 1)
  6634. i = g.eq(e),
  6635. t = m.eq(e),
  6636. i.removeClass("active recent"),
  6637. t.removeClass("active recent");
  6638. v(l, c)
  6639. }),
  6640. document.addEventListener("keydown", function(e) {
  6641. switch (R.updateInteraction(oe.InteractionKey),
  6642. e.which) {
  6643. case te.ZERO:
  6644. M.debug && s.toggleAlpha();
  6645. break;
  6646. case te.NINE:
  6647. M.debug && B.toggle();
  6648. break;
  6649. case te.ONE:
  6650. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6651. break;
  6652. case te.TWO:
  6653. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6654. break;
  6655. case te.THREE:
  6656. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6657. break;
  6658. case te.FOUR:
  6659. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6660. break;
  6661. case te.SPACE:
  6662. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6663. break;
  6664. case te.RETURN:
  6665. M.debug && s.toggleExplodeUp();
  6666. break;
  6667. case te.P:
  6668. !function(e) {
  6669. me.gui || (me.gui = function(e) {
  6670. var t = new he.GUI;
  6671. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6672. e.setSweepVisibility(M.showSweeps)
  6673. }),
  6674. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6675. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6676. M.transition.flySpeed = 0,
  6677. t.__controllers.forEach(function(e) {
  6678. e.updateDisplay()
  6679. })
  6680. }),
  6681. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6682. $(t.__closeButton).hide(),
  6683. t
  6684. }(me.model)),
  6685. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6686. }(!me.visible);
  6687. break;
  6688. case te.U:
  6689. !function(e) {
  6690. ve.gui || (ve.gui = function(t, i) {
  6691. function e() {
  6692. var e = i.toJSON();
  6693. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  6694. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  6695. }
  6696. var n = {}
  6697. , r = new he.GUI({
  6698. autoPlace: !0,
  6699. width: "60%"
  6700. });
  6701. return e(),
  6702. i.on(re.ViewChanged, e),
  6703. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  6704. r.domElement.id = "datLinks",
  6705. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  6706. if (!S.detectSafari()) {
  6707. var t = document.createElement("button");
  6708. t.classList.add("btn-deep-link"),
  6709. t.innerText = se.MENU_COPY,
  6710. e.nextSibling.appendChild(t);
  6711. var n = function() {
  6712. alert(se.LINK_ALERT_COPY),
  6713. t.hide()
  6714. };
  6715. t.addEventListener("click", function(e) {
  6716. try {
  6717. var t = e.target.parentNode.childNodes[0];
  6718. t.select();
  6719. var i = document.execCommand("copy");
  6720. t.blur(),
  6721. i || n()
  6722. } catch (e) {
  6723. n()
  6724. }
  6725. })
  6726. }
  6727. }),
  6728. $(r.__closeButton).hide(),
  6729. r
  6730. }(ve.model, ve.player)),
  6731. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  6732. }(!ve.visible);
  6733. break;
  6734. case te.X:
  6735. M.debug && s.toggleExplode();
  6736. break;
  6737. case te.PLUSEQUALS:
  6738. l.player.activatePersistentZooming(!0),
  6739. O.hideUi();
  6740. break;
  6741. case te.DASHUNDERSCORE:
  6742. l.player.activatePersistentZooming(!1),
  6743. O.hideUi();
  6744. break;
  6745. case te.SEVEN:
  6746. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  6747. break;
  6748. case te.EIGHT:
  6749. l.player.decreaseZoomSpeed();
  6750. break;
  6751. case te.NINE:
  6752. l.player.increaseZoomSpeed()
  6753. }
  6754. return c && c.reticule.hide(),
  6755. !0
  6756. }
  6757. .bind(this)),
  6758. document.addEventListener("keyup", function(e) {
  6759. switch (e.which) {
  6760. case te.PLUSEQUALS:
  6761. l.player.deactivatePersistentZooming();
  6762. break;
  6763. case te.DASHUNDERSCORE:
  6764. l.player.deactivatePersistentZooming()
  6765. }
  6766. }
  6767. .bind(this)),
  6768. function(e) {
  6769. me = {
  6770. gui: null,
  6771. visible: !1,
  6772. model: e
  6773. }
  6774. }(s),
  6775. function(e, t) {
  6776. ve = {
  6777. gui: null,
  6778. visible: !1,
  6779. model: e,
  6780. player: t
  6781. }
  6782. }(s, l.player),
  6783. function(e) {
  6784. function t(e, i) {
  6785. $(e).find("a").each(function(e, t) {
  6786. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6787. t.style.pointerEvents = i ? "auto" : "none"
  6788. })
  6789. }
  6790. e.on(de.ZoomMax, function() {
  6791. t("#gui-zoomin", !1),
  6792. t("#gui-zoomout", !0)
  6793. }),
  6794. e.on(de.ZoomMin, function() {
  6795. t("#gui-zoomin", !0),
  6796. t("#gui-zoomout", !1)
  6797. }),
  6798. e.on(de.ZoomIn, function() {
  6799. t("#gui-zoomout", !0)
  6800. }),
  6801. e.on(de.ZoomOut, function() {
  6802. t("#gui-zoomin", !0)
  6803. }),
  6804. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6805. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6806. }(c),
  6807. P.setAutoPlay(s.heroCount()),
  6808. U.init(c, i.mode),
  6809. U.on(H.OPENED, _e.bind(this, "help")),
  6810. W.init(),
  6811. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  6812. function() {
  6813. _e("terms"),
  6814. V.open(o)
  6815. }
  6816. )),
  6817. W.on(j.CLOSED, V.reset),
  6818. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  6819. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  6820. M.profiling.enabled && B.show(),
  6821. q.init(l)
  6822. }
  6823. ,
  6824. Le.exports.startLoading = function(e, t, i, n, r, o) {
  6825. function a() {
  6826. o.setLoadingStartTime(),
  6827. function() {
  6828. function e(e) {
  6829. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  6830. }
  6831. $("body").css("touch-action", "none"),
  6832. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  6833. var t = document.getElementById("terms-text")
  6834. , i = document.getElementById("more-help-wrapper")
  6835. , n = (document.getElementById("navigation-help-wrapper"),
  6836. document.getElementById("help-dialog"),
  6837. document.getElementById("tag-billboards"));
  6838. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  6839. passive: !1
  6840. }),
  6841. document.body.addEventListener("DOMMouseScroll", e)),
  6842. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6843. e.stopPropagation()
  6844. })
  6845. }(),
  6846. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  6847. l()) : function(e) {
  6848. L.show(e),
  6849. c()
  6850. }(l)
  6851. }
  6852. var s = $.Deferred()
  6853. , l = s.resolve.bind(s);
  6854. ye = !0,
  6855. _(e);
  6856. e.data.player_options && function(e) {
  6857. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  6858. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  6859. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  6860. }(e.data.player_options),
  6861. 1 === M.specialEdition && $("body").addClass("specialEdition");
  6862. se.localizeGUI();
  6863. !function(i) {
  6864. function e(e, t) {
  6865. return !!i.player_options[e] && i[t || e]
  6866. }
  6867. $(".model-title").text(i.name);
  6868. var t = M.pageTitle;
  6869. 2 !== S.valueFromHash("mls", 0) && (t = i.name),
  6870. document.title = t,
  6871. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6872. delay: {
  6873. show: 50,
  6874. hide: 0
  6875. },
  6876. trigger: "hover",
  6877. html: !1,
  6878. viewport: {
  6879. selector: "body",
  6880. padding: 10
  6881. }
  6882. }),
  6883. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6884. z.populate({
  6885. name: e("model_name", "name"),
  6886. coBrand: e("presented_by"),
  6887. description: e("model_summary", "summary") || "暂无内容",
  6888. contactName: e("contact_name"),
  6889. address: e("address"),
  6890. phone: e("contact_phone"),
  6891. formattedPhone: i.formatted_contact_phone,
  6892. email: e("contact_email"),
  6893. url: e("external_url"),
  6894. socialSharing: i.enable_social_sharing && i.is_public
  6895. })
  6896. }(e.data);
  6897. r || $(".quick").addClass("hidden");
  6898. n ? (R.impression(),
  6899. a()) : (o.setWaitingStartTime(),
  6900. N.show(r, a))
  6901. return s
  6902. }
  6903. ,
  6904. Le.exports.endLoading = function(e, t, i) {
  6905. var n = t.player;
  6906. function r() {
  6907. i.dismissExaminedTag(),
  6908. i.disableHovering()
  6909. }
  6910. $("#gui-thumb").fadeOut(2500),
  6911. L.hide(function() {
  6912. ye = !1
  6913. }),
  6914. Y.init(e, i),
  6915. z.finishSetup(Object.keys(e.tags).length),
  6916. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  6917. X.on(Z.OPENED, r),
  6918. K.on(ae.OPENED, r),
  6919. U.on(H.OPENED, r),
  6920. W.on(j.OPENED, r);
  6921. var o = i.enableHovering.bind(i);
  6922. if (X.on(Z.CLOSED, o),
  6923. K.on(ae.CLOSED, o),
  6924. U.on(H.CLOSED, o),
  6925. W.on(j.CLOSED, o),
  6926. M.labels.enabled && Object.keys(e.labels).length,
  6927. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  6928. I(e.currentFloor, n.mode)),
  6929. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  6930. h(e, t)),
  6931. c(),
  6932. v(t, t.player),
  6933. $("#gui").fadeIn(1500),
  6934. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  6935. l(),
  6936. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  6937. }, 2e3),
  6938. !S.isMobile())
  6939. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  6940. $(a[s]).addClass("hasHover");
  6941. _(e),
  6942. z.setupToggling(),
  6943. window.editHotPanel && editHotPanel(),
  6944. function() {
  6945. var i = $("#pullTab")
  6946. , e = {
  6947. bottom: {
  6948. "border-bottom-left-radius": "10px",
  6949. "border-bottom-right-radius": "10px"
  6950. },
  6951. top: {
  6952. "border-top-left-radius": "10px",
  6953. "border-top-right-radius": "10px"
  6954. }
  6955. }
  6956. , t = {
  6957. bottom: {
  6958. "border-top-right-radius": "10px",
  6959. "border-bottom-right-radius": "10px"
  6960. },
  6961. top: {
  6962. "border-bottom-left-radius": "10px",
  6963. "border-top-left-radius": "10px"
  6964. }
  6965. };
  6966. function n(e, t) {
  6967. $("#gui-modes-map > div:visible:last").css(e),
  6968. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  6969. }
  6970. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  6971. (window.MP_PREFETCHED_MODELDATA.model.special || "true" === window.MP_PREFETCHED_MODELDATA.special) && window.specialScene && specialScene.special().afterImplement()
  6972. }(),
  6973. window.EditTools && (window.editTool = new EditTools(n.sceneRenderer))
  6974. }
  6975. ,
  6976. Le.exports.onProgress = function(e) {
  6977. L.progress(e)
  6978. }
  6979. }
  6980. ).call(this, "/js/gui/gui.js")
  6981. }
  6982. , {
  6983. "../analytics": 4,
  6984. "../controls/serializer": 14,
  6985. "../enum/AlignmentType": 17,
  6986. "../enum/BlackoutStyle": 18,
  6987. "../enum/ControlEvents": 21,
  6988. "../enum/DirectorEvents": 23,
  6989. "../enum/Keys": 30,
  6990. "../enum/PathDiscardMode": 38,
  6991. "../enum/PathDisplayMode": 39,
  6992. "../enum/PlayerEvents": 40,
  6993. "../enum/VROption": 47,
  6994. "../enum/Vectors": 50,
  6995. "../enum/Viewmode": 51,
  6996. "../enum/WarpStyle": 52,
  6997. "../enum/ZoomEvents": 53,
  6998. "../lib/dat.gui": 93,
  6999. "../localization/localize": 108,
  7000. "../tag/Media/MediaEvent": 131,
  7001. "../objects/Snapshot": 153,
  7002. "../settings": 166,
  7003. "../util/ajax": 181,
  7004. "../util/browser": 182,
  7005. "../util/camera": 183,
  7006. "../util/logger": 189,
  7007. "../util/showcase": 193,
  7008. "../util/transitions": 195,
  7009. "./closer/ModalCloserEvent": 61,
  7010. "./closer/modalCloser": 62,
  7011. "./help/HelpEvent": 66,
  7012. "./help/help": 67,
  7013. "./helpManager": 68,
  7014. "./immersiveMode": 69,
  7015. "./konami": 70,
  7016. "./landingScreen": 71,
  7017. "./loadingScreen": 72,
  7018. "./memoryUsage": 73,
  7019. "./playButton": 74,
  7020. "./populateModal": 75,
  7021. "./sharing/ShareEvents": 76,
  7022. "./sharing/modal": 77,
  7023. "./terms/TermsEvent": 78,
  7024. "./terms/terms": 79,
  7025. "./title/TitleEvents": 80,
  7026. "./title/tagToggle": 81,
  7027. "./title/titleBar": 82,
  7028. "./tourInteraction": 84,
  7029. "./vr/vrEvent": 85,
  7030. "./vr/vrModal": 87,
  7031. "./webvr/WebVrEvent": 88,
  7032. "./webvr/webVRgui": 89,
  7033. three: 217
  7034. }],
  7035. 66: [function(e, t, i) {
  7036. "use strict";
  7037. t.exports = Object.freeze({
  7038. OPENED: "help.opened",
  7039. CLOSED: "help.closed"
  7040. })
  7041. }
  7042. , {}],
  7043. 67: [function(e, t, i) {
  7044. "use strict";
  7045. function n() {
  7046. p.on("click", function(e) {
  7047. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7048. setTimeout(function() {
  7049. x = !1
  7050. }, h.help.modalStayDuration),
  7051. S.emit(l.OPENED),
  7052. f.addClass("open " + T),
  7053. p.addClass("open"),
  7054. o(),
  7055. r(),
  7056. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7057. v.classList.add("fadeIn")))
  7058. }),
  7059. E.on("click", function(e) {
  7060. S.close()
  7061. }),
  7062. C.on("click", function(e) {
  7063. T && T !== a.TRANSITIONING && (o(),
  7064. r())
  7065. }),
  7066. I.on("click", function(e) {
  7067. o(),
  7068. I.addClass("underline-tab"),
  7069. c.fill(b, s.MORE_HELP),
  7070. f.addClass("more-help")
  7071. })
  7072. }
  7073. function r() {
  7074. C.addClass("underline-tab"),
  7075. c.fill(_, s.NAVIGATION, T),
  7076. f.addClass(T)
  7077. }
  7078. function o() {
  7079. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7080. A.forEach(function(e) {
  7081. e.classList.remove("underline-tab")
  7082. })
  7083. }
  7084. var a = e("../../enum/Viewmode")
  7085. , s = e("../../enum/HelpModalType")
  7086. , l = e("./HelpEvent")
  7087. , c = (e("../helpManager"),
  7088. e("./../populateModal"))
  7089. , h = e("../../settings")
  7090. , u = e("../../util/common")
  7091. , d = e("events").EventEmitter
  7092. , p = $(".footer-help").eq(0)
  7093. , f = $("#help-dialog").eq(0)
  7094. , g = document.querySelector("#quick-logo")
  7095. , m = document.querySelector("#loaderCoBrand")
  7096. , v = document.querySelector("#help-dialog")
  7097. , y = document.querySelector(".footer")
  7098. , A = $(".help-tabs").children().toArray()
  7099. , C = $(".navigation-tab").eq(0)
  7100. , I = $(".more-help-tab").eq(0)
  7101. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7102. f.find(".close").eq(0))
  7103. , _ = f.find(".interactions").toArray()
  7104. , b = f.find(".ui-instructions").toArray()
  7105. , w = a.PANORAMA
  7106. , T = a.PANORAMA
  7107. , x = !1
  7108. , S = {
  7109. init: function(e, t) {
  7110. w = T = t,
  7111. [v, m, g, y].forEach(function(e) {
  7112. e.classList.add(c.deviceType)
  7113. }),
  7114. n()
  7115. },
  7116. close: function() {
  7117. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7118. p.removeClass("open"),
  7119. f.removeClass("open"),
  7120. v.classList.contains("fadeIn"))) {
  7121. v.classList.remove("fadeIn");
  7122. var e = T === a.TRANSITIONING ? w : T;
  7123. c.clear(_, s.NAVIGATION, e)
  7124. }
  7125. },
  7126. updateMode: function(e) {
  7127. w = T,
  7128. T = e
  7129. }
  7130. };
  7131. u.extendObject(S, d.prototype),
  7132. t.exports = S
  7133. }
  7134. , {
  7135. "../../enum/HelpModalType": 28,
  7136. "../../enum/Viewmode": 51,
  7137. "../../settings": 166,
  7138. "../../util/common": 185,
  7139. "../helpManager": 68,
  7140. "./../populateModal": 75,
  7141. "./HelpEvent": 66,
  7142. events: 202
  7143. }],
  7144. 68: [function(s, l, e) {
  7145. (function(e) {
  7146. "use strict";
  7147. var t = s("../util/browser")
  7148. , i = s("./../util/logger")
  7149. , n = s("./../settings")
  7150. , r = new i(e)
  7151. , o = function() {
  7152. var t;
  7153. try {
  7154. return t = window.localStorage.getItem("visitCount") || "0",
  7155. t = (parseFloat(t) + 1).toString(),
  7156. window.localStorage.setItem("visitCount", t),
  7157. r.debug("visitCount = " + t),
  7158. t
  7159. } catch (e) {
  7160. t = "1",
  7161. r.debug("couldn't set local storage")
  7162. }
  7163. }()
  7164. , a = !1;
  7165. l.exports = {
  7166. isHelpDisabled: function() {
  7167. return "0" === t.valueFromHash("help", null) || a
  7168. },
  7169. isLargeHelpEnabled: function() {
  7170. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7171. },
  7172. isSmallHelpEnabled: function() {
  7173. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7174. },
  7175. isHelpEnabled: function() {
  7176. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7177. },
  7178. setAutoPlay: function(e) {
  7179. a = 0 <= n.warp.auto && 1 < e
  7180. }
  7181. }
  7182. }
  7183. ).call(this, "/js/gui/helpManager.js")
  7184. }
  7185. , {
  7186. "../util/browser": 182,
  7187. "./../settings": 166,
  7188. "./../util/logger": 189
  7189. }],
  7190. 69: [function(e, t, i) {
  7191. "use strict";
  7192. function r(e) {
  7193. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7194. T = !0,
  7195. h.close(),
  7196. function(e) {
  7197. !n(e) && S ? v.forEach(function(e) {
  7198. e.classList.remove("drawerOpen"),
  7199. e.classList.add("duringTour")
  7200. }) : C.hasClass("open") ? v.forEach(function(e) {
  7201. e.classList.remove("duringTour"),
  7202. e.classList.add("drawerOpen")
  7203. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7204. e.classList.add("fadeOut")
  7205. })
  7206. }(e),
  7207. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7208. C.hasClass("playing") || (y.forEach(function(e) {
  7209. e.classList.add("detectHover")
  7210. }),
  7211. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7212. }
  7213. function o() {
  7214. C.hasClass("playing") || (clearTimeout(x),
  7215. x = setTimeout(a, c.immersive.timeToShowAgain))
  7216. }
  7217. function a() {
  7218. clearTimeout(x),
  7219. T = !1,
  7220. m.forEach(function(e) {
  7221. e.classList.remove("drawerOpen")
  7222. }),
  7223. S || v.forEach(function(e) {
  7224. e.classList.remove("duringTour")
  7225. }),
  7226. y.forEach(function(e) {
  7227. e.classList.remove("detectHover")
  7228. })
  7229. }
  7230. function s() {
  7231. T ? a() : r(),
  7232. M = !0,
  7233. setTimeout(function() {
  7234. M = !1
  7235. }, c.immersive.uiStayDuration)
  7236. }
  7237. function n(e) {
  7238. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7239. }
  7240. var l = e("../util/browser")
  7241. , c = e("../settings")
  7242. , h = e("./help/help")
  7243. , u = e("../enum/tagEvents")
  7244. , d = e("../enum/ControlEvents")
  7245. , p = e("../enum/PlayerEvents")
  7246. , f = e("../enum/DirectorEvents")
  7247. , g = (p = e("../enum/PlayerEvents"),
  7248. e("../enum/Viewmode"))
  7249. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7250. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7251. , y = $("#hover-bottom, #hover-top").toArray()
  7252. , A = ($("#pullTab").eq(0),
  7253. $("#playHead").eq(0),
  7254. $(".pinBottom-container").eq(0))
  7255. , C = $("#drawer").eq(0)
  7256. , I = $("#drawer-container").eq(0)
  7257. , E = $("#meta-info").eq(0)
  7258. , _ = $(".pinTop.left").eq(0)
  7259. , b = $("#player").eq(0)
  7260. , w = document.getElementById("pullTab")
  7261. , T = !1
  7262. , x = null
  7263. , S = !1
  7264. , M = !1
  7265. , R = null
  7266. , P = !1;
  7267. t.exports.init = function(e, t, i, n) {
  7268. (function(t, i, e, n) {
  7269. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7270. t.controls[e].on(d.Move, r),
  7271. t.controls[e].on(d.LongTap, s)
  7272. }),
  7273. b.on("mousewheel DOMMouseScroll", r),
  7274. e.on(u.TagActivated, r),
  7275. e.on(u.TagNavigation, r),
  7276. i.on(p.FlyingEnded, o),
  7277. i.on(p.ModeChanging, function(e, t) {
  7278. P = t !== g.PANORAMA && e !== g.PANORAMA
  7279. }),
  7280. i.on(p.ModeChanged, function(e, t) {
  7281. R = i.mode,
  7282. t !== g.TRANSITIONING ? a() : r("modeChange")
  7283. }),
  7284. n.on(f.TourStart, function() {
  7285. S = !0,
  7286. r()
  7287. }),
  7288. n.on(f.TourEnd, function() {
  7289. S = !1,
  7290. a()
  7291. }),
  7292. n.on(f.ActionInterrupted, function() {
  7293. S = !1
  7294. }),
  7295. w.addEventListener("touchend", function() {
  7296. $("#pullTab").hasClass("opened") && !S && a()
  7297. }, !0)
  7298. }
  7299. )(e, t, i, n),
  7300. l.isMobile() ? (y.forEach(function(e) {
  7301. e.classList.add("mobile")
  7302. }),
  7303. A.click(a)) : (y.forEach(function(e) {
  7304. e.addEventListener("mouseleave", function() {
  7305. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7306. }, !0)
  7307. }),
  7308. b.mouseleave(function() {
  7309. y[0].classList.contains("detectHover") && a()
  7310. })),
  7311. R = t.mode
  7312. }
  7313. ,
  7314. t.exports.hideUi = r,
  7315. t.exports.resetDrawer = function() {
  7316. I.hasClass("duringTour") || (S = !1,
  7317. r("gui"),
  7318. a())
  7319. }
  7320. }
  7321. , {
  7322. "../enum/ControlEvents": 21,
  7323. "../enum/DirectorEvents": 23,
  7324. "../enum/tagEvents": 32,
  7325. "../enum/PlayerEvents": 40,
  7326. "../enum/Viewmode": 51,
  7327. "../settings": 166,
  7328. "../util/browser": 182,
  7329. "./help/help": 67
  7330. }],
  7331. 70: [function(i, n, e) {
  7332. (function(e) {
  7333. "use strict";
  7334. var t = i("./../util/logger")
  7335. , o = i("./../settings")
  7336. , a = i("./debug")
  7337. , s = i("./../util/common")
  7338. , l = (i("./gui"),
  7339. new t(e));
  7340. o.console && $("body").append('<div id="debug-console"></div>'),
  7341. n.exports.init = function(i, n, r) {
  7342. l.debug("konami has the modelInstance");
  7343. var t = [];
  7344. $(window).on("keydown", function(e) {
  7345. t.push(e.which),
  7346. t.length > o.secretPanelWord.length && t.shift(),
  7347. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7348. o.debug = !0)
  7349. }),
  7350. $(window).on("keydown", function e(t) {
  7351. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7352. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7353. })
  7354. }
  7355. }
  7356. ).call(this, "/js/gui/konami.js")
  7357. }
  7358. , {
  7359. "./../settings": 166,
  7360. "./../util/common": 185,
  7361. "./../util/logger": 189,
  7362. "./debug": 63,
  7363. "./gui": 65
  7364. }],
  7365. 71: [function(e, t, i) {
  7366. "use strict";
  7367. function r() {
  7368. s.clear(m, l.LANDING[v]),
  7369. g.removeClass("fadeIn")
  7370. }
  7371. var o = e("../settings")
  7372. , a = (e("./help/help"),
  7373. e("./helpManager"))
  7374. , s = e("./populateModal")
  7375. , l = e("../enum/HelpModalType")
  7376. , n = e("../enum/Viewmode")
  7377. , c = e("../enum/DirectorEvents")
  7378. , h = e("../enum/PlayerEvents")
  7379. , u = $("#quick-blackout").eq(0)
  7380. , d = $("#quick-logo").eq(0)
  7381. , p = $(".quick-brand").toArray()
  7382. , f = $("#loaderCoBrand").eq(0)
  7383. , g = $("#interaction-modal").eq(0)
  7384. , m = g.find(".interaction").toArray()
  7385. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7386. "");
  7387. t.exports.delayLanding = function(e) {
  7388. var t = $.Deferred();
  7389. e || t.resolve();
  7390. var i = o.startupFlyinDelay;
  7391. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7392. setTimeout(t.resolve.bind(t), i),
  7393. t
  7394. }
  7395. ,
  7396. t.exports.showMessage = function(e, t, i) {
  7397. var n = 0;
  7398. o.quickstart.enabled && (function(e) {
  7399. e && (f.addClass("quick-brand"),
  7400. d.before(f),
  7401. p = $(".quick-brand").toArray()),
  7402. u.addClass("fadeOut"),
  7403. setTimeout(function() {
  7404. p.forEach(function(e) {
  7405. e.classList.add("fadeIn")
  7406. })
  7407. }, o.quickstart.showTextDelay),
  7408. setTimeout(function() {
  7409. p.forEach(function(e) {
  7410. e.classList.add("fadeOut")
  7411. })
  7412. }, o.quickstart.fadeOutDelay)
  7413. }(i),
  7414. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7415. function(e, t) {
  7416. setTimeout(function() {
  7417. if (a.isHelpEnabled()) {
  7418. if (t(),
  7419. s.init(),
  7420. g.addClass("fadeIn landing " + s.deviceType),
  7421. a.isSmallHelpEnabled())
  7422. return void g.addClass("small");
  7423. s.fill(m, l.LANDING[v]),
  7424. g.addClass(v)
  7425. }
  7426. }, e);
  7427. var i = {
  7428. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7429. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7430. }
  7431. , n = $(".nav-icon .icon");
  7432. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7433. function r(e) {
  7434. e.on("click", function() {
  7435. var e = null;
  7436. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7437. i.length < e || e < 1)
  7438. return !1;
  7439. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7440. "data-page": e,
  7441. src: i.mobile[e - 1]
  7442. }) : n.attr({
  7443. "data-page": e,
  7444. src: i.pc[e - 1]
  7445. })
  7446. })
  7447. }
  7448. r($(".next-button")),
  7449. r($(".prev-button"))
  7450. }(n, function() {
  7451. e.once(h.Move, r),
  7452. t.once(c.TourStart, r)
  7453. })
  7454. }
  7455. ,
  7456. t.exports.init = function(e, t) {
  7457. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7458. }
  7459. ,
  7460. t.exports.dismissModal = r
  7461. }
  7462. , {
  7463. "../enum/DirectorEvents": 23,
  7464. "../enum/HelpModalType": 28,
  7465. "../enum/PlayerEvents": 40,
  7466. "../enum/Viewmode": 51,
  7467. "../settings": 166,
  7468. "./help/help": 67,
  7469. "./helpManager": 68,
  7470. "./populateModal": 75
  7471. }],
  7472. 72: [function(e, t, i) {
  7473. "use strict";
  7474. var n = e("./circleLoader").circleLoader;
  7475. t.exports = {
  7476. element: $("#gui-loading"),
  7477. hide: function(e) {
  7478. n.done(),
  7479. this.element.fadeOut(1500, e)
  7480. },
  7481. show: function(e) {
  7482. this.element.fadeIn(500, function() {
  7483. this.element.css("display", "table"),
  7484. e && e()
  7485. }
  7486. .bind(this))
  7487. },
  7488. progress: function(e) {
  7489. n.set(e)
  7490. }
  7491. }
  7492. }
  7493. , {
  7494. "./circleLoader": 60
  7495. }],
  7496. 73: [function(e, t, i) {
  7497. "use strict";
  7498. var n = e("../settings")
  7499. , r = $("#memory-info")
  7500. , o = r.find("#memory-gpu")
  7501. , a = !1;
  7502. t.exports = {
  7503. show: function() {
  7504. n.profiling.enabled && (r.show(),
  7505. a = !0)
  7506. },
  7507. hide: function() {
  7508. r.hide(),
  7509. a = !1
  7510. },
  7511. toggle: function() {
  7512. a ? this.hide() : this.show()
  7513. },
  7514. update: function(e) {
  7515. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7516. }
  7517. }
  7518. }
  7519. , {
  7520. "../settings": 166
  7521. }],
  7522. 74: [function(e, t, i) {
  7523. "use strict";
  7524. e("../util/browser"),
  7525. e("../analytics");
  7526. e("../settings"),
  7527. t.exports = {
  7528. show: function(e, t) {
  7529. $("#gui-message").fadeOut(500, function() {
  7530. t()
  7531. })
  7532. }
  7533. }
  7534. }
  7535. , {
  7536. "../analytics": 4,
  7537. "../settings": 166,
  7538. "../util/browser": 182
  7539. }],
  7540. 75: [function(e, t, i) {
  7541. "use strict";
  7542. function n(e, t, i, n) {
  7543. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7544. }
  7545. var r = e("../util/browser")
  7546. , o = e("../localization/localize")
  7547. , a = e("../enum/HelpModalType")
  7548. , s = (e("../enum/HelpModalSize"),
  7549. e("../enum/Viewmode"));
  7550. t.exports = {
  7551. init: function() {
  7552. if (!this.hasInitialized) {
  7553. this.hasInitialized = !0,
  7554. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7555. this.assets = {},
  7556. this.assets[a.LANDING[s.PANORAMA]] = {
  7557. desktop: {
  7558. left: {
  7559. "top-info": o.ROTATE,
  7560. "big-image": "images/nav_help_mouse_drag_left.png",
  7561. keyboard: "images/nav_help_keyboard_left_right.png"
  7562. },
  7563. middle: {
  7564. "top-info": o.MOVE,
  7565. "big-image": "images/nav_help_mouse_click.png",
  7566. keyboard: "images/nav_help_keyboard_up_down.png"
  7567. },
  7568. right: {
  7569. "top-info": o.ZOOM,
  7570. "big-image": "images/nav_help_mouse_zoom.png",
  7571. keyboard: "images/nav_help_zoom_keys.png"
  7572. }
  7573. },
  7574. mobile: {
  7575. left: {
  7576. "top-info": o.ROTATE,
  7577. "big-image": "images/nav_help_gesture_drag.png"
  7578. },
  7579. middle: {
  7580. "top-info": o.MOVE,
  7581. "big-image": "images/nav_help_gesture_tap.png"
  7582. },
  7583. right: {
  7584. "top-info": o.ZOOM,
  7585. "big-image": "images/nav_help_gesture_pinch.png"
  7586. }
  7587. }
  7588. },
  7589. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7590. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7591. desktop: {
  7592. left: {
  7593. "top-info": o.ROTATE,
  7594. "big-image": "images/nav_help_mouse_drag_left.png",
  7595. keyboard: "images/nav_help_keyboard_left_right.png"
  7596. },
  7597. middle: {
  7598. "top-info": o.MOVE,
  7599. "big-image": "images/nav_help_mouse_position_right.png"
  7600. }
  7601. },
  7602. mobile: {
  7603. left: {
  7604. "top-info": o.ROTATE,
  7605. "big-image": "images/nav_help_gesture_drag.png"
  7606. },
  7607. middle: {
  7608. "top-info": o.MOVE,
  7609. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7610. }
  7611. }
  7612. },
  7613. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7614. desktop: {
  7615. left: {
  7616. "top-info": o.MOVE,
  7617. "big-image": "images/nav_help_mouse_position_left.png"
  7618. },
  7619. middle: {
  7620. "top-info": o.ROTATE,
  7621. "big-image": "images/nav_help_mouse_drag_right.png",
  7622. keyboard: "images/nav_help_keyboard_left_right.png"
  7623. }
  7624. },
  7625. mobile: {
  7626. left: {
  7627. "top-info": o.MOVE,
  7628. "big-image": "images/nav_help_gesture_position.png"
  7629. },
  7630. middle: {
  7631. "top-info": o.ROTATE,
  7632. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7633. }
  7634. }
  7635. };
  7636. var e = {
  7637. "top-info": o.INSIDE,
  7638. "big-image": "images/nav_help_click_inside.png",
  7639. keyboard: "images/nav_help_inside_key.png"
  7640. };
  7641. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7642. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7643. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7644. var t = {
  7645. "top-info": o.INSIDE,
  7646. "big-image": "images/nav_help_tap_inside.png"
  7647. };
  7648. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7649. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7650. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7651. this.assets[a.NAVIGATION] = {},
  7652. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7653. desktop: {
  7654. left: {
  7655. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7656. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7657. "big-image": "images/nav_help_mouse_drag_left.png",
  7658. keyboard: "images/nav_help_keyboard_left_right.png"
  7659. },
  7660. middle: {
  7661. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7662. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7663. "big-image": "images/nav_help_mouse_click.png",
  7664. keyboard: "images/nav_help_keyboard_up_down.png"
  7665. },
  7666. right: {
  7667. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7668. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7669. "big-image": "images/nav_help_mouse_zoom.png",
  7670. keyboard: "images/nav_help_zoom_keys.png"
  7671. }
  7672. },
  7673. mobile: {
  7674. left: {
  7675. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7676. "big-image": "images/nav_help_gesture_drag.png"
  7677. },
  7678. middle: {
  7679. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7680. "big-image": "images/nav_help_gesture_tap.png"
  7681. },
  7682. right: {
  7683. "top-info": o.HELP_MOBILE_3,
  7684. "big-image": "images/nav_help_gesture_pinch.png"
  7685. }
  7686. }
  7687. },
  7688. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7689. desktop: {
  7690. left: {
  7691. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7692. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7693. "big-image": "images/nav_help_mouse_drag_left.png",
  7694. keyboard: "images/nav_help_keyboard_all.png"
  7695. },
  7696. middle: {
  7697. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7698. "big-image": "images/nav_help_mouse_position_right.png"
  7699. },
  7700. right: {
  7701. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7702. "big-image": "images/nav_help_mouse_zoom.png"
  7703. }
  7704. },
  7705. mobile: {
  7706. left: {
  7707. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7708. "big-image": "images/nav_help_gesture_drag.png"
  7709. },
  7710. middle: {
  7711. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7712. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7713. },
  7714. right: {
  7715. "top-info": o.HELP_MOBILE_3,
  7716. "big-image": "images/nav_help_gesture_pinch.png"
  7717. }
  7718. }
  7719. },
  7720. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7721. desktop: {
  7722. left: {
  7723. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7724. "big-image": "images/nav_help_mouse_position_left.png"
  7725. },
  7726. middle: {
  7727. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7728. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7729. "big-image": "images/nav_help_mouse_drag_right.png",
  7730. keyboard: "images/nav_help_keyboard_left_right.png"
  7731. },
  7732. right: {
  7733. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7734. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7735. "big-image": "images/nav_help_mouse_zoom.png",
  7736. keyboard: "images/nav_help_keyboard_up_down.png"
  7737. }
  7738. },
  7739. mobile: {
  7740. left: {
  7741. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7742. "big-image": "images/nav_help_gesture_position.png"
  7743. },
  7744. middle: {
  7745. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7746. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7747. },
  7748. right: {
  7749. "top-info": o.HELP_MOBILE_3,
  7750. "big-image": "images/nav_help_gesture_pinch.png"
  7751. }
  7752. }
  7753. },
  7754. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7755. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7756. "top-info": o.HELP_DESKTOP_360_2A,
  7757. "bottom-info": o.HELP_DESKTOP_360_2B,
  7758. "big-image": "images/nav_help_click_inside.png",
  7759. keyboard: "images/nav_help_inside_key.png"
  7760. },
  7761. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7762. "top-info": o.HELP_MOBILE_360_2,
  7763. "big-image": "images/nav_help_tap_inside.png"
  7764. },
  7765. this.assets[a.MORE_HELP] = {
  7766. desktop: {
  7767. "more-help-hlr": {
  7768. "top-info": o.HELP_MORE_HLR_A,
  7769. "big-image": "images/nav_help_expand.svg",
  7770. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7771. },
  7772. "more-help-dollhouse": {
  7773. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7774. "big-image": "images/nav_help_dollhouse.svg",
  7775. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  7776. },
  7777. "more-help-floors": {
  7778. "top-info": o.HELP_MORE_FLOORS_A,
  7779. "big-image": "images/nav_help_floor picker.svg",
  7780. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7781. },
  7782. "more-help-tag": {
  7783. "top-info": o.HELP_MORE_TAG_A,
  7784. "big-image": "images/nav_help_tag.svg",
  7785. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  7786. },
  7787. "more-help-zoom": {
  7788. "top-info": o.HELP_MORE_ZOOM_A,
  7789. "big-image": "images/nav_help_zoom.svg",
  7790. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  7791. },
  7792. "more-help-tour": {
  7793. "top-info": o.HELP_MORE_TOUR_A,
  7794. "big-image": "images/nav_help_play.png",
  7795. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7796. },
  7797. "more-help-inside": {
  7798. "top-info": o.HELP_MORE_INSIDE_A,
  7799. "big-image": "images/nav_help_inside.svg",
  7800. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  7801. },
  7802. "more-help-vr": {
  7803. "top-info": o.HELP_MORE_VR_A,
  7804. "big-image": "images/nav_help_vr.svg",
  7805. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  7806. },
  7807. "more-help-360": {
  7808. "top-info": o.HELP_MORE_360_A,
  7809. "big-image": "images/nav_help_360.svg",
  7810. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  7811. },
  7812. "more-help-fullscreen": {
  7813. "top-info": o.HELP_MORE_FULLSCREEN_A,
  7814. "big-image": "images/nav_help_fullscreen.svg",
  7815. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  7816. }
  7817. },
  7818. mobile: {
  7819. "more-help-hlr": {
  7820. "top-info": o.HELP_MORE_HLR_A,
  7821. "big-image": "images/nav_help_expand.svg",
  7822. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7823. },
  7824. "more-help-dollhouse": {
  7825. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7826. "big-image": "images/nav_help_dollhouse.svg",
  7827. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  7828. },
  7829. "more-help-floors": {
  7830. "top-info": o.HELP_MORE_FLOORS_A,
  7831. "big-image": "images/nav_help_floor picker.svg",
  7832. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7833. },
  7834. "more-help-tag": {
  7835. "top-info": o.HELP_MORE_TAG_A,
  7836. "big-image": "images/nav_help_tag.svg",
  7837. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  7838. },
  7839. "more-help-tour": {
  7840. "top-info": o.HELP_MORE_TOUR_A,
  7841. "big-image": "images/nav_help_play.png",
  7842. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7843. },
  7844. "more-help-inside": {
  7845. "top-info": o.HELP_MORE_INSIDE_A,
  7846. "big-image": "images/nav_help_inside.svg",
  7847. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  7848. },
  7849. "more-help-vr": {
  7850. "top-info": o.HELP_MORE_VR_A,
  7851. "big-image": "images/webvr.svg",
  7852. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  7853. },
  7854. "more-help-360": {
  7855. "top-info": o.HELP_MORE_360_A,
  7856. "big-image": "images/nav_help_360.svg",
  7857. "bottom-info": o.HELP_MOBILE_MORE_360_B
  7858. }
  7859. }
  7860. },
  7861. this.assets[a.TOUR_INTERACTION[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.PLAY,
  7875. "big-image": "images/Desktop-help-play-button.svg",
  7876. keyboard: "images/Desktop-help-spacebar-2.svg"
  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.PLAY,
  7890. "big-image": "images/mobile-help-play-button.svg"
  7891. }
  7892. }
  7893. },
  7894. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  7895. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  7896. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  7897. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  7898. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  7899. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  7900. }
  7901. },
  7902. fill: function(e, t, i) {
  7903. n.call(this, e, t, i, !0)
  7904. },
  7905. clear: function(e, t, i) {
  7906. n.call(this, e, t, i, !1)
  7907. }
  7908. }
  7909. }
  7910. , {
  7911. "../enum/HelpModalSize": 27,
  7912. "../enum/HelpModalType": 28,
  7913. "../enum/Viewmode": 51,
  7914. "../localization/localize": 108,
  7915. "../util/browser": 182
  7916. }],
  7917. 76: [function(e, t, i) {
  7918. "use strict";
  7919. t.exports = Object.freeze({
  7920. OPENED: "share.open",
  7921. CLOSED: "share.closed",
  7922. LINK_CLICKED: "share.linked"
  7923. })
  7924. }
  7925. , {}],
  7926. 77: [function(e, t, i) {
  7927. "use strict";
  7928. function n(n) {
  7929. function e(e, t) {
  7930. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  7931. I.emit(l.LINK_CLICKED, {
  7932. channel: n
  7933. }),
  7934. window.open(C[n], "shareWindow", i)
  7935. }
  7936. switch (n) {
  7937. case A.FACEBOOK:
  7938. e(580, 420);
  7939. break;
  7940. case A.TWITTER:
  7941. e(550, 440);
  7942. break;
  7943. case A.MAIL:
  7944. I.emit(l.LINK_CLICKED, {
  7945. channel: "email"
  7946. }),
  7947. window.open(C[n], "_blank");
  7948. break;
  7949. case A.LINKEDIN:
  7950. }
  7951. }
  7952. function r(e) {
  7953. I.emit(l.LINK_CLICKED, {
  7954. channel: "copylink"
  7955. });
  7956. var t = document.createRange();
  7957. t.selectNodeContents(v);
  7958. var i = window.getSelection();
  7959. i.removeAllRanges(),
  7960. i.addRange(t),
  7961. document.execCommand("copy"),
  7962. y.classList.remove("hidden"),
  7963. v.classList.add("highlighted")
  7964. }
  7965. function o(e) {
  7966. e && (e.stopPropagation(),
  7967. e.target === v) || (window.getSelection().removeAllRanges(),
  7968. v.classList.remove("highlighted"),
  7969. y.classList.add("hidden"))
  7970. }
  7971. var a = e("../../util/browser")
  7972. , s = e("../../localization/localize")
  7973. , l = e("./ShareEvents")
  7974. , c = e("../../util/common")
  7975. , h = e("events").EventEmitter
  7976. , u = document.getElementById("sharing")
  7977. , d = document.getElementById("share-modal")
  7978. , p = document.getElementById("share-close")
  7979. , f = document.getElementById("facebook-share")
  7980. , g = document.getElementById("twitter-share")
  7981. , m = document.getElementById("mail-share")
  7982. , v = document.getElementById("share-url-text")
  7983. , y = document.getElementById("copy-success")
  7984. , A = Object.freeze({
  7985. FACEBOOK: "facebook",
  7986. TWITTER: "twitter",
  7987. MAIL: "mail",
  7988. LINKEDIN: "linkedin"
  7989. })
  7990. , C = {};
  7991. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  7992. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  7993. C[A.MAIL] = "mailto:?subject=";
  7994. var I = {
  7995. init: function(e) {
  7996. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  7997. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  7998. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  7999. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8000. u.addEventListener("click", this.toggle.bind(this)),
  8001. p.addEventListener("click", this.hide.bind(this)),
  8002. v.addEventListener("click", r),
  8003. d.addEventListener("click", o),
  8004. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8005. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8006. m.addEventListener("click", n.bind(this, A.MAIL)),
  8007. v.textContent = window.location.href + "&utm_source=4",
  8008. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8009. u.classList.remove("hidden")
  8010. },
  8011. show: function() {
  8012. this.emit(l.OPENED),
  8013. d.classList.add("fadeIn")
  8014. },
  8015. hide: function() {
  8016. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8017. document.selection && document.selection.empty(),
  8018. window.getSelection().removeAllRanges(),
  8019. o(),
  8020. d.classList.remove("fadeIn"))
  8021. },
  8022. toggle: function() {
  8023. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8024. }
  8025. };
  8026. c.extendObject(I, h.prototype),
  8027. t.exports = I
  8028. }
  8029. , {
  8030. "../../localization/localize": 108,
  8031. "../../util/browser": 182,
  8032. "../../util/common": 185,
  8033. "./ShareEvents": 76,
  8034. events: 202
  8035. }],
  8036. 78: [function(e, t, i) {
  8037. "use strict";
  8038. t.exports = Object.freeze({
  8039. OPENED: "terms.opened",
  8040. CLOSED: "terms.closed"
  8041. })
  8042. }
  8043. , {}],
  8044. 79: [function(e, t, i) {
  8045. "use strict";
  8046. var n = e("./TermsEvent")
  8047. , r = e("../../localization/localize")
  8048. , o = e("../../analytics")
  8049. , a = e("../../util/ajax")
  8050. , s = e("../../util/common")
  8051. , l = e("events").EventEmitter
  8052. , c = document.getElementById("terms-modal")
  8053. , h = {
  8054. init: function() {
  8055. $(".footer-terms").on("click", function(e) {
  8056. e.preventDefault(),
  8057. this.show()
  8058. }
  8059. .bind(this)),
  8060. $("#terms-modal .close").on("click", this.hide.bind(this))
  8061. },
  8062. show: function() {
  8063. this.emit(n.OPENED),
  8064. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8065. var t = $("#terms-text").html(e);
  8066. o.track("showcase_gui", {
  8067. gui_action: "click_terms_button",
  8068. interaction_source: "gui"
  8069. }),
  8070. t.find("a").attr("target", "_blank")
  8071. }).fail(function() {
  8072. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8073. }),
  8074. c.classList.add("fadeIn")
  8075. },
  8076. hide: function(e) {
  8077. e && e.preventDefault(),
  8078. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8079. c.classList.remove("fadeIn")
  8080. }
  8081. };
  8082. s.extendObject(h, l.prototype),
  8083. t.exports = h
  8084. }
  8085. , {
  8086. "../../analytics": 4,
  8087. "../../localization/localize": 108,
  8088. "../../util/ajax": 181,
  8089. "../../util/common": 185,
  8090. "./TermsEvent": 78,
  8091. events: 202
  8092. }],
  8093. 80: [function(e, t, i) {
  8094. "use strict";
  8095. t.exports = Object.freeze({
  8096. OPEN_INFO: "title.open.info",
  8097. CLOSE_INFO: "title.close.info",
  8098. SHOW_INFO: "title.show.info",
  8099. HIDE_INFO: "title.hide.info",
  8100. LINK_CLICKED: "title.link.click",
  8101. CONTACT_LINK_CLICKED: "title.contact.click",
  8102. ORIGIN_LINK_CLICKED: "title.origin.click"
  8103. })
  8104. }
  8105. , {}],
  8106. 81: [function(e, t, i) {
  8107. "use strict";
  8108. var o = e("../../settings");
  8109. t.exports.init = function(e, t) {
  8110. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8111. function e(e) {
  8112. t.shouldShowtags = "show" === this.value,
  8113. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8114. }
  8115. document.getElementById("tag-toggles").classList.remove("hidden"),
  8116. document.getElementById("radio-tag-show").checked = !0;
  8117. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8118. n[r].addEventListener("change", e)
  8119. }(e, t)
  8120. }
  8121. }
  8122. , {
  8123. "../../settings": 166
  8124. }],
  8125. 82: [function(S, M, e) {
  8126. (function(e) {
  8127. "use strict";
  8128. function i(e) {
  8129. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8130. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8131. _.appendChild(function(e) {
  8132. var t = document.createElement("a");
  8133. return t.id = "url",
  8134. t.target = "_blank",
  8135. t.href = e,
  8136. t.innerText = e,
  8137. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8138. t
  8139. }(e)),
  8140. b.forEach(function(e) {
  8141. e.classList.add("share-link")
  8142. }),
  8143. 0))
  8144. }
  8145. function s(e, t) {
  8146. var i = e
  8147. , n = t;
  8148. return function(e, t) {
  8149. i.push(t || n, e)
  8150. }
  8151. }
  8152. var l = S("../../util/browser")
  8153. , t = S("../../util/common")
  8154. , n = S("../../util/logger")
  8155. , r = S("../../localization/localize")
  8156. , o = S("./titleBarSettings")
  8157. , c = S("../../settings")
  8158. , a = S("./TitleEvents")
  8159. , h = S("events").EventEmitter
  8160. , u = new n(e)
  8161. , d = document.querySelector(".pinTop.left")
  8162. , p = document.getElementsByClassName("title-container")[0]
  8163. , f = document.getElementById("title-toggle").querySelector("i")
  8164. , g = document.getElementById("meta-info-wrapper")
  8165. , m = document.getElementById("meta-info")
  8166. , v = document.getElementById("meta-description")
  8167. , y = document.getElementsByClassName("contact-info")[0]
  8168. , A = document.getElementById("contact-data")
  8169. , C = document.getElementById("addressTxt")
  8170. , I = document.getElementById("tag-toggles")
  8171. , E = document.getElementById("share-origin")
  8172. , _ = document.getElementById("share-link-wrapper")
  8173. , b = [m, g, p]
  8174. , w = !1
  8175. , T = !1
  8176. , x = {
  8177. populate: function(e) {
  8178. if (function(e, t) {
  8179. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8180. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8181. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8182. document.getElementById("gui-name").classList.add("noCoBrand"),
  8183. document.getElementById("cobrandTitle").classList.add("hidden")),
  8184. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8185. !1)
  8186. }(e.name, e.coBrand)) {
  8187. if (function(e) {
  8188. e ? (w = !0,
  8189. v.innerHTML = e) : v.classList.add("hidden")
  8190. }(e.description),
  8191. function(e, t, i, n) {
  8192. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8193. w = !0;
  8194. var r = []
  8195. , o = s(r, "<br>");
  8196. if (e && o('<span id="contactName">' + e + "</span>"),
  8197. t) {
  8198. var a = n || t;
  8199. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8200. }
  8201. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8202. r[0] = "",
  8203. A.innerHTML = r.join("")
  8204. } else
  8205. y.classList.add("hidden")
  8206. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8207. function(e) {
  8208. if ("string" == typeof e)
  8209. try {
  8210. e = JSON.parse(e)
  8211. } catch (e) {
  8212. return u.warn("Unable to parse address data"),
  8213. C.parentElement.classList.add("hidden")
  8214. }
  8215. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8216. w = !0;
  8217. var t = []
  8218. , i = s(t, " ");
  8219. e.address_1 && i(e.address_1),
  8220. e.address_2 && i(e.address_2),
  8221. e.city && i(e.city, ", "),
  8222. e.state && i(e.state, ", "),
  8223. e.zip && i(e.zip, e.state ? " " : ", "),
  8224. t[0] = "",
  8225. C.innerText = t.join("")
  8226. } else
  8227. C.parentElement.classList.add("hidden")
  8228. }(e.address),
  8229. w) {
  8230. var t = document.createElement("br");
  8231. I.insertBefore(t, I.firstElementChild)
  8232. }
  8233. e.socialSharing && c.share.enabled && (T = i(e.url))
  8234. }
  8235. },
  8236. finishSetup: function(e) {
  8237. w = w || !!e,
  8238. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8239. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8240. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8241. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8242. }),
  8243. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8244. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8245. contact_type: e.getAttribute("id")
  8246. }))
  8247. }),
  8248. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8249. },
  8250. toggleMeta: function(e, t) {
  8251. var i = document.getElementById("model-title");
  8252. t && t.preventDefault();
  8253. var n = m.classList.contains("expand");
  8254. e && !n || (n ? (b.forEach(function(e) {
  8255. e.classList.remove("expand")
  8256. }),
  8257. this.emit(a.CLOSE_INFO),
  8258. i.classList.remove("expand")) : (b.forEach(function(e) {
  8259. e.classList.add("expand")
  8260. }),
  8261. i.classList.add("expand"),
  8262. this.emit(a.OPEN_INFO)))
  8263. },
  8264. setupToggling: function() {
  8265. g.style.height = m.offsetHeight + "px",
  8266. m.addEventListener("transitionend", function() {
  8267. g.style.height = m.offsetHeight + "px"
  8268. })
  8269. },
  8270. toggleTitle: function(e) {
  8271. e && e.preventDefault(),
  8272. d.classList.contains("closed") ? (d.classList.add("open"),
  8273. f.classList.remove("icon-dpad-right"),
  8274. f.classList.add("icon-dpad-left"),
  8275. this.emit(a.SHOW_INFO),
  8276. setTimeout(function() {
  8277. d.classList.remove("closed"),
  8278. d.classList.remove("open")
  8279. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8280. f.classList.remove("icon-dpad-left"),
  8281. f.classList.add("icon-dpad-right"),
  8282. this.emit(a.HIDE_INFO))
  8283. }
  8284. };
  8285. t.extendObject(x, h.prototype),
  8286. M.exports = x
  8287. }
  8288. ).call(this, "/js/gui/title/titleBar.js")
  8289. }
  8290. , {
  8291. "../../localization/localize": 108,
  8292. "../../settings": 166,
  8293. "../../util/browser": 182,
  8294. "../../util/common": 185,
  8295. "../../util/logger": 189,
  8296. "./TitleEvents": 80,
  8297. "./titleBarSettings": 83,
  8298. events: 202
  8299. }],
  8300. 83: [function(e, t, i) {
  8301. "use strict";
  8302. t.exports = Object.freeze({
  8303. minTooltipCharacters: 19,
  8304. removeAnimationClasses: 500
  8305. })
  8306. }
  8307. , {}],
  8308. 84: [function(e, t, i) {
  8309. "use strict";
  8310. function n() {
  8311. v.playTour(),
  8312. y && clearTimeout(y),
  8313. c(),
  8314. E.removeClass("fadeIn")
  8315. }
  8316. function r() {
  8317. A.classList.contains("playing") && (v.stopTour(),
  8318. E.addClass("fadeIn"),
  8319. setTimeout(function() {
  8320. E.removeClass("fadeIn")
  8321. }, h.tourInteraction.showPauseButton),
  8322. M || (clearTimeout(y),
  8323. y = setTimeout(s, h.tourInteraction.showModal)),
  8324. setTimeout(function() {
  8325. A.classList.remove("playing")
  8326. }, h.tourInteraction.allowNextClick))
  8327. }
  8328. function o() {
  8329. v.tourInProgress && (v.stopTour(),
  8330. v.endTourProgress(),
  8331. A.classList.remove("playing"))
  8332. }
  8333. function a() {
  8334. _.is(":visible") ? n() : r()
  8335. }
  8336. function s() {
  8337. if (!h.tourInteraction.disabled) {
  8338. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8339. T.addClass("fadeIn tour " + p.deviceType);
  8340. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8341. if (!h.tourInteraction.smallModal)
  8342. 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,
  8343. p.fill(x, g.TOUR_INTERACTION[e]),
  8344. T.addClass(e);
  8345. T.addClass(t)
  8346. }
  8347. }
  8348. function l(e, t) {
  8349. if (t) {
  8350. var i = "keydown" === t.type
  8351. , n = t.which === u.SPACE || v.tourIsPlaying;
  8352. i && n || e || (M = !0),
  8353. v.atEndOfTour() && c(),
  8354. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8355. c(),
  8356. t.which !== u.SPACE && o()),
  8357. i && n && a()
  8358. }
  8359. }
  8360. function c() {
  8361. T.removeClass("fadeIn")
  8362. }
  8363. var h = (e("../util/browser"),
  8364. e("../settings"))
  8365. , u = e("../enum/Keys")
  8366. , d = e("../enum/Viewmode")
  8367. , p = (e("./helpManager"),
  8368. e("./populateModal"))
  8369. , f = e("../enum/DirectorEvents")
  8370. , g = e("../enum/HelpModalType")
  8371. , m = e("../enum/HelpModalSize")
  8372. , v = null
  8373. , y = null
  8374. , A = document.getElementById("pause-overlay")
  8375. , C = document.getElementById("player")
  8376. , I = document.getElementById("gui")
  8377. , E = $("#pause-icon").eq(0)
  8378. , _ = $("#play").eq(0)
  8379. , b = $("#playHead").eq(0)
  8380. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8381. , T = $("#interaction-modal").eq(0)
  8382. , x = $("#interaction-modal .interaction").toArray()
  8383. , S = ["touchstart", "mousedown", "pointerdown"]
  8384. , M = !1;
  8385. t.exports.init = function(e) {
  8386. v = e,
  8387. S.forEach(function(t) {
  8388. C.addEventListener(t, l.bind(this, !1), !0),
  8389. I.addEventListener(t, l.bind(this, !0), !0),
  8390. A.addEventListener(t, r, !0),
  8391. w.forEach(function(e) {
  8392. e.addEventListener(t, o, !0)
  8393. }),
  8394. $("#drawer img").on(t, o)
  8395. }),
  8396. document.addEventListener("keydown", l.bind(this, !1), !0),
  8397. v.on(f.TourStart, function() {
  8398. A.classList.add("playing")
  8399. })
  8400. }
  8401. ,
  8402. t.exports.play = n,
  8403. t.exports.pause = r,
  8404. t.exports.pauseWithoutCTA = o,
  8405. t.exports.togglePlay = a,
  8406. t.exports.stopTour = function() {
  8407. b.hasClass("playing") && (clearTimeout(y),
  8408. v.atEndOfTour() ? (A.classList.remove("playing"),
  8409. s()) : E.removeClass("fadeIn"))
  8410. }
  8411. ,
  8412. t.exports.dismissModal = c
  8413. }
  8414. , {
  8415. "../enum/DirectorEvents": 23,
  8416. "../enum/HelpModalSize": 27,
  8417. "../enum/HelpModalType": 28,
  8418. "../enum/Keys": 30,
  8419. "../enum/Viewmode": 51,
  8420. "../settings": 166,
  8421. "../util/browser": 182,
  8422. "./helpManager": 68,
  8423. "./populateModal": 75
  8424. }],
  8425. 85: [function(e, t, i) {
  8426. "use strict";
  8427. t.exports = Object.freeze({
  8428. OPENED: "vr.modal.opened",
  8429. LAUNCH: "vr.modal.launch",
  8430. CLOSED: "vr.modal.closed",
  8431. NEXT: "vr.modal.next",
  8432. PREV: "vr.modal.prev",
  8433. STORE: "vr.modal.store",
  8434. falseICECHOSEN: "vr.modal.device"
  8435. })
  8436. }
  8437. , {}],
  8438. 86: [function(e, t, i) {
  8439. "use strict";
  8440. var h = e("../../util/browser")
  8441. , u = e("../../enum/VRApps")
  8442. , n = e("../../enum/VRPlatforms")
  8443. , d = e("../../util/ajax")
  8444. , p = e("../../settings")
  8445. , r = {};
  8446. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8447. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8448. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8449. u) {
  8450. var a = u[o];
  8451. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8452. }
  8453. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8454. "https://" + s);
  8455. t.exports.init = function(e, t, o) {
  8456. function a(e, t, i, n) {
  8457. function r() {
  8458. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8459. }
  8460. 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()
  8461. }
  8462. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8463. , l = g + "/vr/dlist/?ret=" + s
  8464. , c = g + "/vr/show/?ret=" + s;
  8465. switch (e) {
  8466. case n.IOS:
  8467. !function(t, e, i, n) {
  8468. var r = a(t, e, i, n)
  8469. , o = {
  8470. responseType: "json",
  8471. data: {
  8472. branch_key: p.appConfig.branch_key,
  8473. data: {
  8474. m: e,
  8475. full_url: r,
  8476. $desktop_url: "",
  8477. $og_app_id: "331853976762864119",
  8478. $og_title: i,
  8479. $og_description: n,
  8480. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8481. $canonical_url: window.location.href
  8482. }
  8483. }
  8484. };
  8485. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8486. f[t] = e.url
  8487. }).fail(function(e) {
  8488. f[t] = e
  8489. }
  8490. .bind(this, r))
  8491. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8492. break;
  8493. default:
  8494. !function(e, t, i) {
  8495. for (var n in u) {
  8496. var r = u[n]
  8497. , o = a(r, e, t, i);
  8498. f[r] = o
  8499. }
  8500. }(t.sid, t.name, t.summary)
  8501. }
  8502. }
  8503. ,
  8504. t.exports.launch = function(e) {
  8505. var t = f[e];
  8506. window.open(t, "_blank")
  8507. }
  8508. ,
  8509. t.exports.launchStore = function(e) {
  8510. var t = r[e];
  8511. window.open(t, "_blank")
  8512. }
  8513. }
  8514. , {
  8515. "../../enum/VRApps": 46,
  8516. "../../enum/VRPlatforms": 49,
  8517. "../../settings": 166,
  8518. "../../util/ajax": 181,
  8519. "../../util/browser": 182
  8520. }],
  8521. 87: [function(e, t, i) {
  8522. "use strict";
  8523. function c(e) {
  8524. var t;
  8525. switch (e) {
  8526. case y.IOS:
  8527. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8528. case y.Android:
  8529. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8530. }
  8531. return !1
  8532. }
  8533. function h(e) {
  8534. switch (e) {
  8535. case y.Android:
  8536. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8537. x.filter(".gearvr").off().on("click", q.gear),
  8538. n(k, U, "logo-button", "same-line");
  8539. break;
  8540. case y.UnsupportedAndroid:
  8541. n("", H, "", "");
  8542. break;
  8543. case y.IOS:
  8544. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8545. n(k, "", "logo-button", "");
  8546. break;
  8547. case y.Desktop:
  8548. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8549. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8550. n(k, U, "logo-button", "same-line"),
  8551. Q.cardboard()
  8552. }
  8553. }
  8554. function u(e) {
  8555. $(".p1, .p2, .p3").hide(),
  8556. l.insertAfter(T),
  8557. w.removeClass("front-page"),
  8558. w.removeClass("details-page"),
  8559. w.removeClass("lastPage"),
  8560. x.removeClass("logo-button"),
  8561. x.removeClass("same-line"),
  8562. T.removeClass("headsetOptions"),
  8563. S.attr("src", ""),
  8564. S.filter(".second").removeClass("gear"),
  8565. S.css("display", "inline-block"),
  8566. S.off(),
  8567. M.filter(".second").css("display", ""),
  8568. O.css("display", "none"),
  8569. $(".p" + (e + 1) + _).show(),
  8570. S.filter(".third").insertBefore(M.filter(".third"))
  8571. }
  8572. function n(e, t, i, n) {
  8573. w.addClass("front-page"),
  8574. S.filter(".first").attr("src", e),
  8575. S.filter(".second").attr("src", t),
  8576. x.filter(".first").addClass(i),
  8577. x.filter(".second").addClass(i),
  8578. x.addClass(n),
  8579. ".show-desktop" === _ && T.insertAfter(l)
  8580. }
  8581. function r(e, t, i) {
  8582. T.addClass("headsetOptions"),
  8583. x.off(),
  8584. S.filter(".second").attr("src", t),
  8585. O.css("display", "block"),
  8586. M.filter(".second").css("display", "none"),
  8587. O.on("click", function() {
  8588. u(b.Title),
  8589. h(y.Desktop)
  8590. }),
  8591. e && (X.emit(C.falseICECHOSEN, {
  8592. name: v.GearVR
  8593. }),
  8594. S.filter(".first").attr("src", e),
  8595. S.filter(".second").addClass("gear"),
  8596. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8597. Q.gearvr()),
  8598. i && (X.emit(C.falseICECHOSEN, {
  8599. name: v.Cardboard
  8600. }),
  8601. S.filter(".third").attr("src", i),
  8602. S.filter(".third").show(),
  8603. S.filter(".third").insertAfter(S.filter(".second")),
  8604. S.filter(".third").addClass("link"),
  8605. S.filter(".second").addClass("link"),
  8606. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8607. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8608. Q.cardboard())
  8609. }
  8610. function d(e, t) {
  8611. switch (t) {
  8612. case y.IOS:
  8613. j = W,
  8614. Y = G;
  8615. break;
  8616. case y.Desktop:
  8617. e === b.Cardboard ? (j = N,
  8618. Y = B,
  8619. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8620. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8621. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8622. Y = "");
  8623. break;
  8624. default:
  8625. Y = e === b.Cardboard ? (j = H,
  8626. G) : (j = V,
  8627. z)
  8628. }
  8629. }
  8630. function p(e, t, i) {
  8631. w.find(".inner").addClass("details-page"),
  8632. w.addClass("details-page"),
  8633. S.filter(".first").attr("src", e),
  8634. S.filter(".second").attr("src", t),
  8635. S.filter(".third").attr("src", i)
  8636. }
  8637. function f() {
  8638. var e = 1 < g.aspectRatio() && g.isMobile();
  8639. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8640. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8641. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8642. }
  8643. var g = e("../../util/browser")
  8644. , m = e("./vrLink")
  8645. , v = e("../../enum/VRApps")
  8646. , y = e("../../enum/VRPlatforms")
  8647. , A = e("../../enum/VRPages")
  8648. , C = e("./vrEvent")
  8649. , o = (e("../../settings"),
  8650. e("../../constants"))
  8651. , I = e("../../localization/localize")
  8652. , a = e("../../util/common")
  8653. , s = e("events").EventEmitter
  8654. , E = 0
  8655. , _ = null
  8656. , b = A.standard
  8657. , w = $(".vr-popup")
  8658. , l = w.find(".vr-popup-body")
  8659. , T = w.find(".vr-images")
  8660. , x = w.find(".img-container")
  8661. , S = w.find(".vr-sm-image")
  8662. , M = x.find(".vr-img-caption")
  8663. , R = $(".vr-buttons").find(".prev-button")
  8664. , P = $(".vr-buttons").find(".next-button")
  8665. , O = T.find(".front-close")
  8666. , L = $(".vr-page")
  8667. , D = w.find("img")
  8668. , N = "images/apple-store.png"
  8669. , F = "images/badge-oculus.png"
  8670. , B = "images/badge-cardboard.png"
  8671. , V = "images/logo-samsung.png"
  8672. , k = "images/headset-cardboard.png"
  8673. , U = "images/headset-gearvr.png"
  8674. , H = "images/ico-android-robot.png"
  8675. , z = "images/ico-gearvr.png"
  8676. , G = "images/ico-vr.png"
  8677. , W = "images/apple-logo-white.svg"
  8678. , j = null
  8679. , Y = null
  8680. , q = {}
  8681. , X = {
  8682. init: function(e, t) {
  8683. function i(e) {
  8684. X.emit(C.STORE, {
  8685. type: e
  8686. }),
  8687. m.launchStore(e)
  8688. }
  8689. function n(e) {
  8690. switch (e !== b.pageCount && (u(e),
  8691. L.text(e + 1 + " / " + b.pageCount)),
  8692. e) {
  8693. case b.Title:
  8694. R.css("display", "none"),
  8695. P.text(a[e]),
  8696. h(r);
  8697. break;
  8698. case b.Cardboard:
  8699. R.css("display", "block"),
  8700. P.text(a[e]),
  8701. x.filter(".cardboard").off(),
  8702. x.filter(".gearvr").off(),
  8703. d(e, r),
  8704. p(k, j, Y);
  8705. break;
  8706. case b.Gear:
  8707. P.text(a[e]),
  8708. d(e, r),
  8709. w.addClass("lastPage"),
  8710. p(U, j, Y);
  8711. break;
  8712. case b.pageCount:
  8713. w.removeClass("fadeIn"),
  8714. X.emit(C.CLOSED)
  8715. }
  8716. D.filter("[src='']").hide()
  8717. }
  8718. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  8719. _ = ".show-supported",
  8720. y.Android) : (w.addClass("unsupported"),
  8721. _ = ".show-unsupported",
  8722. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  8723. _ = ".show-ios",
  8724. b = A.ios,
  8725. y.IOS) : (w.addClass("desktop"),
  8726. _ = ".show-desktop",
  8727. y.Desktop);
  8728. function o(e) {
  8729. X.emit(C.LAUNCH, {
  8730. vr_platform: r,
  8731. vr_app: e
  8732. }),
  8733. m.launch(e)
  8734. }
  8735. m.init(r, e, t),
  8736. r !== y.Desktop && w.addClass("mobile"),
  8737. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  8738. q.gear = o.bind(this, v.GearVR),
  8739. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  8740. f(),
  8741. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8742. $(_).show();
  8743. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  8744. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8745. r === y.IOS && (a.splice(1, 1),
  8746. s.splice(1, 1)),
  8747. $("#vr").on("click", function(e) {
  8748. e.preventDefault(),
  8749. window.vrEnabled || (window.vrEnabled = !0,
  8750. this.classList.add("active"),
  8751. $("#gui div").not("#vrOff").addClass("vrHide"),
  8752. $("#vrOffImg").css({
  8753. display: "inline-block"
  8754. }))
  8755. }),
  8756. $("#vrOff").on("click", function() {
  8757. window.vrEnabled = !1,
  8758. $("#gui div").not("#vrOff").removeClass("vrHide"),
  8759. $("#vrOffImg").css({
  8760. display: "none"
  8761. }),
  8762. $("#player canvas").css({
  8763. width: "",
  8764. height: ""
  8765. }),
  8766. $("#vr").removeClass("active")
  8767. });
  8768. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  8769. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  8770. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  8771. $("span.modelLink").text(l),
  8772. R.on("click", function(e) {
  8773. X.emit(C.PREV),
  8774. n(--E)
  8775. }),
  8776. P.on("click", function(e) {
  8777. P.text(),
  8778. X.emit(C.NEXT, {
  8779. nextAction: s[E]
  8780. }),
  8781. n(++E)
  8782. }),
  8783. w.find(".close").on("click", X.dismiss)
  8784. },
  8785. dismiss: function() {
  8786. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  8787. X.emit(C.CLOSED))
  8788. },
  8789. isDeviceSupported: c
  8790. };
  8791. a.extendObject(X, s.prototype),
  8792. $(window).resize(f);
  8793. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  8794. K = M.filter(".first").find(".gearvr"),
  8795. {
  8796. cardboard: function() {
  8797. K.addClass("hidden"),
  8798. Z.removeClass("hidden")
  8799. },
  8800. gearvr: function() {
  8801. Z.addClass("hidden"),
  8802. K.removeClass("hidden")
  8803. }
  8804. });
  8805. t.exports = X
  8806. }
  8807. , {
  8808. "../../constants": 8,
  8809. "../../enum/VRApps": 46,
  8810. "../../enum/VRPages": 48,
  8811. "../../enum/VRPlatforms": 49,
  8812. "../../localization/localize": 108,
  8813. "../../settings": 166,
  8814. "../../util/browser": 182,
  8815. "../../util/common": 185,
  8816. "./vrEvent": 85,
  8817. "./vrLink": 86,
  8818. events: 202
  8819. }],
  8820. 88: [function(e, t, i) {
  8821. "use strict";
  8822. t.exports = Object.freeze({
  8823. OPENED: "webvr.modal.opened",
  8824. SHOW_TERMS: "webvr.footer.show.terms"
  8825. })
  8826. }
  8827. , {}],
  8828. 89: [function(B, V, e) {
  8829. (function(e) {
  8830. "use strict";
  8831. function a() {
  8832. function t() {
  8833. p.isPresenting || (r.info("exiting webVR"),
  8834. c("webvr_exit_app"),
  8835. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  8836. window.removeEventListener("vrdisplaypresentchange", t))
  8837. }
  8838. r.info("Headset mounted"),
  8839. u.suspend();
  8840. var e = document.createElement("canvas");
  8841. for (e.getContext("webgl"),
  8842. e.className = "webvr-canvas",
  8843. document.bgColor = "#000",
  8844. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  8845. document.body.removeChild(document.body.firstChild);
  8846. document.body.appendChild(e),
  8847. c("webvr_enter_app"),
  8848. p.requestPresent([{
  8849. source: e,
  8850. predistorted: !0
  8851. }]).catch(function(e) {
  8852. r.error("Failed to present: " + e),
  8853. c("webvr_exit_calibrate"),
  8854. t()
  8855. }),
  8856. d.then(function() {
  8857. window.dispatchEvent(new Event("vrapp-start"))
  8858. }),
  8859. window.addEventListener("vrdisplaypresentchange", t)
  8860. }
  8861. function s() {
  8862. c("webvr_modal_close"),
  8863. _.find(".enter-button").off("click", a),
  8864. E.fadeOut(g.guiAnimationSpeed, function() {
  8865. _.toggleClass("hidden", !1),
  8866. b.toggleClass("hidden", !0),
  8867. f.exitFullscreen()
  8868. }),
  8869. I.fadeIn(g.guiAnimationSpeed)
  8870. }
  8871. function t() {
  8872. M.toggleClass("hidden", !0),
  8873. S.toggleClass("hidden", !1)
  8874. }
  8875. function l() {
  8876. _.toggleClass("hidden"),
  8877. b.toggleClass("hidden")
  8878. }
  8879. function c(e) {
  8880. var t = f.isLandscape() ? "landscape" : "portrait";
  8881. i.trackAlways("showcase_gui", {
  8882. gui_action: e,
  8883. orientation: t
  8884. })
  8885. }
  8886. function h() {
  8887. var e = f.isLandscape();
  8888. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  8889. }
  8890. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  8891. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  8892. 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 = {
  8893. init: function(e, t, i, n) {
  8894. function r(e) {
  8895. e.preventDefault(),
  8896. o(e.currentTarget.id)
  8897. }
  8898. function o(i) {
  8899. F[i](),
  8900. Object.keys(F).map(function(e, t) {
  8901. $("#" + e).toggleClass("tabs-underlined", e === i)
  8902. })
  8903. }
  8904. p = i,
  8905. u = t,
  8906. y.init(m.Android, e, n),
  8907. h(),
  8908. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  8909. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  8910. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  8911. w.filter(".device-headset-side").attr("src", R),
  8912. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  8913. $("#vr").on("click", function(e) {
  8914. e.preventDefault(),
  8915. c("click_webvr_button"),
  8916. E.is(":hidden") && (N.emit(A.OPENED),
  8917. I.fadeOut(g.guiAnimationSpeed),
  8918. E.fadeIn(g.guiAnimationSpeed),
  8919. function() {
  8920. if (!d) {
  8921. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  8922. d = new Promise(function(e, t) {
  8923. var i = document.createElement("script");
  8924. i.type = "text/javascript",
  8925. i.src = n,
  8926. i.onload = e,
  8927. document.head.appendChild(i)
  8928. }
  8929. )
  8930. }
  8931. _.find(".enter-button").on("click", a)
  8932. }())
  8933. }),
  8934. $(".webvr-popup .close").on("click", function(e) {
  8935. e.preventDefault(),
  8936. _.hasClass("hidden") ? (c("webvr_help_close"),
  8937. l()) : s()
  8938. }),
  8939. $("#tabcardboard").on("click", r),
  8940. $("#tabdaydream").on("click", r),
  8941. $("#tabnative").on("click", r),
  8942. $(".webvr-popup .open-with-app").on("click", function(e) {
  8943. e.preventDefault(),
  8944. c("webvr_learn_more"),
  8945. o("tabnative"),
  8946. l()
  8947. }),
  8948. $(".webvr-popup .help").on("click", function(e) {
  8949. e.preventDefault(),
  8950. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  8951. l()
  8952. }),
  8953. $(".webvr-popup .terms").on("click", function(e) {
  8954. e.preventDefault(),
  8955. c("webvr_click_terms"),
  8956. s(),
  8957. N.emit(A.SHOW_TERMS)
  8958. }),
  8959. T.on("click", function(e) {
  8960. e.preventDefault(),
  8961. c(D),
  8962. window.open(L, "_blank")
  8963. }),
  8964. x.on("click", function(e) {
  8965. e.preventDefault(),
  8966. c("webvr_phone_link"),
  8967. window.open("https://vr.google.com/daydream/phones/", "_blank")
  8968. }),
  8969. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  8970. e.preventDefault(),
  8971. c("webvr_cardboard_link"),
  8972. y.launch(v.CardboardAndroid)
  8973. }),
  8974. $(".webvr-popup .badge-oculus").on("click", function(e) {
  8975. e.preventDefault(),
  8976. c("webvr_oculus_link"),
  8977. y.launch(v.GearVR)
  8978. })
  8979. }
  8980. }, F = {
  8981. tabcardboard: function() {
  8982. w.filter(".device-headset").attr("src", R),
  8983. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  8984. L = "https://vr.google.com/cardboard/get-cardboard/",
  8985. D = "webvr_cardboard_link",
  8986. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  8987. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  8988. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  8989. t()
  8990. },
  8991. tabdaydream: function() {
  8992. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  8993. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  8994. L = P,
  8995. D = O,
  8996. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  8997. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  8998. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  8999. t()
  9000. },
  9001. tabnative: function() {
  9002. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9003. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9004. M.toggleClass("hidden", !1),
  9005. S.toggleClass("hidden", !0)
  9006. }
  9007. };
  9008. n.extendObject(N, o.prototype),
  9009. $(window).resize(h),
  9010. V.exports = N
  9011. }
  9012. ).call(this, "/js/gui/webvr/webVRgui.js")
  9013. }
  9014. , {
  9015. "../../analytics": 4,
  9016. "../../constants": 8,
  9017. "../../enum/VRApps": 46,
  9018. "../../enum/VRPlatforms": 49,
  9019. "../../localization/localize": 108,
  9020. "../../settings": 166,
  9021. "../../util/browser": 182,
  9022. "../../util/common": 185,
  9023. "../../util/logger": 189,
  9024. "./../gui": 65,
  9025. "./../vr/vrLink": 86,
  9026. "./WebVrEvent": 88,
  9027. events: 202
  9028. }],
  9029. 90: [function(e, t, i) {
  9030. "use strict";
  9031. function n(e, t, i, n, r) {
  9032. this.floorId = n || 0 === n ? n : -1,
  9033. this.roomId = r || "",
  9034. this.labelId = e,
  9035. this.position = (new o.Vector3).copy(t),
  9036. this.text = i
  9037. }
  9038. var o = e("three")
  9039. , r = e("../util/browser");
  9040. n.prototype.build = function() {
  9041. var e = window.document.createElement("div");
  9042. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9043. var t = window.document.createElement("div");
  9044. t.setAttribute("class", "gui-floorplan-label-text");
  9045. var i = window.document.createTextNode(this.text);
  9046. t.appendChild(i),
  9047. e.appendChild(t),
  9048. window.document.body.appendChild(e),
  9049. this.labelGui = e,
  9050. this.textBlock = t,
  9051. $(this.labelGui).hide();
  9052. var n = window.getComputedStyle(this.labelGui);
  9053. this.initialTransform = n.transform || n.webkitTransform
  9054. }
  9055. ,
  9056. t.exports = n
  9057. }
  9058. , {
  9059. "../util/browser": 182,
  9060. three: 217
  9061. }],
  9062. 91: [function(e, t, i) {
  9063. "use strict";
  9064. function n() {
  9065. this.player = null,
  9066. this.modelManager = null,
  9067. this.container = null
  9068. }
  9069. var c, o, r = e("three"), a = (e("../util/common"),
  9070. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9071. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9072. e("../util/transitions"),
  9073. e("../util/lerp"),
  9074. e("../util/browser"));
  9075. n.prototype.init = function(e, t, i) {
  9076. this.player = e,
  9077. this.modelManager = t,
  9078. this.container = i,
  9079. this.updateModel(),
  9080. this.bindEvents()
  9081. }
  9082. ,
  9083. n.prototype.bindEvents = function() {
  9084. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9085. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9086. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9087. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9088. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9089. }
  9090. ,
  9091. n.prototype.updateModel = function() {
  9092. this.model = this.modelManager.getActiveModel()
  9093. }
  9094. ,
  9095. n.prototype.handlePlayerViewChanged = function() {
  9096. this.updateLabelVisibility(),
  9097. this.updateLabelDisplay()
  9098. }
  9099. ,
  9100. n.prototype.getLabelsForFloor = function(t, i) {
  9101. return (i = i || []).length = 0,
  9102. this.model.labels.forEach(function(e) {
  9103. this.labelVisibleForFloor(e, t) && i.push(e)
  9104. }
  9105. .bind(this)),
  9106. i
  9107. }
  9108. ,
  9109. n.prototype.getLabelsForCurrentFloor = function(e) {
  9110. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9111. }
  9112. ,
  9113. n.prototype.labelVisibleForFloor = function(e, t) {
  9114. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9115. if (!this.model.showingLabels || !e.labelGui || !i)
  9116. return !1;
  9117. var n = e.floorId === this.model.floors.size() - 1;
  9118. return this.model.allFloorsVisible ? n : e.floorId === t
  9119. }
  9120. ,
  9121. n.prototype.updateLabelVisibility = function(e) {
  9122. this.model.labels.forEach(function(e) {
  9123. 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)
  9124. }
  9125. .bind(this))
  9126. }
  9127. ,
  9128. n.prototype.showAllLabels = function(t, i) {
  9129. this.model.labels.forEach(function(e) {
  9130. this.showLabel(e, t, i)
  9131. }
  9132. .bind(this))
  9133. }
  9134. ,
  9135. n.prototype.hideAllLabels = function(t, i) {
  9136. this.model.labels.forEach(function(e) {
  9137. this.hideLabel(e, t, i)
  9138. }
  9139. .bind(this))
  9140. }
  9141. ,
  9142. n.prototype.showLabel = function(e, t, i) {
  9143. this.model.showingLabels && (e.visible || (e.visible = !0,
  9144. e.labelGui.style.display = "block",
  9145. e.labelGui.style.opacity = 0,
  9146. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9147. }
  9148. ,
  9149. n.prototype.hideLabel = function(e, t, i) {
  9150. e.visible && (e.visible = !1,
  9151. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9152. }
  9153. ,
  9154. n.prototype.supportedMode = function() {
  9155. return this.player.mode === h.FLOORPLAN
  9156. }
  9157. ,
  9158. n.prototype.updateLabelDisplay = (new r.Vector3,
  9159. new r.Vector3,
  9160. o = [],
  9161. function() {
  9162. var e = this.player.getLabelScaleFactor()
  9163. , t = 1.2 * (1 - e) + .6
  9164. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9165. this.getLabelsForCurrentFloor(o);
  9166. for (var n = 0; n < o.length; n++) {
  9167. var r = o[n];
  9168. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9169. 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)
  9170. }
  9171. }
  9172. ),
  9173. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9174. new r.Vector3,
  9175. function(e, t, i, n, r) {
  9176. t.style.fontSize = 100 * r + "%";
  9177. var o = .5 * $("#player").width()
  9178. , a = .5 * $("#player").height();
  9179. c.copy(i),
  9180. c.project(this.player.camera);
  9181. var s = c.x * o + o
  9182. , l = -c.y * a + a;
  9183. s -= e.offsetWidth / 2,
  9184. l -= e.offsetHeight / 2,
  9185. e.style.left = s + "px",
  9186. e.style.top = l + "px"
  9187. }
  9188. ),
  9189. n.prototype.handleStartInside = function(e) {
  9190. this.updateLabelVisibility()
  9191. }
  9192. ,
  9193. n.prototype.handleStartOutside = function() {
  9194. this.updateLabelVisibility()
  9195. }
  9196. ,
  9197. t.exports = n
  9198. }
  9199. , {
  9200. "../enum/DirectorEvents": 23,
  9201. "../enum/ModelManagerEvents": 33,
  9202. "../enum/PlayerEvents": 40,
  9203. "../enum/Viewmode": 51,
  9204. "../enum/WarpStyle": 52,
  9205. "../settings": 166,
  9206. "../util/browser": 182,
  9207. "../util/common": 185,
  9208. "../util/lerp": 188,
  9209. "../util/transitions": 195,
  9210. three: 217
  9211. }],
  9212. 92: [function(e, t, i) {
  9213. "use strict";
  9214. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9215. if (null == this)
  9216. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9217. if ("function" != typeof e)
  9218. throw new TypeError("predicate must be a function");
  9219. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9220. if (t = i[o],
  9221. e.call(r, t, o, i))
  9222. return o;
  9223. return -1
  9224. }
  9225. ),
  9226. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9227. value: function(e) {
  9228. if (null == this)
  9229. throw new TypeError('"this" is null or not defined');
  9230. var t = Object(this)
  9231. , i = t.length >>> 0;
  9232. if ("function" != typeof e)
  9233. throw new TypeError("predicate must be a function");
  9234. for (var n = arguments[1], r = 0; r < i; ) {
  9235. var o = t[r];
  9236. if (e.call(n, o, r, t))
  9237. return o;
  9238. r++
  9239. }
  9240. }
  9241. })
  9242. }
  9243. , {}],
  9244. 93: [function(e, t, i) {
  9245. "use strict";
  9246. 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 || {};
  9247. function te() {
  9248. this.backgroundElement = document.createElement("div"),
  9249. r.extend(this.backgroundElement.style, {
  9250. backgroundColor: "rgba(0,0,0,0.8)",
  9251. top: 0,
  9252. left: 0,
  9253. display: "none",
  9254. zIndex: "1000",
  9255. opacity: 0,
  9256. WebkitTransition: "opacity 0.2s linear"
  9257. }),
  9258. n.makeFullscreen(this.backgroundElement),
  9259. this.backgroundElement.style.position = "fixed",
  9260. this.domElement = document.createElement("div"),
  9261. r.extend(this.domElement.style, {
  9262. position: "fixed",
  9263. display: "none",
  9264. zIndex: "1001",
  9265. opacity: 0,
  9266. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9267. }),
  9268. document.body.appendChild(this.backgroundElement),
  9269. document.body.appendChild(this.domElement);
  9270. var e = this;
  9271. n.bind(this.backgroundElement, "click", function() {
  9272. e.hide()
  9273. })
  9274. }
  9275. function ie(e, t, i) {
  9276. Object.defineProperty(e, t, {
  9277. get: function() {
  9278. return "RGB" === this.__state.space || re(this, t, i),
  9279. this.__state[t]
  9280. },
  9281. set: function(e) {
  9282. "RGB" !== this.__state.space && (re(this, t, i),
  9283. this.__state.space = "RGB"),
  9284. this.__state[t] = e
  9285. }
  9286. })
  9287. }
  9288. function ne(e, t) {
  9289. Object.defineProperty(e, t, {
  9290. get: function() {
  9291. return "HSV" === this.__state.space || oe(this),
  9292. this.__state[t]
  9293. },
  9294. set: function(e) {
  9295. "HSV" !== this.__state.space && (oe(this),
  9296. this.__state.space = "HSV"),
  9297. this.__state[t] = e
  9298. }
  9299. })
  9300. }
  9301. function re(e, t, i) {
  9302. if ("HEX" === e.__state.space)
  9303. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9304. else {
  9305. if ("HSV" !== e.__state.space)
  9306. throw "Corrupted color state";
  9307. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9308. }
  9309. }
  9310. function oe(e) {
  9311. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9312. l.extend(e.__state, {
  9313. s: t.s,
  9314. v: t.v
  9315. }),
  9316. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9317. }
  9318. function ae() {
  9319. if (this.__state = o.apply(this, arguments),
  9320. !1 === this.__state)
  9321. throw "Failed to interpret color arguments";
  9322. this.__state.a = this.__state.a || 1
  9323. }
  9324. function se(e) {
  9325. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9326. }
  9327. function le(e, t) {
  9328. this.initialValue = e[t],
  9329. this.domElement = document.createElement("div"),
  9330. this.object = e,
  9331. this.property = t,
  9332. this.__onChange = void 0,
  9333. this.__onFinishChange = void 0
  9334. }
  9335. (t.exports = ee).gui = ee.gui || {},
  9336. ee.utils = ee.utils || {},
  9337. ee.controllers = ee.controllers || {},
  9338. ee.dom = ee.dom || {},
  9339. ee.color = ee.color || {},
  9340. ee.utils.css = {
  9341. load: function(e, t) {
  9342. var i = (t = t || document).createElement("link");
  9343. i.type = "text/css",
  9344. i.rel = "stylesheet",
  9345. i.href = e,
  9346. t.getElementsByTagName("head")[0].appendChild(i)
  9347. },
  9348. inject: function(e, t) {
  9349. t = t || document;
  9350. var i = document.createElement("style");
  9351. i.type = "text/css",
  9352. i.innerHTML = e,
  9353. t.getElementsByTagName("head")[0].appendChild(i)
  9354. }
  9355. },
  9356. ee.utils.common = (Q = Array.prototype.forEach,
  9357. J = Array.prototype.slice,
  9358. {
  9359. BREAK: {},
  9360. extend: function(i) {
  9361. return this.each(J.call(arguments, 1), function(e) {
  9362. for (var t in e)
  9363. this.isUndefined(e[t]) || (i[t] = e[t])
  9364. }, this),
  9365. i
  9366. },
  9367. defaults: function(i) {
  9368. return this.each(J.call(arguments, 1), function(e) {
  9369. for (var t in e)
  9370. this.isUndefined(i[t]) && (i[t] = e[t])
  9371. }, this),
  9372. i
  9373. },
  9374. compose: function() {
  9375. var i = J.call(arguments);
  9376. return function() {
  9377. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9378. e = [i[t].apply(this, e)];
  9379. return e[0]
  9380. }
  9381. },
  9382. each: function(e, t, i) {
  9383. if (e)
  9384. if (Q && e.forEach && e.forEach === Q)
  9385. e.forEach(t, i);
  9386. else if (e.length === e.length + 0) {
  9387. for (var n = 0, r = e.length; n < r; n++)
  9388. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9389. return
  9390. } else
  9391. for (var n in e)
  9392. if (t.call(i, e[n], n) === this.BREAK)
  9393. return
  9394. },
  9395. defer: function(e) {
  9396. setTimeout(e, 0)
  9397. },
  9398. toArray: function(e) {
  9399. return e.toArray ? e.toArray() : J.call(e)
  9400. },
  9401. isUndefined: function(e) {
  9402. return void 0 === e
  9403. },
  9404. isNull: function(e) {
  9405. return null === e
  9406. },
  9407. isNaN: function(e) {
  9408. return e != e
  9409. },
  9410. isArray: Array.isArray || function(e) {
  9411. return e.constructor === Array
  9412. }
  9413. ,
  9414. isObject: function(e) {
  9415. return e === Object(e)
  9416. },
  9417. isNumber: function(e) {
  9418. return e === e + 0
  9419. },
  9420. isString: function(e) {
  9421. return e === e + ""
  9422. },
  9423. isBoolean: function(e) {
  9424. return !1 === e || !0 === e
  9425. },
  9426. isFunction: function(e) {
  9427. return "[object Function]" === Object.prototype.toString.call(e)
  9428. }
  9429. }),
  9430. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9431. onChange: function(e) {
  9432. return this.__onChange = e,
  9433. this
  9434. },
  9435. onFinishChange: function(e) {
  9436. return this.__onFinishChange = e,
  9437. this
  9438. },
  9439. setValue: function(e) {
  9440. return this.object[this.property] = e,
  9441. this.__onChange && this.__onChange.call(this, e),
  9442. this.updateDisplay(),
  9443. this
  9444. },
  9445. getValue: function() {
  9446. return this.object[this.property]
  9447. },
  9448. updateDisplay: function() {
  9449. return this
  9450. },
  9451. isModified: function() {
  9452. return this.initialValue !== this.getValue()
  9453. }
  9454. }),
  9455. le),
  9456. ee.dom.dom = function(c) {
  9457. function i(e) {
  9458. if ("0" === e || c.isUndefined(e))
  9459. return 0;
  9460. var t = e.match(n);
  9461. return c.isNull(t) ? 0 : parseFloat(t[1])
  9462. }
  9463. var h = {};
  9464. c.each({
  9465. HTMLEvents: ["change"],
  9466. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9467. KeyboardEvents: ["keydown"]
  9468. }, function(e, t) {
  9469. c.each(e, function(e) {
  9470. h[e] = t
  9471. })
  9472. });
  9473. var n = /(\d+(\.\d+)?)px/
  9474. , r = {
  9475. makeSelectable: function(e, t) {
  9476. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9477. return !1
  9478. }
  9479. : function() {}
  9480. ,
  9481. e.style.MozUserSelect = t ? "auto" : "none",
  9482. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9483. e.unselectable = t ? "on" : "off")
  9484. },
  9485. makeFullscreen: function(e, t, i) {
  9486. c.isUndefined(t) && (t = !0),
  9487. c.isUndefined(i) && (i = !0),
  9488. e.style.position = "absolute",
  9489. t && (e.style.left = 0,
  9490. e.style.right = 0),
  9491. i && (e.style.top = 0,
  9492. e.style.bottom = 0)
  9493. },
  9494. fakeEvent: function(e, t, i, n) {
  9495. i = i || {};
  9496. var r = h[t];
  9497. if (!r)
  9498. throw new Error("Event type " + t + " not supported.");
  9499. var o = document.createEvent(r);
  9500. switch (r) {
  9501. case "MouseEvents":
  9502. var a = i.x || i.clientX || 0
  9503. , s = i.y || i.clientY || 0;
  9504. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9505. break;
  9506. case "KeyboardEvents":
  9507. var l = o.initKeyboardEvent || o.initKeyEvent;
  9508. c.defaults(i, {
  9509. cancelable: !0,
  9510. ctrlKey: !1,
  9511. altKey: !1,
  9512. shiftKey: !1,
  9513. metaKey: !1,
  9514. keyCode: void 0,
  9515. charCode: void 0
  9516. }),
  9517. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9518. break;
  9519. default:
  9520. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9521. }
  9522. c.defaults(o, n),
  9523. e.dispatchEvent(o)
  9524. },
  9525. bind: function(e, t, i, n) {
  9526. return n = n || !1,
  9527. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9528. r
  9529. },
  9530. unbind: function(e, t, i, n) {
  9531. return n = n || !1,
  9532. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9533. r
  9534. },
  9535. addClass: function(e, t) {
  9536. if (void 0 === e.className)
  9537. e.className = t;
  9538. else if (e.className !== t) {
  9539. var i = e.className.split(/ +/);
  9540. -1 == i.indexOf(t) && (i.push(t),
  9541. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9542. }
  9543. return r
  9544. },
  9545. removeClass: function(e, t) {
  9546. if (t)
  9547. if (void 0 === e.className)
  9548. ;
  9549. else if (e.className === t)
  9550. e.removeAttribute("class");
  9551. else {
  9552. var i = e.className.split(/ +/)
  9553. , n = i.indexOf(t);
  9554. -1 != n && (i.splice(n, 1),
  9555. e.className = i.join(" "))
  9556. }
  9557. else
  9558. e.className = void 0;
  9559. return r
  9560. },
  9561. hasClass: function(e, t) {
  9562. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9563. },
  9564. getWidth: function(e) {
  9565. var t = getComputedStyle(e);
  9566. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9567. },
  9568. getHeight: function(e) {
  9569. var t = getComputedStyle(e);
  9570. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9571. },
  9572. getOffset: function(e) {
  9573. var t = {
  9574. left: 0,
  9575. top: 0
  9576. };
  9577. if (e.offsetParent)
  9578. for (; t.left += e.offsetLeft,
  9579. t.top += e.offsetTop,
  9580. e = e.offsetParent; )
  9581. ;
  9582. return t
  9583. },
  9584. isActive: function(e) {
  9585. return e === document.activeElement && (e.type || e.href)
  9586. }
  9587. };
  9588. return r
  9589. }(ee.utils.common),
  9590. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9591. X = ee.dom.dom,
  9592. Z = ee.utils.common,
  9593. (K = function(e, t, i) {
  9594. K.superclass.call(this, e, t);
  9595. var n = this;
  9596. if (this.__select = document.createElement("select"),
  9597. Z.isArray(i)) {
  9598. var r = {};
  9599. Z.each(i, function(e) {
  9600. r[e] = e
  9601. }),
  9602. i = r
  9603. }
  9604. Z.each(i, function(e, t) {
  9605. var i = document.createElement("option");
  9606. i.innerHTML = t,
  9607. i.setAttribute("value", e),
  9608. n.__select.appendChild(i)
  9609. }),
  9610. this.updateDisplay(),
  9611. X.bind(this.__select, "change", function() {
  9612. var e = this.options[this.selectedIndex].value;
  9613. n.setValue(e)
  9614. }),
  9615. this.domElement.appendChild(this.__select)
  9616. }
  9617. ).superclass = q,
  9618. Z.extend(K.prototype, q.prototype, {
  9619. setValue: function(e) {
  9620. var t = K.superclass.prototype.setValue.call(this, e);
  9621. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9622. t
  9623. },
  9624. updateDisplay: function() {
  9625. return this.__select.value = this.getValue(),
  9626. K.superclass.prototype.updateDisplay.call(this)
  9627. }
  9628. }),
  9629. K),
  9630. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9631. j = ee.utils.common,
  9632. (Y = function(e, t, i) {
  9633. Y.superclass.call(this, e, t),
  9634. i = i || {},
  9635. this.__min = i.min,
  9636. this.__max = i.max,
  9637. this.__step = i.step,
  9638. 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,
  9639. this.__precision = se(this.__impliedStep)
  9640. }
  9641. ).superclass = W,
  9642. j.extend(Y.prototype, W.prototype, {
  9643. setValue: function(e) {
  9644. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9645. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9646. Y.superclass.prototype.setValue.call(this, e)
  9647. },
  9648. min: function(e) {
  9649. return this.__min = e,
  9650. this
  9651. },
  9652. max: function(e) {
  9653. return this.__max = e,
  9654. this
  9655. },
  9656. step: function(e) {
  9657. return this.__step = e,
  9658. this.__impliedStep = e,
  9659. this.__precision = se(e),
  9660. this
  9661. }
  9662. }),
  9663. Y),
  9664. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9665. H = ee.dom.dom,
  9666. z = ee.utils.common,
  9667. (G = function(e, t, i) {
  9668. function n() {
  9669. var e = parseFloat(s.__input.value);
  9670. z.isNaN(e) || s.setValue(e)
  9671. }
  9672. function r(e) {
  9673. var t = a - e.clientY;
  9674. s.setValue(s.getValue() + t * s.__impliedStep),
  9675. a = e.clientY
  9676. }
  9677. function o() {
  9678. H.unbind(window, "mousemove", r),
  9679. H.unbind(window, "mouseup", o)
  9680. }
  9681. this.__truncationSuspended = !1,
  9682. G.superclass.call(this, e, t, i);
  9683. var a, s = this;
  9684. this.__input = document.createElement("input"),
  9685. this.__input.setAttribute("type", "text"),
  9686. H.bind(this.__input, "change", n),
  9687. H.bind(this.__input, "blur", function() {
  9688. n(),
  9689. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9690. }),
  9691. H.bind(this.__input, "mousedown", function(e) {
  9692. H.bind(window, "mousemove", r),
  9693. H.bind(window, "mouseup", o),
  9694. a = e.clientY
  9695. }),
  9696. H.bind(this.__input, "keydown", function(e) {
  9697. 13 === e.keyCode && (s.__truncationSuspended = !0,
  9698. this.blur(),
  9699. s.__truncationSuspended = !1)
  9700. }),
  9701. this.updateDisplay(),
  9702. this.domElement.appendChild(this.__input)
  9703. }
  9704. ).superclass = U,
  9705. z.extend(G.prototype, U.prototype, {
  9706. updateDisplay: function() {
  9707. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  9708. var i = Math.pow(10, t);
  9709. return Math.round(e * i) / i
  9710. }(this.getValue(), this.__precision),
  9711. G.superclass.prototype.updateDisplay.call(this)
  9712. }
  9713. }),
  9714. G),
  9715. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  9716. F = ee.dom.dom,
  9717. B = ee.utils.css,
  9718. V = ee.utils.common,
  9719. (k = function(e, t, i, n, r) {
  9720. function o(e) {
  9721. e.preventDefault();
  9722. var t = F.getOffset(s.__background)
  9723. , i = F.getWidth(s.__background);
  9724. return s.setValue(function(e, t, i, n, r) {
  9725. return n + (e - t) / (i - t) * (r - n)
  9726. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  9727. !1
  9728. }
  9729. function a() {
  9730. F.unbind(window, "mousemove", o),
  9731. F.unbind(window, "mouseup", a),
  9732. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9733. }
  9734. k.superclass.call(this, e, t, {
  9735. min: i,
  9736. max: n,
  9737. step: r
  9738. });
  9739. var s = this;
  9740. this.__background = document.createElement("div"),
  9741. this.__foreground = document.createElement("div"),
  9742. F.bind(this.__background, "mousedown", function(e) {
  9743. F.bind(window, "mousemove", o),
  9744. F.bind(window, "mouseup", a),
  9745. o(e)
  9746. }),
  9747. F.addClass(this.__background, "slider"),
  9748. F.addClass(this.__foreground, "slider-fg"),
  9749. this.updateDisplay(),
  9750. this.__background.appendChild(this.__foreground),
  9751. this.domElement.appendChild(this.__background)
  9752. }
  9753. ).superclass = N,
  9754. k.useDefaultStyles = function() {
  9755. 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}")
  9756. }
  9757. ,
  9758. V.extend(k.prototype, N.prototype, {
  9759. updateDisplay: function() {
  9760. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9761. return this.__foreground.style.width = 100 * e + "%",
  9762. k.superclass.prototype.updateDisplay.call(this)
  9763. }
  9764. }),
  9765. k),
  9766. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  9767. O = ee.dom.dom,
  9768. L = ee.utils.common,
  9769. (D = function(e, t, i) {
  9770. D.superclass.call(this, e, t);
  9771. var n = this;
  9772. this.__button = document.createElement("div"),
  9773. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  9774. O.bind(this.__button, "click", function(e) {
  9775. return e.preventDefault(),
  9776. n.fire(),
  9777. !1
  9778. }),
  9779. O.addClass(this.__button, "button"),
  9780. this.domElement.appendChild(this.__button)
  9781. }
  9782. ).superclass = P,
  9783. L.extend(D.prototype, P.prototype, {
  9784. fire: function() {
  9785. this.__onChange && this.__onChange.call(this),
  9786. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9787. this.getValue().call(this.object)
  9788. }
  9789. }),
  9790. D),
  9791. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  9792. S = ee.dom.dom,
  9793. M = ee.utils.common,
  9794. (R = function(e, t) {
  9795. R.superclass.call(this, e, t);
  9796. var i = this;
  9797. this.__prev = this.getValue(),
  9798. this.__checkbox = document.createElement("input"),
  9799. this.__checkbox.setAttribute("type", "checkbox"),
  9800. S.bind(this.__checkbox, "change", function() {
  9801. i.setValue(!i.__prev)
  9802. }, !1),
  9803. this.domElement.appendChild(this.__checkbox),
  9804. this.updateDisplay()
  9805. }
  9806. ).superclass = x,
  9807. M.extend(R.prototype, x.prototype, {
  9808. setValue: function(e) {
  9809. var t = R.superclass.prototype.setValue.call(this, e);
  9810. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9811. this.__prev = this.getValue(),
  9812. t
  9813. },
  9814. updateDisplay: function() {
  9815. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  9816. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  9817. R.superclass.prototype.updateDisplay.call(this)
  9818. }
  9819. }),
  9820. R),
  9821. ee.color.toString = (T = ee.utils.common,
  9822. function(e) {
  9823. if (1 == e.a || T.isUndefined(e.a)) {
  9824. for (var t = e.hex.toString(16); t.length < 6; )
  9825. t = "0" + t;
  9826. return "#" + t
  9827. }
  9828. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  9829. }
  9830. ),
  9831. ee.color.interpret = (I = ee.color.toString,
  9832. E = ee.utils.common,
  9833. w = [{
  9834. litmus: E.isString,
  9835. conversions: {
  9836. THREE_CHAR_HEX: {
  9837. read: function(e) {
  9838. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  9839. return null !== t && {
  9840. space: "HEX",
  9841. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  9842. }
  9843. },
  9844. write: I
  9845. },
  9846. SIX_CHAR_HEX: {
  9847. read: function(e) {
  9848. var t = e.match(/^#([A-F0-9]{6})$/i);
  9849. return null !== t && {
  9850. space: "HEX",
  9851. hex: parseInt("0x" + t[1].toString())
  9852. }
  9853. },
  9854. write: I
  9855. },
  9856. CSS_RGB: {
  9857. read: function(e) {
  9858. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  9859. return null !== t && {
  9860. space: "RGB",
  9861. r: parseFloat(t[1]),
  9862. g: parseFloat(t[2]),
  9863. b: parseFloat(t[3])
  9864. }
  9865. },
  9866. write: I
  9867. },
  9868. CSS_RGBA: {
  9869. read: function(e) {
  9870. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  9871. return null !== t && {
  9872. space: "RGB",
  9873. r: parseFloat(t[1]),
  9874. g: parseFloat(t[2]),
  9875. b: parseFloat(t[3]),
  9876. a: parseFloat(t[4])
  9877. }
  9878. },
  9879. write: I
  9880. }
  9881. }
  9882. }, {
  9883. litmus: E.isNumber,
  9884. conversions: {
  9885. HEX: {
  9886. read: function(e) {
  9887. return {
  9888. space: "HEX",
  9889. hex: e,
  9890. conversionName: "HEX"
  9891. }
  9892. },
  9893. write: function(e) {
  9894. return e.hex
  9895. }
  9896. }
  9897. }
  9898. }, {
  9899. litmus: E.isArray,
  9900. conversions: {
  9901. RGB_ARRAY: {
  9902. read: function(e) {
  9903. return 3 == e.length && {
  9904. space: "RGB",
  9905. r: e[0],
  9906. g: e[1],
  9907. b: e[2]
  9908. }
  9909. },
  9910. write: function(e) {
  9911. return [e.r, e.g, e.b]
  9912. }
  9913. },
  9914. RGBA_ARRAY: {
  9915. read: function(e) {
  9916. return 4 == e.length && {
  9917. space: "RGB",
  9918. r: e[0],
  9919. g: e[1],
  9920. b: e[2],
  9921. a: e[3]
  9922. }
  9923. },
  9924. write: function(e) {
  9925. return [e.r, e.g, e.b, e.a]
  9926. }
  9927. }
  9928. }
  9929. }, {
  9930. litmus: E.isObject,
  9931. conversions: {
  9932. RGBA_OBJ: {
  9933. read: function(e) {
  9934. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  9935. space: "RGB",
  9936. r: e.r,
  9937. g: e.g,
  9938. b: e.b,
  9939. a: e.a
  9940. }
  9941. },
  9942. write: function(e) {
  9943. return {
  9944. r: e.r,
  9945. g: e.g,
  9946. b: e.b,
  9947. a: e.a
  9948. }
  9949. }
  9950. },
  9951. RGB_OBJ: {
  9952. read: function(e) {
  9953. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  9954. space: "RGB",
  9955. r: e.r,
  9956. g: e.g,
  9957. b: e.b
  9958. }
  9959. },
  9960. write: function(e) {
  9961. return {
  9962. r: e.r,
  9963. g: e.g,
  9964. b: e.b
  9965. }
  9966. }
  9967. },
  9968. HSVA_OBJ: {
  9969. read: function(e) {
  9970. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  9971. space: "HSV",
  9972. h: e.h,
  9973. s: e.s,
  9974. v: e.v,
  9975. a: e.a
  9976. }
  9977. },
  9978. write: function(e) {
  9979. return {
  9980. h: e.h,
  9981. s: e.s,
  9982. v: e.v,
  9983. a: e.a
  9984. }
  9985. }
  9986. },
  9987. HSV_OBJ: {
  9988. read: function(e) {
  9989. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  9990. space: "HSV",
  9991. h: e.h,
  9992. s: e.s,
  9993. v: e.v
  9994. }
  9995. },
  9996. write: function(e) {
  9997. return {
  9998. h: e.h,
  9999. s: e.s,
  10000. v: e.v
  10001. }
  10002. }
  10003. }
  10004. }
  10005. }],
  10006. function() {
  10007. b = !1;
  10008. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10009. return E.each(w, function(e) {
  10010. if (e.litmus(i))
  10011. return E.each(e.conversions, function(e, t) {
  10012. if (_ = e.read(i),
  10013. !1 === b && !1 !== _)
  10014. return (b = _).conversionName = t,
  10015. _.conversion = e,
  10016. E.BREAK
  10017. }),
  10018. E.BREAK
  10019. }),
  10020. b
  10021. }
  10022. ),
  10023. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10024. function y(e, t, i, n) {
  10025. if (void 0 === t[i])
  10026. throw new Error("Object " + t + ' has no property "' + i + '"');
  10027. var r;
  10028. if (n.color)
  10029. r = new g(t,i);
  10030. else {
  10031. var o = [t, i].concat(n.factoryArgs);
  10032. r = c.apply(e, o)
  10033. }
  10034. n.before instanceof h && (n.before = n.before.__li),
  10035. C(e, r),
  10036. m.addClass(r.domElement, "c");
  10037. var a = document.createElement("span");
  10038. m.addClass(a, "property-name"),
  10039. a.innerHTML = r.property;
  10040. var s = document.createElement("div");
  10041. s.appendChild(a),
  10042. s.appendChild(r.domElement);
  10043. var l = A(e, s, n.before);
  10044. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10045. m.addClass(l, typeof r.getValue()),
  10046. function(t, i, n) {
  10047. if (n.__li = i,
  10048. n.__gui = t,
  10049. v.extend(n, {
  10050. options: function(e) {
  10051. return 1 < arguments.length ? (n.remove(),
  10052. y(t, n.object, n.property, {
  10053. before: n.__li.nextElementSibling,
  10054. factoryArgs: [v.toArray(arguments)]
  10055. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10056. y(t, n.object, n.property, {
  10057. before: n.__li.nextElementSibling,
  10058. factoryArgs: [e]
  10059. })) : void 0
  10060. },
  10061. name: function(e) {
  10062. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10063. n
  10064. },
  10065. listen: function() {
  10066. return n.__gui.listen(n),
  10067. n
  10068. },
  10069. remove: function() {
  10070. return n.__gui.remove(n),
  10071. n
  10072. }
  10073. }),
  10074. n instanceof f) {
  10075. var r = new p(n.object,n.property,{
  10076. min: n.__min,
  10077. max: n.__max,
  10078. step: n.__step
  10079. });
  10080. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10081. var t = n[e]
  10082. , i = r[e];
  10083. n[e] = r[e] = function() {
  10084. var e = Array.prototype.slice.call(arguments);
  10085. return t.apply(n, e),
  10086. i.apply(r, e)
  10087. }
  10088. }),
  10089. m.addClass(i, "has-slider"),
  10090. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10091. } else if (n instanceof p) {
  10092. var e = function(e) {
  10093. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10094. y(t, n.object, n.property, {
  10095. before: n.__li.nextElementSibling,
  10096. factoryArgs: [n.__min, n.__max, n.__step]
  10097. })) : e
  10098. };
  10099. n.min = v.compose(e, n.min),
  10100. n.max = v.compose(e, n.max)
  10101. } else
  10102. n instanceof u ? (m.bind(i, "click", function() {
  10103. m.fakeEvent(n.__checkbox, "click")
  10104. }),
  10105. m.bind(n.__checkbox, "click", function(e) {
  10106. e.stopPropagation()
  10107. })) : n instanceof d ? (m.bind(i, "click", function() {
  10108. m.fakeEvent(n.__button, "click")
  10109. }),
  10110. m.bind(i, "mouseover", function() {
  10111. m.addClass(n.__button, "hover")
  10112. }),
  10113. m.bind(i, "mouseout", function() {
  10114. m.removeClass(n.__button, "hover")
  10115. })) : n instanceof g && (m.addClass(i, "color"),
  10116. n.updateDisplay = v.compose(function(e) {
  10117. return i.style.borderLeftColor = n.__color.toString(),
  10118. e
  10119. }, n.updateDisplay),
  10120. n.updateDisplay());
  10121. n.setValue = v.compose(function(e) {
  10122. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10123. e
  10124. }, n.setValue)
  10125. }(e, l, r),
  10126. e.__controllers.push(r),
  10127. r
  10128. }
  10129. function A(e, t, i) {
  10130. var n = document.createElement("li");
  10131. return t && n.appendChild(t),
  10132. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10133. e.onResize(),
  10134. n
  10135. }
  10136. function C(e, t) {
  10137. var i = e.getRoot()
  10138. , n = i.__rememberedObjects.indexOf(t.object);
  10139. if (-1 != n) {
  10140. var r = i.__rememberedObjectIndecesToControllers[n];
  10141. if (void 0 === r && (r = {},
  10142. i.__rememberedObjectIndecesToControllers[n] = r),
  10143. r[t.property] = t,
  10144. i.load && i.load.remembered) {
  10145. var o, a = i.load.remembered;
  10146. if (a[e.preset])
  10147. o = a[e.preset];
  10148. else {
  10149. if (!a[T])
  10150. return;
  10151. o = a[T]
  10152. }
  10153. if (o[n] && void 0 !== o[n][t.property]) {
  10154. var s = o[n][t.property];
  10155. t.initialValue = s,
  10156. t.setValue(s)
  10157. }
  10158. }
  10159. }
  10160. }
  10161. function I(e, t) {
  10162. return document.location.href + "." + t
  10163. }
  10164. function l(e, t) {
  10165. e.domElement.style.width = t + "px",
  10166. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10167. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10168. }
  10169. function a(r, o) {
  10170. var a = {};
  10171. return v.each(r.__rememberedObjects, function(e, t) {
  10172. var i = {}
  10173. , n = r.__rememberedObjectIndecesToControllers[t];
  10174. v.each(n, function(e, t) {
  10175. i[t] = o ? e.initialValue : e.getValue()
  10176. }),
  10177. a[t] = i
  10178. }),
  10179. a
  10180. }
  10181. function E(e, t, i) {
  10182. var n = document.createElement("option");
  10183. n.innerHTML = t,
  10184. n.value = t,
  10185. e.__preset_select.appendChild(n),
  10186. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10187. }
  10188. function _(e, t) {
  10189. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10190. i.innerHTML = t ? i.value + "*" : i.value
  10191. }
  10192. 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");
  10193. var b, w, T = "Default", x = function() {
  10194. try {
  10195. return "localStorage"in window && null !== window.localStorage
  10196. } catch (e) {
  10197. return !1
  10198. }
  10199. }(), S = !0, s = !1, M = [], R = function(t) {
  10200. var i = this;
  10201. this.domElement = document.createElement("div"),
  10202. this.__ul = document.createElement("ul"),
  10203. this.domElement.appendChild(this.__ul),
  10204. m.addClass(this.domElement, "dg"),
  10205. this.__folders = {},
  10206. this.__controllers = [],
  10207. this.__rememberedObjects = [],
  10208. this.__rememberedObjectIndecesToControllers = [],
  10209. this.__listening = [],
  10210. t = t || {},
  10211. t = v.defaults(t, {
  10212. autoPlace: !0,
  10213. width: R.DEFAULT_WIDTH
  10214. }),
  10215. t = v.defaults(t, {
  10216. resizable: t.autoPlace,
  10217. hideable: t.autoPlace
  10218. }),
  10219. v.isUndefined(t.load) ? t.load = {
  10220. preset: T
  10221. } : t.preset && (t.load.preset = t.preset),
  10222. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10223. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10224. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10225. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10226. if (Object.defineProperties(this, {
  10227. parent: {
  10228. get: function() {
  10229. return t.parent
  10230. }
  10231. },
  10232. scrollable: {
  10233. get: function() {
  10234. return t.scrollable
  10235. }
  10236. },
  10237. autoPlace: {
  10238. get: function() {
  10239. return t.autoPlace
  10240. }
  10241. },
  10242. preset: {
  10243. get: function() {
  10244. return i.parent ? i.getRoot().preset : t.load.preset
  10245. },
  10246. set: function(e) {
  10247. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10248. function(e) {
  10249. for (var t = 0; t < e.__preset_select.length; t++)
  10250. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10251. }(this),
  10252. i.revert()
  10253. }
  10254. },
  10255. width: {
  10256. get: function() {
  10257. return t.width
  10258. },
  10259. set: function(e) {
  10260. t.width = e,
  10261. l(i, e)
  10262. }
  10263. },
  10264. name: {
  10265. get: function() {
  10266. return t.name
  10267. },
  10268. set: function(e) {
  10269. t.name = e,
  10270. a && (a.innerHTML = t.name)
  10271. }
  10272. },
  10273. closed: {
  10274. get: function() {
  10275. return t.closed
  10276. },
  10277. set: function(e) {
  10278. t.closed = e,
  10279. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10280. this.onResize(),
  10281. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10282. }
  10283. },
  10284. load: {
  10285. get: function() {
  10286. return t.load
  10287. }
  10288. },
  10289. useLocalStorage: {
  10290. get: function() {
  10291. return r
  10292. },
  10293. set: function(e) {
  10294. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10295. localStorage.setItem(I(0, "isLocal"), e))
  10296. }
  10297. }
  10298. }),
  10299. v.isUndefined(t.parent)) {
  10300. if (t.closed = !1,
  10301. m.addClass(this.domElement, R.CLASS_MAIN),
  10302. m.makeSelectable(this.domElement, !1),
  10303. x && r) {
  10304. i.useLocalStorage = !0;
  10305. var o = localStorage.getItem(I(0, "gui"));
  10306. o && (t.load = JSON.parse(o))
  10307. }
  10308. this.__closeButton = document.createElement("div"),
  10309. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10310. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10311. this.domElement.appendChild(this.__closeButton),
  10312. m.bind(this.__closeButton, "click", function() {
  10313. i.closed = !i.closed
  10314. })
  10315. } else {
  10316. void 0 === t.closed && (t.closed = !0);
  10317. var a = document.createTextNode(t.name);
  10318. m.addClass(a, "controller-name");
  10319. var s = A(i, a);
  10320. m.addClass(this.__ul, R.CLASS_CLOSED),
  10321. m.addClass(s, "title"),
  10322. m.bind(s, "click", function(e) {
  10323. return e.preventDefault(),
  10324. i.closed = !i.closed,
  10325. !1
  10326. }),
  10327. t.closed || (this.closed = !1)
  10328. }
  10329. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10330. m.addClass(w, "dg"),
  10331. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10332. document.body.appendChild(w),
  10333. S = !1),
  10334. w.appendChild(this.domElement),
  10335. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10336. this.parent || l(i, t.width)),
  10337. m.bind(window, "resize", function() {
  10338. i.onResize()
  10339. }),
  10340. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10341. i.onResize()
  10342. }),
  10343. m.bind(this.__ul, "transitionend", function() {
  10344. i.onResize()
  10345. }),
  10346. m.bind(this.__ul, "oTransitionEnd", function() {
  10347. i.onResize()
  10348. }),
  10349. this.onResize(),
  10350. t.resizable && function(t) {
  10351. function e(e) {
  10352. return e.preventDefault(),
  10353. r = e.clientX,
  10354. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10355. m.bind(window, "mousemove", i),
  10356. m.bind(window, "mouseup", n),
  10357. !1
  10358. }
  10359. function i(e) {
  10360. return e.preventDefault(),
  10361. t.width += r - e.clientX,
  10362. t.onResize(),
  10363. r = e.clientX,
  10364. !1
  10365. }
  10366. function n() {
  10367. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10368. m.unbind(window, "mousemove", i),
  10369. m.unbind(window, "mouseup", n)
  10370. }
  10371. var r;
  10372. t.__resize_handle = document.createElement("div"),
  10373. v.extend(t.__resize_handle.style, {
  10374. width: "6px",
  10375. marginLeft: "-3px",
  10376. height: "200px",
  10377. cursor: "ew-resize",
  10378. position: "absolute"
  10379. }),
  10380. m.bind(t.__resize_handle, "mousedown", e),
  10381. m.bind(t.__closeButton, "mousedown", e),
  10382. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10383. }(this),
  10384. n = function() {
  10385. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10386. }
  10387. ,
  10388. this.saveToLocalStorageIfPossible = n,
  10389. i.getRoot(),
  10390. t.parent || ((e = i.getRoot()).width += 1,
  10391. v.defer(function() {
  10392. e.width -= 1
  10393. }))
  10394. };
  10395. return R.toggleHide = function() {
  10396. s = !s,
  10397. v.each(M, function(e) {
  10398. e.domElement.style.zIndex = s ? -999 : 999,
  10399. e.domElement.style.opacity = s ? 0 : 1
  10400. })
  10401. }
  10402. ,
  10403. R.CLASS_AUTO_PLACE = "a",
  10404. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10405. R.CLASS_MAIN = "main",
  10406. R.CLASS_CONTROLLER_ROW = "cr",
  10407. R.CLASS_TOO_TALL = "taller-than-window",
  10408. R.CLASS_CLOSED = "closed",
  10409. R.CLASS_CLOSE_BUTTON = "close-button",
  10410. R.CLASS_DRAG = "drag",
  10411. R.DEFAULT_WIDTH = 245,
  10412. R.TEXT_CLOSED = "Close Controls",
  10413. R.TEXT_OPEN = "Open Controls",
  10414. m.bind(window, "keydown", function(e) {
  10415. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10416. }, !1),
  10417. v.extend(R.prototype, {
  10418. add: function(e, t) {
  10419. return y(this, e, t, {
  10420. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10421. })
  10422. },
  10423. addColor: function(e, t) {
  10424. return y(this, e, t, {
  10425. color: !0
  10426. })
  10427. },
  10428. remove: function(e) {
  10429. this.__ul.removeChild(e.__li),
  10430. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10431. var t = this;
  10432. v.defer(function() {
  10433. t.onResize()
  10434. })
  10435. },
  10436. destroy: function() {
  10437. this.autoPlace && w.removeChild(this.domElement)
  10438. },
  10439. addFolder: function(e) {
  10440. if (void 0 !== this.__folders[e])
  10441. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10442. var t = {
  10443. name: e,
  10444. parent: this
  10445. };
  10446. t.autoPlace = this.autoPlace,
  10447. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10448. t.load = this.load.folders[e]);
  10449. var i = new R(t);
  10450. this.__folders[e] = i;
  10451. var n = A(this, i.domElement);
  10452. return m.addClass(n, "folder"),
  10453. i
  10454. },
  10455. open: function() {
  10456. this.closed = !1
  10457. },
  10458. close: function() {
  10459. this.closed = !0
  10460. },
  10461. onResize: function() {
  10462. var t = this.getRoot();
  10463. if (t.scrollable) {
  10464. var e = m.getOffset(t.__ul).top
  10465. , i = 0;
  10466. v.each(t.__ul.childNodes, function(e) {
  10467. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10468. }),
  10469. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10470. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10471. t.__ul.style.height = "auto")
  10472. }
  10473. t.__resize_handle && v.defer(function() {
  10474. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10475. }),
  10476. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10477. },
  10478. remember: function() {
  10479. 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>'),
  10480. this.parent)
  10481. throw new Error("You can only call remember on a top level GUI.");
  10482. var t = this;
  10483. v.each(Array.prototype.slice.call(arguments), function(e) {
  10484. 0 == t.__rememberedObjects.length && function(i) {
  10485. var e = i.__save_row = document.createElement("li");
  10486. m.addClass(i.domElement, "has-save"),
  10487. i.__ul.insertBefore(e, i.__ul.firstChild),
  10488. m.addClass(e, "save-row");
  10489. var t = document.createElement("span");
  10490. t.innerHTML = "&nbsp;",
  10491. m.addClass(t, "button gears");
  10492. var n = document.createElement("span");
  10493. n.innerHTML = "Save",
  10494. m.addClass(n, "button"),
  10495. m.addClass(n, "save");
  10496. var r = document.createElement("span");
  10497. r.innerHTML = "New",
  10498. m.addClass(r, "button"),
  10499. m.addClass(r, "save-as");
  10500. var o = document.createElement("span");
  10501. o.innerHTML = "Revert",
  10502. m.addClass(o, "button"),
  10503. m.addClass(o, "revert");
  10504. var a = i.__preset_select = document.createElement("select");
  10505. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10506. E(i, t, t == i.preset)
  10507. }) : E(i, T, !1),
  10508. m.bind(a, "change", function() {
  10509. for (var e = 0; e < i.__preset_select.length; e++)
  10510. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10511. i.preset = this.value
  10512. }),
  10513. e.appendChild(a),
  10514. e.appendChild(t),
  10515. e.appendChild(n),
  10516. e.appendChild(r),
  10517. e.appendChild(o),
  10518. x) {
  10519. var s = document.getElementById("dg-save-locally")
  10520. , l = document.getElementById("dg-local-explain");
  10521. s.style.display = "block";
  10522. var c = document.getElementById("dg-local-storage");
  10523. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10524. var h = function() {
  10525. l.style.display = i.useLocalStorage ? "block" : "none"
  10526. };
  10527. h(),
  10528. m.bind(c, "change", function() {
  10529. i.useLocalStorage = !i.useLocalStorage,
  10530. h()
  10531. })
  10532. }
  10533. var u = document.getElementById("dg-new-constructor");
  10534. m.bind(u, "keydown", function(e) {
  10535. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10536. }),
  10537. m.bind(t, "click", function() {
  10538. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10539. b.show(),
  10540. u.focus(),
  10541. u.select()
  10542. }),
  10543. m.bind(n, "click", function() {
  10544. i.save()
  10545. }),
  10546. m.bind(r, "click", function() {
  10547. var e = prompt("Enter a new preset name.");
  10548. e && i.saveAs(e)
  10549. }),
  10550. m.bind(o, "click", function() {
  10551. i.revert()
  10552. })
  10553. }(t),
  10554. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10555. }),
  10556. this.autoPlace && l(this, this.width)
  10557. },
  10558. getRoot: function() {
  10559. for (var e = this; e.parent; )
  10560. e = e.parent;
  10561. return e
  10562. },
  10563. getSaveObject: function() {
  10564. var i = this.load;
  10565. return i.closed = this.closed,
  10566. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10567. i.remembered || (i.remembered = {}),
  10568. i.remembered[this.preset] = a(this)),
  10569. i.folders = {},
  10570. v.each(this.__folders, function(e, t) {
  10571. i.folders[t] = e.getSaveObject()
  10572. }),
  10573. i
  10574. },
  10575. save: function() {
  10576. this.load.remembered || (this.load.remembered = {}),
  10577. this.load.remembered[this.preset] = a(this),
  10578. _(this, !1),
  10579. this.saveToLocalStorageIfPossible()
  10580. },
  10581. saveAs: function(e) {
  10582. this.load.remembered || (this.load.remembered = {},
  10583. this.load.remembered[T] = a(this, !0)),
  10584. this.load.remembered[e] = a(this),
  10585. this.preset = e,
  10586. E(this, e, !0),
  10587. this.saveToLocalStorageIfPossible()
  10588. },
  10589. revert: function(t) {
  10590. v.each(this.__controllers, function(e) {
  10591. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10592. }, this),
  10593. v.each(this.__folders, function(e) {
  10594. e.revert(e)
  10595. }),
  10596. t || _(this.getRoot(), !1)
  10597. },
  10598. listen: function(e) {
  10599. var t = 0 == this.__listening.length;
  10600. this.__listening.push(e),
  10601. t && function e(t) {
  10602. 0 != t.length && r(function() {
  10603. e(t)
  10604. }),
  10605. v.each(t, function(e) {
  10606. e.updateDisplay()
  10607. })
  10608. }(this.__listening)
  10609. }
  10610. }),
  10611. R
  10612. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10613. u = ee.controllers.NumberControllerBox,
  10614. d = ee.controllers.NumberControllerSlider,
  10615. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10616. y = ee.dom.dom,
  10617. A = ee.utils.common,
  10618. (C = function(e, t) {
  10619. function i() {
  10620. n.setValue(n.__input.value)
  10621. }
  10622. C.superclass.call(this, e, t);
  10623. var n = this;
  10624. this.__input = document.createElement("input"),
  10625. this.__input.setAttribute("type", "text"),
  10626. y.bind(this.__input, "keyup", i),
  10627. y.bind(this.__input, "change", i),
  10628. y.bind(this.__input, "blur", function() {
  10629. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10630. }),
  10631. y.bind(this.__input, "keydown", function(e) {
  10632. 13 === e.keyCode && this.blur()
  10633. }),
  10634. this.updateDisplay(),
  10635. this.domElement.appendChild(this.__input)
  10636. }
  10637. ).superclass = v,
  10638. A.extend(C.prototype, v.prototype, {
  10639. updateDisplay: function() {
  10640. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10641. C.superclass.prototype.updateDisplay.call(this)
  10642. }
  10643. }),
  10644. C),
  10645. f = ee.controllers.FunctionController,
  10646. g = ee.controllers.BooleanController,
  10647. m = ee.utils.common,
  10648. function(e, t) {
  10649. var i = e[t];
  10650. 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,{
  10651. min: arguments[2],
  10652. max: arguments[3]
  10653. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10654. }
  10655. ), 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) {
  10656. function f(t, i, n, r) {
  10657. t.style.background = "",
  10658. p.each(o, function(e) {
  10659. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10660. })
  10661. }
  10662. var g = function(e, t) {
  10663. function i(e) {
  10664. a(e),
  10665. h.bind(window, "mousemove", a),
  10666. h.bind(window, "mouseup", n)
  10667. }
  10668. function n() {
  10669. h.unbind(window, "mousemove", a),
  10670. h.unbind(window, "mouseup", n)
  10671. }
  10672. function r() {
  10673. var e = d(this.value);
  10674. !1 !== e ? (l.__color.__state = e,
  10675. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10676. }
  10677. function o() {
  10678. h.unbind(window, "mousemove", s),
  10679. h.unbind(window, "mouseup", o)
  10680. }
  10681. function a(e) {
  10682. e.preventDefault();
  10683. var t = h.getWidth(l.__saturation_field)
  10684. , i = h.getOffset(l.__saturation_field)
  10685. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10686. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10687. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10688. 1 < n ? n = 1 : n < 0 && (n = 0),
  10689. l.__color.v = r,
  10690. l.__color.s = n,
  10691. l.setValue(l.__color.toOriginal()),
  10692. !1
  10693. }
  10694. function s(e) {
  10695. e.preventDefault();
  10696. var t = h.getHeight(l.__hue_field)
  10697. , i = h.getOffset(l.__hue_field)
  10698. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10699. return 1 < n ? n = 1 : n < 0 && (n = 0),
  10700. l.__color.h = 360 * n,
  10701. l.setValue(l.__color.toOriginal()),
  10702. !1
  10703. }
  10704. g.superclass.call(this, e, t),
  10705. this.__color = new u(this.getValue()),
  10706. this.__temp = new u(0);
  10707. var l = this;
  10708. this.domElement = document.createElement("div"),
  10709. h.makeSelectable(this.domElement, !1),
  10710. this.__selector = document.createElement("div"),
  10711. this.__selector.className = "selector",
  10712. this.__saturation_field = document.createElement("div"),
  10713. this.__saturation_field.className = "saturation-field",
  10714. this.__field_knob = document.createElement("div"),
  10715. this.__field_knob.className = "field-knob",
  10716. this.__field_knob_border = "2px solid ",
  10717. this.__hue_knob = document.createElement("div"),
  10718. this.__hue_knob.className = "hue-knob",
  10719. this.__hue_field = document.createElement("div"),
  10720. this.__hue_field.className = "hue-field",
  10721. this.__input = document.createElement("input"),
  10722. this.__input.type = "text",
  10723. this.__input_textShadow = "0 1px 1px ",
  10724. h.bind(this.__input, "keydown", function(e) {
  10725. 13 === e.keyCode && r.call(this)
  10726. }),
  10727. h.bind(this.__input, "blur", r),
  10728. h.bind(this.__selector, "mousedown", function(e) {
  10729. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10730. h.removeClass(l.__selector, "drag")
  10731. })
  10732. });
  10733. var c = document.createElement("div");
  10734. p.extend(this.__selector.style, {
  10735. width: "122px",
  10736. height: "102px",
  10737. padding: "3px",
  10738. backgroundColor: "#222",
  10739. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10740. }),
  10741. p.extend(this.__field_knob.style, {
  10742. position: "absolute",
  10743. width: "12px",
  10744. height: "12px",
  10745. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10746. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10747. borderRadius: "12px",
  10748. zIndex: 1
  10749. }),
  10750. p.extend(this.__hue_knob.style, {
  10751. position: "absolute",
  10752. width: "15px",
  10753. height: "2px",
  10754. borderRight: "4px solid #fff",
  10755. zIndex: 1
  10756. }),
  10757. p.extend(this.__saturation_field.style, {
  10758. width: "100px",
  10759. height: "100px",
  10760. border: "1px solid #555",
  10761. marginRight: "3px",
  10762. display: "inline-block",
  10763. cursor: "pointer"
  10764. }),
  10765. p.extend(c.style, {
  10766. width: "100%",
  10767. height: "100%",
  10768. background: "none"
  10769. }),
  10770. f(c, "top", "rgba(0,0,0,0)", "#000"),
  10771. p.extend(this.__hue_field.style, {
  10772. width: "15px",
  10773. height: "100px",
  10774. display: "inline-block",
  10775. border: "1px solid #555",
  10776. cursor: "ns-resize"
  10777. }),
  10778. function(e) {
  10779. e.style.background = "",
  10780. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10781. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10782. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10783. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10784. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10785. }(this.__hue_field),
  10786. p.extend(this.__input.style, {
  10787. outline: "none",
  10788. textAlign: "center",
  10789. color: "#fff",
  10790. border: 0,
  10791. fontWeight: "bold",
  10792. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  10793. }),
  10794. h.bind(this.__saturation_field, "mousedown", i),
  10795. h.bind(this.__field_knob, "mousedown", i),
  10796. h.bind(this.__hue_field, "mousedown", function(e) {
  10797. s(e),
  10798. h.bind(window, "mousemove", s),
  10799. h.bind(window, "mouseup", o)
  10800. }),
  10801. this.__saturation_field.appendChild(c),
  10802. this.__selector.appendChild(this.__field_knob),
  10803. this.__selector.appendChild(this.__saturation_field),
  10804. this.__selector.appendChild(this.__hue_field),
  10805. this.__hue_field.appendChild(this.__hue_knob),
  10806. this.domElement.appendChild(this.__input),
  10807. this.domElement.appendChild(this.__selector),
  10808. this.updateDisplay()
  10809. };
  10810. g.superclass = e,
  10811. p.extend(g.prototype, e.prototype, {
  10812. updateDisplay: function() {
  10813. var t = d(this.getValue());
  10814. if (!1 !== t) {
  10815. var i = !1;
  10816. p.each(u.COMPONENTS, function(e) {
  10817. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  10818. return i = !0,
  10819. {}
  10820. }, this),
  10821. i && p.extend(this.__color.__state, t)
  10822. }
  10823. p.extend(this.__temp.__state, this.__color.__state),
  10824. this.__temp.a = 1;
  10825. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  10826. , n = 255 - e;
  10827. p.extend(this.__field_knob.style, {
  10828. marginLeft: 100 * this.__color.s - 7 + "px",
  10829. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  10830. backgroundColor: this.__temp.toString(),
  10831. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  10832. }),
  10833. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  10834. this.__temp.s = 1,
  10835. this.__temp.v = 1,
  10836. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  10837. p.extend(this.__input.style, {
  10838. backgroundColor: this.__input.value = this.__color.toString(),
  10839. color: "rgb(" + e + "," + e + "," + e + ")",
  10840. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  10841. })
  10842. }
  10843. });
  10844. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  10845. return g
  10846. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  10847. a = ee.color.math = {
  10848. hsv_to_rgb: function(e, t, i) {
  10849. var n = Math.floor(e / 60) % 6
  10850. , r = e / 60 - Math.floor(e / 60)
  10851. , o = i * (1 - t)
  10852. , a = i * (1 - r * t)
  10853. , s = i * (1 - (1 - r) * t)
  10854. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  10855. return {
  10856. r: 255 * l[0],
  10857. g: 255 * l[1],
  10858. b: 255 * l[2]
  10859. }
  10860. },
  10861. rgb_to_hsv: function(e, t, i) {
  10862. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  10863. return 0 == o ? {
  10864. h: NaN,
  10865. s: 0,
  10866. v: 0
  10867. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  10868. (n /= 6) < 0 && (n += 1),
  10869. {
  10870. h: 360 * n,
  10871. s: a / o,
  10872. v: o / 255
  10873. })
  10874. },
  10875. rgb_to_hex: function(e, t, i) {
  10876. var n = this.hex_with_component(0, 2, e);
  10877. return n = this.hex_with_component(n, 1, t),
  10878. this.hex_with_component(n, 0, i)
  10879. },
  10880. component_from_hex: function(e, t) {
  10881. return e >> 8 * t & 255
  10882. },
  10883. hex_with_component: function(e, t, i) {
  10884. return i << (c = 8 * t) | e & ~(255 << c)
  10885. }
  10886. },
  10887. s = ee.color.toString,
  10888. l = ee.utils.common,
  10889. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  10890. l.extend(ae.prototype, {
  10891. toString: function() {
  10892. return s(this)
  10893. },
  10894. toOriginal: function() {
  10895. return this.__state.conversion.write(this)
  10896. }
  10897. }),
  10898. ie(ae.prototype, "r", 2),
  10899. ie(ae.prototype, "g", 1),
  10900. ie(ae.prototype, "b", 0),
  10901. ne(ae.prototype, "h"),
  10902. ne(ae.prototype, "s"),
  10903. ne(ae.prototype, "v"),
  10904. Object.defineProperty(ae.prototype, "a", {
  10905. get: function() {
  10906. return this.__state.a
  10907. },
  10908. set: function(e) {
  10909. this.__state.a = e
  10910. }
  10911. }),
  10912. Object.defineProperty(ae.prototype, "hex", {
  10913. get: function() {
  10914. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  10915. this.__state.hex
  10916. },
  10917. set: function(e) {
  10918. this.__state.space = "HEX",
  10919. this.__state.hex = e
  10920. }
  10921. }),
  10922. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  10923. window.setTimeout(e, 1e3 / 60)
  10924. }
  10925. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  10926. r = ee.utils.common,
  10927. te.prototype.show = function() {
  10928. var e = this;
  10929. this.backgroundElement.style.display = "block",
  10930. this.domElement.style.display = "block",
  10931. this.domElement.style.opacity = 0,
  10932. this.domElement.style.webkitTransform = "scale(1.1)",
  10933. this.layout(),
  10934. r.defer(function() {
  10935. e.backgroundElement.style.opacity = 1,
  10936. e.domElement.style.opacity = 1,
  10937. e.domElement.style.webkitTransform = "scale(1)"
  10938. })
  10939. }
  10940. ,
  10941. te.prototype.hide = function() {
  10942. var e = this
  10943. , t = function() {
  10944. e.domElement.style.display = "none",
  10945. e.backgroundElement.style.display = "none",
  10946. n.unbind(e.domElement, "webkitTransitionEnd", t),
  10947. n.unbind(e.domElement, "transitionend", t),
  10948. n.unbind(e.domElement, "oTransitionEnd", t)
  10949. };
  10950. n.bind(this.domElement, "webkitTransitionEnd", t),
  10951. n.bind(this.domElement, "transitionend", t),
  10952. n.bind(this.domElement, "oTransitionEnd", t),
  10953. this.backgroundElement.style.opacity = 0,
  10954. this.domElement.style.opacity = 0,
  10955. this.domElement.style.webkitTransform = "scale(1.1)"
  10956. }
  10957. ,
  10958. te.prototype.layout = function() {
  10959. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  10960. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  10961. }
  10962. ,
  10963. te), ee.dom.dom, ee.utils.common)
  10964. }
  10965. , {}],
  10966. 94: [function(e, t, i) {
  10967. (function(J) {
  10968. "use strict";
  10969. function i(e) {
  10970. function t(e, t) {
  10971. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  10972. for (var a = 1; a <= e[o]; a++)
  10973. r[t[n]] = [],
  10974. r[t[n]][0] = i,
  10975. r[t[n]][1] = o,
  10976. n++,
  10977. i++;
  10978. i *= 2
  10979. }
  10980. return r
  10981. }
  10982. function _(e) {
  10983. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  10984. t & 1 << i && (B |= 1 << V),
  10985. i--,
  10986. --V < 0 && (255 == B ? (b(255),
  10987. b(0)) : b(B),
  10988. V = 7,
  10989. B = 0)
  10990. }
  10991. function b(e) {
  10992. F.push(e)
  10993. }
  10994. function w(e) {
  10995. b(e >> 8 & 255),
  10996. b(255 & e)
  10997. }
  10998. function T(e, t, i, n, r) {
  10999. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11000. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11001. for (h = 0; h < 8; ++h) {
  11002. i = e[d],
  11003. n = e[d + 1],
  11004. r = e[d + 2],
  11005. o = e[d + 3],
  11006. a = e[d + 4],
  11007. s = e[d + 5],
  11008. l = e[d + 6];
  11009. var p = i + (c = e[d + 7])
  11010. , f = i - c
  11011. , g = n + l
  11012. , m = n - l
  11013. , v = r + s
  11014. , y = r - s
  11015. , A = o + a
  11016. , C = o - a
  11017. , I = p + A
  11018. , E = p - A
  11019. , _ = g + v
  11020. , b = g - v;
  11021. e[d] = I + _,
  11022. e[d + 4] = I - _;
  11023. var w = .707106781 * (b + E);
  11024. e[d + 2] = E + w,
  11025. e[d + 6] = E - w;
  11026. var T = .382683433 * ((I = C + y) - (b = m + f))
  11027. , x = .5411961 * I + T
  11028. , S = 1.306562965 * b + T
  11029. , M = .707106781 * (_ = y + m)
  11030. , R = f + M
  11031. , P = f - M;
  11032. e[d + 5] = P + x,
  11033. e[d + 3] = P - x,
  11034. e[d + 1] = R + S,
  11035. e[d + 7] = R - S,
  11036. d += 8
  11037. }
  11038. for (h = d = 0; h < 8; ++h) {
  11039. i = e[d],
  11040. n = e[d + 8],
  11041. r = e[d + 16],
  11042. o = e[d + 24],
  11043. a = e[d + 32],
  11044. s = e[d + 40],
  11045. l = e[d + 48];
  11046. var O = i + (c = e[d + 56])
  11047. , L = i - c
  11048. , D = n + l
  11049. , N = n - l
  11050. , F = r + s
  11051. , B = r - s
  11052. , V = o + a
  11053. , k = o - a
  11054. , U = O + V
  11055. , H = O - V
  11056. , z = D + F
  11057. , G = D - F;
  11058. e[d] = U + z,
  11059. e[d + 32] = U - z;
  11060. var W = .707106781 * (G + H);
  11061. e[d + 16] = H + W,
  11062. e[d + 48] = H - W;
  11063. var j = .382683433 * ((U = k + B) - (G = N + L))
  11064. , Y = .5411961 * U + j
  11065. , q = 1.306562965 * G + j
  11066. , X = .707106781 * (z = B + N)
  11067. , Z = L + X
  11068. , K = L - X;
  11069. e[d + 40] = K + Y,
  11070. e[d + 24] = K - Y,
  11071. e[d + 8] = Z + q,
  11072. e[d + 56] = Z - q,
  11073. d++
  11074. }
  11075. for (h = 0; h < 64; ++h)
  11076. u = e[h] * t[h],
  11077. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11078. return Q
  11079. }(e, t), c = 0; c < 64; ++c)
  11080. A[C[c]] = l[c];
  11081. var h = A[0] - i;
  11082. i = A[0],
  11083. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11084. _(v[o]));
  11085. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11086. ;
  11087. if (0 == u)
  11088. return _(a),
  11089. i;
  11090. for (var d, p = 1; p <= u; ) {
  11091. for (var f = p; 0 == A[p] && p <= u; ++p)
  11092. ;
  11093. var g = p - f;
  11094. if (16 <= g) {
  11095. d = g >> 4;
  11096. for (var m = 1; m <= d; ++m)
  11097. _(s);
  11098. g &= 15
  11099. }
  11100. o = 32767 + A[p],
  11101. _(r[(g << 4) + y[o]]),
  11102. _(v[o]),
  11103. p++
  11104. }
  11105. return 63 != u && _(a),
  11106. i
  11107. }
  11108. function x(e) {
  11109. if (e <= 0 && (e = 1),
  11110. 100 < e && (e = 100),
  11111. i != e) {
  11112. (function(e) {
  11113. 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++) {
  11114. var n = u((t[i] * e + 50) / 100);
  11115. n < 1 ? n = 1 : 255 < n && (n = 255),
  11116. O[C[i]] = n
  11117. }
  11118. 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++) {
  11119. var a = u((r[o] * e + 50) / 100);
  11120. a < 1 ? a = 1 : 255 < a && (a = 255),
  11121. L[C[o]] = a
  11122. }
  11123. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11124. for (var h = 0; h < 8; h++)
  11125. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11126. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11127. l++
  11128. }
  11129. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11130. i = e
  11131. }
  11132. }
  11133. var S, M, R, P, i, u = (Math.round,
  11134. 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];
  11135. this.encode = function(e, t) {
  11136. var i = ((new Date).getTime(),
  11137. t.quality);
  11138. i && x(i),
  11139. F = new Array,
  11140. B = 0,
  11141. V = 7,
  11142. w(65496),
  11143. w(65504),
  11144. w(16),
  11145. b(74),
  11146. b(70),
  11147. b(73),
  11148. b(70),
  11149. b(0),
  11150. b(1),
  11151. b(1),
  11152. b(0),
  11153. w(1),
  11154. w(1),
  11155. b(0),
  11156. b(0),
  11157. function() {
  11158. w(65499),
  11159. w(132),
  11160. b(0);
  11161. for (var e = 0; e < 64; e++)
  11162. b(O[e]);
  11163. b(1);
  11164. for (var t = 0; t < 64; t++)
  11165. b(L[t])
  11166. }(),
  11167. function(e, t) {
  11168. w(65472),
  11169. w(17),
  11170. b(8),
  11171. w(t),
  11172. w(e),
  11173. b(3),
  11174. b(1),
  11175. b(17),
  11176. b(0),
  11177. b(2),
  11178. b(17),
  11179. b(1),
  11180. b(3),
  11181. b(17),
  11182. b(1)
  11183. }(e.width, e.height),
  11184. function() {
  11185. w(65476),
  11186. w(418),
  11187. b(0);
  11188. for (var e = 0; e < 16; e++)
  11189. b(G[e + 1]);
  11190. for (var t = 0; t <= 11; t++)
  11191. b(W[t]);
  11192. b(16);
  11193. for (var i = 0; i < 16; i++)
  11194. b(j[i + 1]);
  11195. for (var n = 0; n <= 161; n++)
  11196. b(Y[n]);
  11197. b(1);
  11198. for (var r = 0; r < 16; r++)
  11199. b(q[r + 1]);
  11200. for (var o = 0; o <= 11; o++)
  11201. b(X[o]);
  11202. b(17);
  11203. for (var a = 0; a < 16; a++)
  11204. b(Z[a + 1]);
  11205. for (var s = 0; s <= 161; s++)
  11206. b(K[s])
  11207. }(),
  11208. w(65498),
  11209. w(12),
  11210. b(3),
  11211. b(1),
  11212. b(0),
  11213. b(2),
  11214. b(17),
  11215. b(3),
  11216. b(17),
  11217. b(0),
  11218. b(63),
  11219. b(0);
  11220. var n = 0
  11221. , r = 0
  11222. , o = 0;
  11223. B = 0,
  11224. V = 7,
  11225. this.encode.displayName = "_encode_";
  11226. 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; ) {
  11227. for (a = 0; a < A; ) {
  11228. for (u = h = A * C + a,
  11229. d = -1,
  11230. f = p = 0; f < 64; f++)
  11231. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11232. v <= C + p && (u -= A * (C + 1 + p - v)),
  11233. A <= a + d && (u -= a + d - A + 4),
  11234. s = g[u++],
  11235. l = g[u++],
  11236. c = g[u++],
  11237. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11238. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11239. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11240. n = T(k, D, n, S, R),
  11241. r = T(U, N, r, M, P),
  11242. o = T(H, N, o, M, P),
  11243. a += 32
  11244. }
  11245. C += I
  11246. }
  11247. if (0 <= V) {
  11248. var E = [];
  11249. E[1] = V + 1,
  11250. E[0] = (1 << V + 1) - 1,
  11251. _(E)
  11252. }
  11253. return w(65497),
  11254. new J(F)
  11255. }
  11256. ,
  11257. (new Date).getTime(),
  11258. e = e || 50,
  11259. function() {
  11260. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11261. n[t] = e(t)
  11262. }(),
  11263. S = t(G, W),
  11264. M = t(q, X),
  11265. R = t(j, Y),
  11266. P = t(Z, K),
  11267. function() {
  11268. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11269. for (var n = e; n < t; n++)
  11270. y[32767 + n] = i,
  11271. v[32767 + n] = [],
  11272. v[32767 + n][1] = i,
  11273. v[32767 + n][0] = n;
  11274. for (var r = -(t - 1); r <= -e; r++)
  11275. y[32767 + r] = i,
  11276. v[32767 + r] = [],
  11277. v[32767 + r][1] = i,
  11278. v[32767 + r][0] = t - 1 + r;
  11279. e <<= 1,
  11280. t <<= 1
  11281. }
  11282. }(),
  11283. function() {
  11284. for (var e = 0; e < 256; e++)
  11285. z[e] = 19595 * e,
  11286. z[e + 256 >> 0] = 38470 * e,
  11287. z[e + 512 >> 0] = 7471 * e + 32768,
  11288. z[e + 768 >> 0] = -11059 * e,
  11289. z[e + 1024 >> 0] = -21709 * e,
  11290. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11291. z[e + 1536 >> 0] = -27439 * e,
  11292. z[e + 1792 >> 0] = -5329 * e
  11293. }(),
  11294. x(e),
  11295. (new Date).getTime()
  11296. }
  11297. t.exports.encode = function(e, t) {
  11298. return (t = t || {}).quality = t.quality || 50,
  11299. {
  11300. data: new i(t.quality).encode(e, t),
  11301. width: e.width,
  11302. height: e.height
  11303. }
  11304. }
  11305. }
  11306. ).call(this, e("buffer").Buffer)
  11307. }
  11308. , {
  11309. buffer: 198
  11310. }],
  11311. 95: [function(e, t, i) {
  11312. "use strict";
  11313. !function() {
  11314. if ("performance"in window == 0 && (window.performance = {}),
  11315. Date.now = Date.now || function() {
  11316. return (new Date).getTime()
  11317. }
  11318. ,
  11319. "now"in window.performance == 0) {
  11320. var e = Date.now();
  11321. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11322. window.performance.now = function() {
  11323. return Date.now() - e
  11324. }
  11325. }
  11326. }()
  11327. }
  11328. , {}],
  11329. 96: [function(e, t, i) {
  11330. "use strict";
  11331. var a = e("three");
  11332. a.EffectComposer = function(e, t) {
  11333. if (this.renderer = e,
  11334. void 0 === t) {
  11335. var i = {
  11336. minFilter: a.LinearFilter,
  11337. magFilter: a.LinearFilter,
  11338. format: a.RGBAFormat,
  11339. stencilBuffer: !1
  11340. }
  11341. , n = e.getSize();
  11342. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11343. }
  11344. this.renderTarget1 = t,
  11345. this.renderTarget2 = t.clone(),
  11346. this.writeBuffer = this.renderTarget1,
  11347. this.readBuffer = this.renderTarget2,
  11348. this.passes = [],
  11349. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11350. this.copyPass = new a.ShaderPass(a.CopyShader)
  11351. }
  11352. ,
  11353. a.EffectComposer.prototype = {
  11354. swapBuffers: function() {
  11355. var e = this.readBuffer;
  11356. this.readBuffer = this.writeBuffer,
  11357. this.writeBuffer = e
  11358. },
  11359. addPass: function(e) {
  11360. this.passes.push(e)
  11361. },
  11362. insertPass: function(e, t) {
  11363. this.passes.splice(t, 0, e)
  11364. },
  11365. render: function(e) {
  11366. this.writeBuffer = this.renderTarget1,
  11367. this.readBuffer = this.renderTarget2;
  11368. var t, i, n = !1, r = this.passes.length;
  11369. for (i = 0; i < r; i++)
  11370. if ((t = this.passes[i]).enabled) {
  11371. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11372. t.needsSwap) {
  11373. if (n) {
  11374. var o = this.renderer.context;
  11375. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11376. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11377. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11378. }
  11379. this.swapBuffers()
  11380. }
  11381. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11382. }
  11383. },
  11384. reset: function(e) {
  11385. if (void 0 === e) {
  11386. var t = this.renderer.getSize();
  11387. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11388. }
  11389. this.renderTarget1.dispose(),
  11390. this.renderTarget2.dispose(),
  11391. this.renderTarget1 = e,
  11392. this.renderTarget2 = e.clone(),
  11393. this.writeBuffer = this.renderTarget1,
  11394. this.readBuffer = this.renderTarget2
  11395. },
  11396. setSize: function(e, t) {
  11397. this.renderTarget1.setSize(e, t),
  11398. this.renderTarget2.setSize(e, t)
  11399. }
  11400. }
  11401. }
  11402. , {
  11403. three: 217
  11404. }],
  11405. 97: [function(e, t, i) {
  11406. "use strict";
  11407. var n = e("three");
  11408. n.MaskPass = function(e, t) {
  11409. this.scene = e,
  11410. this.camera = t,
  11411. this.enabled = !0,
  11412. this.clear = !0,
  11413. this.needsSwap = !1,
  11414. this.inverse = !1
  11415. }
  11416. ,
  11417. n.MaskPass.prototype = {
  11418. render: function(e, t, i, n) {
  11419. var r, o, a = e.context;
  11420. a.colorMask(!1, !1, !1, !1),
  11421. a.depthMask(!1),
  11422. o = this.inverse ? (r = 0,
  11423. 1) : (r = 1,
  11424. 0),
  11425. a.enable(a.STENCIL_TEST),
  11426. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11427. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11428. a.clearStencil(o),
  11429. e.render(this.scene, this.camera, i, this.clear),
  11430. e.render(this.scene, this.camera, t, this.clear),
  11431. a.colorMask(!0, !0, !0, !0),
  11432. a.depthMask(!0),
  11433. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11434. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11435. }
  11436. },
  11437. n.ClearMaskPass = function() {
  11438. this.enabled = !0
  11439. }
  11440. ,
  11441. n.ClearMaskPass.prototype = {
  11442. render: function(e, t, i, n) {
  11443. var r = e.context;
  11444. r.disable(r.STENCIL_TEST)
  11445. }
  11446. }
  11447. }
  11448. , {
  11449. three: 217
  11450. }],
  11451. 98: [function(e, t, i) {
  11452. "use strict";
  11453. var o = e("three");
  11454. o.RenderPass = function(e, t, i, n, r) {
  11455. this.scene = e,
  11456. this.camera = t,
  11457. this.overrideMaterial = i,
  11458. this.clearColor = n,
  11459. this.clearAlpha = void 0 !== r ? r : 1,
  11460. this.oldClearColor = new o.Color,
  11461. this.oldClearAlpha = 1,
  11462. this.enabled = !0,
  11463. this.clear = !0,
  11464. this.needsSwap = !1
  11465. }
  11466. ,
  11467. o.RenderPass.prototype = {
  11468. render: function(e, t, i, n) {
  11469. this.scene.overrideMaterial = this.overrideMaterial,
  11470. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11471. this.oldClearAlpha = e.getClearAlpha(),
  11472. e.setClearColor(this.clearColor, this.clearAlpha)),
  11473. e.render(this.scene, this.camera, i, this.clear),
  11474. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11475. this.scene.overrideMaterial = null
  11476. }
  11477. }
  11478. }
  11479. , {
  11480. three: 217
  11481. }],
  11482. 99: [function(e, t, i) {
  11483. "use strict";
  11484. var n = e("three");
  11485. n.ShaderPass = function(e, t) {
  11486. this.textureID = void 0 !== t ? t : "tDiffuse",
  11487. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11488. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11489. this.material = new n.ShaderMaterial({
  11490. defines: e.defines || {},
  11491. uniforms: this.uniforms,
  11492. vertexShader: e.vertexShader,
  11493. fragmentShader: e.fragmentShader
  11494. })),
  11495. this.renderToScreen = !1,
  11496. this.enabled = !0,
  11497. this.needsSwap = !0,
  11498. this.clear = !1,
  11499. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11500. this.scene = new n.Scene,
  11501. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11502. this.scene.add(this.quad)
  11503. }
  11504. ,
  11505. n.ShaderPass.prototype = {
  11506. render: function(e, t, i, n) {
  11507. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11508. this.quad.material = this.material,
  11509. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11510. }
  11511. }
  11512. }
  11513. , {
  11514. three: 217
  11515. }],
  11516. 100: [function(e, t, i) {
  11517. "use strict";
  11518. e("three").CopyShader = {
  11519. uniforms: {
  11520. tDiffuse: {
  11521. type: "t",
  11522. value: null
  11523. },
  11524. opacity: {
  11525. type: "f",
  11526. value: 1
  11527. }
  11528. },
  11529. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11530. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11531. }
  11532. }
  11533. , {
  11534. three: 217
  11535. }],
  11536. 101: [function(e, t, i) {
  11537. "use strict";
  11538. e("three").HorizontalBlurShader = {
  11539. uniforms: {
  11540. tDiffuse: {
  11541. type: "t",
  11542. value: null
  11543. },
  11544. h: {
  11545. type: "f",
  11546. value: 1 / 512
  11547. }
  11548. },
  11549. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11550. 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")
  11551. }
  11552. }
  11553. , {
  11554. three: 217
  11555. }],
  11556. 102: [function(e, t, i) {
  11557. "use strict";
  11558. e("three").VerticalBlurShader = {
  11559. uniforms: {
  11560. tDiffuse: {
  11561. type: "t",
  11562. value: null
  11563. },
  11564. v: {
  11565. type: "f",
  11566. value: 1 / 512
  11567. }
  11568. },
  11569. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11570. 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")
  11571. }
  11572. }
  11573. , {
  11574. three: 217
  11575. }],
  11576. 103: [function(e, t, i) {
  11577. "use strict";
  11578. var z = e("three");
  11579. !function() {
  11580. if ("performance"in window == 0 && (window.performance = {}),
  11581. "now"in window.performance == 0) {
  11582. var e = Date.now();
  11583. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11584. window.performance.now = function() {
  11585. return Date.now() - e
  11586. }
  11587. }
  11588. }(),
  11589. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11590. var t, i = this.extensions, n = this.context;
  11591. if (e === z.RepeatWrapping)
  11592. return n.REPEAT;
  11593. if (e === z.ClampToEdgeWrapping)
  11594. return n.CLAMP_TO_EDGE;
  11595. if (e === z.MirroredRepeatWrapping)
  11596. return n.MIRRORED_REPEAT;
  11597. if (e === z.NearestFilter)
  11598. return n.NEAREST;
  11599. if (e === z.NearestMipMapNearestFilter)
  11600. return n.NEAREST_MIPMAP_NEAREST;
  11601. if (e === z.NearestMipMapLinearFilter)
  11602. return n.NEAREST_MIPMAP_LINEAR;
  11603. if (e === z.LinearFilter)
  11604. return n.LINEAR;
  11605. if (e === z.LinearMipMapNearestFilter)
  11606. return n.LINEAR_MIPMAP_NEAREST;
  11607. if (e === z.LinearMipMapLinearFilter)
  11608. return n.LINEAR_MIPMAP_LINEAR;
  11609. if (e === z.UnsignedByteType)
  11610. return n.UNSIGNED_BYTE;
  11611. if (e === z.UnsignedShort4444Type)
  11612. return n.UNSIGNED_SHORT_4_4_4_4;
  11613. if (e === z.UnsignedShort5551Type)
  11614. return n.UNSIGNED_SHORT_5_5_5_1;
  11615. if (e === z.UnsignedShort565Type)
  11616. return n.UNSIGNED_SHORT_5_6_5;
  11617. if (e === z.ByteType)
  11618. return n.BYTE;
  11619. if (e === z.ShortType)
  11620. return n.SHORT;
  11621. if (e === z.UnsignedShortType)
  11622. return n.UNSIGNED_SHORT;
  11623. if (e === z.IntType)
  11624. return n.INT;
  11625. if (e === z.UnsignedIntType)
  11626. return n.UNSIGNED_INT;
  11627. if (e === z.FloatType)
  11628. return n.FLOAT;
  11629. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11630. return t.HALF_FLOAT_OES;
  11631. if (e === z.AlphaFormat)
  11632. return n.ALPHA;
  11633. if (e === z.RGBFormat)
  11634. return n.RGB;
  11635. if (e === z.RGBAFormat)
  11636. return n.RGBA;
  11637. if (e === z.LuminanceFormat)
  11638. return n.LUMINANCE;
  11639. if (e === z.LuminanceAlphaFormat)
  11640. return n.LUMINANCE_ALPHA;
  11641. if (e === z.AddEquation)
  11642. return n.FUNC_ADD;
  11643. if (e === z.SubtractEquation)
  11644. return n.FUNC_SUBTRACT;
  11645. if (e === z.ReverseSubtractEquation)
  11646. return n.FUNC_REVERSE_SUBTRACT;
  11647. if (e === z.ZeroFactor)
  11648. return n.ZERO;
  11649. if (e === z.OneFactor)
  11650. return n.ONE;
  11651. if (e === z.SrcColorFactor)
  11652. return n.SRC_COLOR;
  11653. if (e === z.OneMinusSrcColorFactor)
  11654. return n.ONE_MINUS_SRC_COLOR;
  11655. if (e === z.SrcAlphaFactor)
  11656. return n.SRC_ALPHA;
  11657. if (e === z.OneMinusSrcAlphaFactor)
  11658. return n.ONE_MINUS_SRC_ALPHA;
  11659. if (e === z.DstAlphaFactor)
  11660. return n.DST_ALPHA;
  11661. if (e === z.OneMinusDstAlphaFactor)
  11662. return n.ONE_MINUS_DST_ALPHA;
  11663. if (e === z.DstColorFactor)
  11664. return n.DST_COLOR;
  11665. if (e === z.OneMinusDstColorFactor)
  11666. return n.ONE_MINUS_DST_COLOR;
  11667. if (e === z.SrcAlphaSaturateFactor)
  11668. return n.SRC_ALPHA_SATURATE;
  11669. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11670. if (e === z.RGB_S3TC_DXT1_Format)
  11671. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11672. if (e === z.RGBA_S3TC_DXT1_Format)
  11673. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11674. if (e === z.RGBA_S3TC_DXT3_Format)
  11675. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11676. if (e === z.RGBA_S3TC_DXT5_Format)
  11677. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11678. }
  11679. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11680. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11681. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11682. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11683. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11684. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11685. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11686. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11687. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11688. }
  11689. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11690. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11691. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11692. if (e === z.MinEquation)
  11693. return t.MIN_EXT;
  11694. if (e === z.MaxEquation)
  11695. return t.MAX_EXT
  11696. }
  11697. return 0
  11698. }
  11699. ,
  11700. z.WebGLState = function(l, i, c) {
  11701. var n = this
  11702. , r = new z.Vector4
  11703. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  11704. , o = new Uint8Array(e)
  11705. , a = new Uint8Array(e)
  11706. , s = new Uint8Array(e)
  11707. , t = {}
  11708. , h = null
  11709. , u = null
  11710. , d = null
  11711. , p = null
  11712. , f = null
  11713. , g = null
  11714. , m = null
  11715. , v = null
  11716. , y = !1
  11717. , A = null
  11718. , C = null
  11719. , I = null
  11720. , E = null
  11721. , _ = null
  11722. , b = null
  11723. , w = null
  11724. , T = null
  11725. , x = null
  11726. , S = null
  11727. , M = null
  11728. , R = null
  11729. , P = null
  11730. , O = null
  11731. , L = null
  11732. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  11733. , N = void 0
  11734. , F = {}
  11735. , B = new z.Vector4
  11736. , V = null
  11737. , k = null
  11738. , U = new z.Vector4
  11739. , H = new z.Vector4;
  11740. this.init = function() {
  11741. this.clearColor(0, 0, 0, 1),
  11742. this.clearDepth(1),
  11743. this.clearStencil(0),
  11744. this.enable(l.DEPTH_TEST),
  11745. l.depthFunc(l.LEQUAL),
  11746. l.frontFace(l.CCW),
  11747. l.cullFace(l.BACK),
  11748. this.enable(l.CULL_FACE),
  11749. this.enable(l.BLEND),
  11750. l.blendEquation(l.FUNC_ADD),
  11751. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  11752. }
  11753. ,
  11754. this.initAttributes = function() {
  11755. for (var e = 0, t = o.length; e < t; e++)
  11756. o[e] = 0
  11757. }
  11758. ,
  11759. this.enableAttribute = function(e) {
  11760. o[e] = 1,
  11761. 0 === a[e] && (l.enableVertexAttribArray(e),
  11762. a[e] = 1),
  11763. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  11764. s[e] = 0)
  11765. }
  11766. ,
  11767. this.enableAttributeAndDivisor = function(e, t, i) {
  11768. o[e] = 1,
  11769. 0 === a[e] && (l.enableVertexAttribArray(e),
  11770. a[e] = 1),
  11771. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  11772. s[e] = t)
  11773. }
  11774. ,
  11775. this.disableUnusedAttributes = function() {
  11776. for (var e = 0, t = a.length; e < t; e++)
  11777. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  11778. a[e] = 0)
  11779. }
  11780. ,
  11781. this.enable = function(e) {
  11782. !0 !== t[e] && (l.enable(e),
  11783. t[e] = !0)
  11784. }
  11785. ,
  11786. this.disable = function(e) {
  11787. !1 !== t[e] && (l.disable(e),
  11788. t[e] = !1)
  11789. }
  11790. ,
  11791. this.getCompressedTextureFormats = function() {
  11792. if (null === h && (h = [],
  11793. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  11794. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  11795. h.push(e[t]);
  11796. return h
  11797. }
  11798. ,
  11799. this.setBlending = function(e, t, i, n, r, o, a, s) {
  11800. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  11801. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11802. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  11803. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11804. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11805. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11806. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11807. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11808. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11809. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  11810. u = e,
  11811. y = s),
  11812. e === z.CustomBlending ? (r = r || t,
  11813. o = o || i,
  11814. a = a || n,
  11815. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  11816. d = t,
  11817. g = r),
  11818. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  11819. p = i,
  11820. f = n,
  11821. m = o,
  11822. v = a)) : v = m = g = f = p = d = null
  11823. }
  11824. ,
  11825. this.setDepthFunc = function(e) {
  11826. if (A !== e) {
  11827. if (e)
  11828. switch (e) {
  11829. case z.NeverDepth:
  11830. l.depthFunc(l.NEVER);
  11831. break;
  11832. case z.AlwaysDepth:
  11833. l.depthFunc(l.ALWAYS);
  11834. break;
  11835. case z.LessDepth:
  11836. l.depthFunc(l.LESS);
  11837. break;
  11838. case z.LessEqualDepth:
  11839. l.depthFunc(l.LEQUAL);
  11840. break;
  11841. case z.EqualDepth:
  11842. l.depthFunc(l.EQUAL);
  11843. break;
  11844. case z.GreaterEqualDepth:
  11845. l.depthFunc(l.GEQUAL);
  11846. break;
  11847. case z.GreaterDepth:
  11848. l.depthFunc(l.GREATER);
  11849. break;
  11850. case z.NotEqualDepth:
  11851. l.depthFunc(l.NOTEQUAL);
  11852. break;
  11853. default:
  11854. l.depthFunc(l.LEQUAL)
  11855. }
  11856. else
  11857. l.depthFunc(l.LEQUAL);
  11858. A = e
  11859. }
  11860. }
  11861. ,
  11862. this.setDepthTest = function(e) {
  11863. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  11864. }
  11865. ,
  11866. this.setDepthWrite = function(e) {
  11867. C !== e && (l.depthMask(e),
  11868. C = e)
  11869. }
  11870. ,
  11871. this.setColorWrite = function(e) {
  11872. I !== e && (l.colorMask(e, e, e, e),
  11873. I = e)
  11874. }
  11875. ,
  11876. this.setStencilFunc = function(e, t, i) {
  11877. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  11878. _ = e,
  11879. b = t,
  11880. w = i)
  11881. }
  11882. ,
  11883. this.setStencilOp = function(e, t, i) {
  11884. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  11885. T = e,
  11886. x = t,
  11887. S = i)
  11888. }
  11889. ,
  11890. this.setStencilTest = function(e) {
  11891. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  11892. }
  11893. ,
  11894. this.setStencilWrite = function(e) {
  11895. E !== e && (l.stencilMask(e),
  11896. E = e)
  11897. }
  11898. ,
  11899. this.setFlipSided = function(e) {
  11900. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  11901. M = e)
  11902. }
  11903. ,
  11904. this.setLineWidth = function(e) {
  11905. e !== R && (l.lineWidth(e),
  11906. R = e)
  11907. }
  11908. ,
  11909. this.setPolygonOffset = function(e, t, i) {
  11910. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  11911. !e || P === t && O === i || (l.polygonOffset(t, i),
  11912. P = t,
  11913. O = i)
  11914. }
  11915. ,
  11916. this.getScissorTest = function() {
  11917. return L
  11918. }
  11919. ,
  11920. this.setScissorTest = function(e) {
  11921. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  11922. }
  11923. ,
  11924. this.activeTexture = function(e) {
  11925. void 0 === e && (e = l.TEXTURE0 + D - 1),
  11926. N !== e && (l.activeTexture(e),
  11927. N = e)
  11928. }
  11929. ,
  11930. this.bindTexture = function(e, t) {
  11931. void 0 === N && n.activeTexture();
  11932. var i = F[N];
  11933. void 0 === i && (i = {
  11934. type: void 0,
  11935. texture: void 0
  11936. },
  11937. F[N] = i),
  11938. i.type === e && i.texture === t || (l.bindTexture(e, t),
  11939. i.type = e,
  11940. i.texture = t)
  11941. }
  11942. ,
  11943. this.compressedTexImage2D = function() {
  11944. try {
  11945. l.compressedTexImage2D.apply(l, arguments)
  11946. } catch (e) {
  11947. console.error(e)
  11948. }
  11949. }
  11950. ,
  11951. this.texImage2D = function() {
  11952. try {
  11953. l.texImage2D.apply(l, arguments)
  11954. } catch (e) {
  11955. console.error(e)
  11956. }
  11957. }
  11958. ,
  11959. this.clearColor = function(e, t, i, n) {
  11960. r.set(e, t, i, n),
  11961. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  11962. B.copy(r))
  11963. }
  11964. ,
  11965. this.clearDepth = function(e) {
  11966. V !== e && (l.clearDepth(e),
  11967. V = e)
  11968. }
  11969. ,
  11970. this.clearStencil = function(e) {
  11971. k !== e && (l.clearStencil(e),
  11972. k = e)
  11973. }
  11974. ,
  11975. this.scissor = function(e) {
  11976. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  11977. U.copy(e))
  11978. }
  11979. ,
  11980. this.viewport = function(e) {
  11981. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  11982. H.copy(e))
  11983. }
  11984. ,
  11985. this.reset = function() {
  11986. for (var e = 0; e < a.length; e++)
  11987. 1 === a[e] && (l.disableVertexAttribArray(e),
  11988. a[e] = 0);
  11989. t = {},
  11990. N = void 0,
  11991. F = {},
  11992. M = E = C = I = u = h = null
  11993. }
  11994. }
  11995. }
  11996. , {
  11997. three: 217
  11998. }],
  11999. 104: [function(a, h, e) {
  12000. (function(i, e) {
  12001. "use strict";
  12002. function t(e) {
  12003. this.urls = e;
  12004. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12005. this.builder = n.loadProto(t),
  12006. this.decoder = this.builder.build("binary_mesh")
  12007. }
  12008. var s = a("three")
  12009. , n = a("protobufjs")
  12010. , r = a("../util/logger")
  12011. , o = (a("../util/common"),
  12012. a("../util/ajax"))
  12013. , l = a("../objects/Chunk")
  12014. , c = new r(e);
  12015. t.prototype = {
  12016. constructor: t,
  12017. load: function(t, i, n, r) {
  12018. return c.time("download"),
  12019. o.get(t, {
  12020. responseType: "arraybuffer"
  12021. }).done(function(e) {
  12022. c.timeEnd("download"),
  12023. this.parse(e, t, i, n, r)
  12024. }
  12025. .bind(this)).fail(r)
  12026. },
  12027. parse: function(e, t, i, n, r) {
  12028. var o = this.readProtobuf(e);
  12029. if (!o)
  12030. return r();
  12031. try {
  12032. c.time("convert to webgl"),
  12033. this.convertProtobufToSceneObject(o, t, i, n, r),
  12034. c.timeEnd("convert to webgl")
  12035. } catch (e) {
  12036. return c.error("failed parsing .dam"),
  12037. c.error(e.message),
  12038. r()
  12039. }
  12040. },
  12041. readProtobuf: function(e) {
  12042. var t;
  12043. try {
  12044. c.time("parse proto"),
  12045. t = this.decoder.decode(e),
  12046. c.timeEnd("parse proto")
  12047. } catch (e) {
  12048. return c.error("failed parsing proto for .dam"),
  12049. c.error(e.message),
  12050. null
  12051. }
  12052. return t
  12053. },
  12054. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12055. if (0 === e.chunk.length)
  12056. return c.warn("No chunks in damfile..."),
  12057. t([]);
  12058. var o = new s.Matrix4;
  12059. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12060. var a = e.chunk.map(function(e) {
  12061. var t = new s.BufferGeometry;
  12062. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12063. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12064. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12065. t.applyMatrix(o),
  12066. t.computeBoundingBox(),
  12067. new l({
  12068. geometry: t,
  12069. textureName: e.material_name,
  12070. name: e.chunk_name,
  12071. meshUrl: i
  12072. })
  12073. });
  12074. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12075. r())
  12076. }
  12077. },
  12078. h.exports = t
  12079. }
  12080. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12081. }
  12082. , {
  12083. "../objects/Chunk": 144,
  12084. "../util/ajax": 181,
  12085. "../util/common": 185,
  12086. "../util/logger": 189,
  12087. buffer: 198,
  12088. protobufjs: 214,
  12089. three: 217
  12090. }],
  12091. 105: [function(n, r, e) {
  12092. (function(e) {
  12093. "use strict";
  12094. var t = (n("three"),
  12095. n("../settings"),
  12096. n("../util/browser"),
  12097. n("./DamLoader"))
  12098. , i = n("../util/logger")
  12099. , u = (n("../ab"),
  12100. new i(e));
  12101. r.exports = {
  12102. getLoaders: function() {
  12103. return [["_50k", ".dam", t], ["", ".dam", t]]
  12104. },
  12105. load: function(e, t, i, n, r, o) {
  12106. var a = this.getLoaders()[o = o || 0];
  12107. if (a) {
  12108. var s = a[0]
  12109. , l = a[1]
  12110. , c = new a[2](t)
  12111. , h = t.get(e + s + l);
  12112. h ? (u.debug("Trying " + s + l),
  12113. c.load(h, i, n, function() {
  12114. this.load(e, t, i, n, r, ++o)
  12115. }
  12116. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12117. this.load(e, t, i, n, r, ++o))
  12118. } else
  12119. r && r("No suitable model file found...")
  12120. }
  12121. }
  12122. }
  12123. ).call(this, "/js/loaders/ModelLoader.js")
  12124. }
  12125. , {
  12126. "../ab": 3,
  12127. "../settings": 166,
  12128. "../util/browser": 182,
  12129. "../util/logger": 189,
  12130. "./DamLoader": 104,
  12131. three: 217
  12132. }],
  12133. 106: [function(i, n, e) {
  12134. (function(e) {
  12135. "use strict";
  12136. var l = i("../util/common")
  12137. , c = i("../util/texture")
  12138. , h = i("../util/browser")
  12139. , t = i("../util/logger")
  12140. , u = i("../settings")
  12141. , d = new t(e);
  12142. n.exports = {
  12143. load: function(i, n) {
  12144. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12145. return $.when();
  12146. var r = l.countUnique(i.chunks.map(function(e) {
  12147. return e.textureName
  12148. }))
  12149. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12150. , t = "_50k" == e ? "high" : "low";
  12151. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12152. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12153. t = "low"));
  12154. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12155. , a = $.Deferred()
  12156. , s = 0;
  12157. return i.chunks.forEach(function(e) {
  12158. if (!e.material.map && e.textureName) {
  12159. var t = i.urls.get(o + e.textureName);
  12160. e.setTextureMap(c.load(t, function(e, t) {
  12161. e || (n.push(t),
  12162. s++,
  12163. a.notify(s, r),
  12164. s === r && a.resolve())
  12165. }
  12166. .bind(this, c.isLoaded(t))))
  12167. }
  12168. }),
  12169. a.promise()
  12170. }
  12171. }
  12172. }
  12173. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12174. }
  12175. , {
  12176. "../settings": 166,
  12177. "../util/browser": 182,
  12178. "../util/common": 185,
  12179. "../util/logger": 189,
  12180. "../util/texture": 194
  12181. }],
  12182. 107: [function(s, l, e) {
  12183. (function(n, e) {
  12184. "use strict";
  12185. function t(e) {
  12186. this.model = e,
  12187. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12188. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12189. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12190. , i = r.loadProto(t);
  12191. this.decoder = i.build("VisionModeldata")
  12192. }
  12193. var r = s("protobufjs")
  12194. , i = s("../util/ajax")
  12195. , o = (s("../util/common"),
  12196. s("../util/math"))
  12197. , a = new (s("../util/logger"))(e);
  12198. t.prototype.load = function() {
  12199. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12200. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12201. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12202. $.when([]))
  12203. }
  12204. ,
  12205. t.prototype.loadVisionModelData = function() {
  12206. return i.get(this.modelDataPath, {
  12207. responseType: "arraybuffer"
  12208. }).then(function(e) {
  12209. var t;
  12210. try {
  12211. t = this.decoder.decode(e)
  12212. } catch (e) {
  12213. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12214. this.loadSweepLocationsCSV()
  12215. }
  12216. var i = t.sweepLocations.map(function(e) {
  12217. return {
  12218. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12219. position: {
  12220. x: e.pose.translation.x,
  12221. y: e.pose.translation.y,
  12222. z: e.pose.translation.z
  12223. },
  12224. quaternion: {
  12225. x: e.pose.rotation.x,
  12226. y: e.pose.rotation.y,
  12227. z: e.pose.rotation.z,
  12228. w: e.pose.rotation.w
  12229. },
  12230. puck: {
  12231. x: e.puck.x,
  12232. y: e.puck.y,
  12233. z: e.puck.z
  12234. },
  12235. floor: e.group,
  12236. neighbours: e.visibles,
  12237. alignmentType: e.alignment_type
  12238. }
  12239. }).map(function(e) {
  12240. return e.position = o.convertVisionVector(e.position),
  12241. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12242. e.puck = o.convertVisionVector(e.puck),
  12243. e
  12244. });
  12245. return i.forEach(function(e) {
  12246. e.neighbours = e.neighbours.map(function(e) {
  12247. return i[e].uuid
  12248. })
  12249. }),
  12250. i
  12251. }
  12252. .bind(this), function() {
  12253. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12254. this.loadSweepLocationsCSV()
  12255. }
  12256. .bind(this))
  12257. }
  12258. ,
  12259. t.prototype.loadSweepLocationsCSV = function() {
  12260. return i.get(this.sweepLocationsPath).then(function(e) {
  12261. return e.split("\n").map(function(e) {
  12262. return e.split(", ")
  12263. }).filter(function(e) {
  12264. return 1 < e.length
  12265. }).map(function(e) {
  12266. return {
  12267. uuid: e[0],
  12268. position: {
  12269. x: parseFloat(e[1]),
  12270. y: parseFloat(e[2]),
  12271. z: parseFloat(e[3])
  12272. },
  12273. quaternion: {
  12274. x: parseFloat(e[4]),
  12275. y: parseFloat(e[5]),
  12276. z: parseFloat(e[6]),
  12277. w: parseFloat(e[7])
  12278. }
  12279. }
  12280. }).map(function(e) {
  12281. return e.position = o.convertVisionVector(e.position),
  12282. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12283. e
  12284. })
  12285. }).fail(function() {
  12286. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12287. })
  12288. }
  12289. ,
  12290. l.exports = t
  12291. }
  12292. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12293. }
  12294. , {
  12295. "../util/ajax": 181,
  12296. "../util/common": 185,
  12297. "../util/logger": 189,
  12298. "../util/math": 190,
  12299. buffer: 198,
  12300. protobufjs: 214
  12301. }],
  12302. 108: [function(s, l, e) {
  12303. (function(e) {
  12304. "use strict";
  12305. function t() {
  12306. this.locale = null
  12307. }
  12308. var i = s("../settings")
  12309. , n = s("../util/common")
  12310. , r = s("../util/logger")
  12311. , o = s("../enum/Locale")
  12312. , a = new r(e);
  12313. t.prototype.init = function() {
  12314. var e;
  12315. switch (i.languageTag) {
  12316. case null:
  12317. case "en":
  12318. case o.EN_US:
  12319. this.locale = o.EN_US,
  12320. e = s("./strings-en-US");
  12321. break;
  12322. case "es":
  12323. case o.ES_MX:
  12324. this.locale = o.ES_MX,
  12325. e = s("./strings-es-MX");
  12326. break;
  12327. case "fr":
  12328. case o.FR_FR:
  12329. this.locale = o.FR_FR,
  12330. e = s("./strings-fr-FR");
  12331. break;
  12332. case "de":
  12333. case o.DE_DE:
  12334. this.locale = o.DE_DE,
  12335. e = s("./strings-de-DE");
  12336. break;
  12337. case "ru":
  12338. case o.RU_RU:
  12339. this.locale = o.RU_RU,
  12340. e = s("./strings-ru-RU");
  12341. break;
  12342. case "cn":
  12343. case o.CN_CN:
  12344. this.locale = o.CN_CN,
  12345. e = s("./strings-cn-CN");
  12346. break;
  12347. case "jp":
  12348. case o.JP_JP:
  12349. this.locale = o.JP_JP,
  12350. e = s("./strings-jp-JP");
  12351. break;
  12352. default:
  12353. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12354. this.locale = o.EN_US,
  12355. e = s("./strings-en-US")
  12356. }
  12357. a.info("Using locale '" + this.locale + "'"),
  12358. n.extendObject(this, e)
  12359. }
  12360. ,
  12361. t.prototype.localizeGUI = function() {
  12362. var e = document.querySelector("#gui-parent");
  12363. this.localizeTree(e),
  12364. this.localizeLoadingText()
  12365. }
  12366. ,
  12367. t.prototype.localizeLoadingText = function() {
  12368. document.querySelector("#help-dialog").classList.add(this.locale),
  12369. document.querySelector("#interaction-modal").classList.add(this.locale),
  12370. document.querySelector("#gui").classList.add(this.locale)
  12371. }
  12372. ,
  12373. t.prototype.localizeTree = function(e) {
  12374. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12375. if (e.nodeType === Node.TEXT_NODE)
  12376. (t = e.data.match(n)) && (i = t[1],
  12377. e.data = this.localizeText(i) || i);
  12378. else if (e.nodeType === Node.ELEMENT_NODE) {
  12379. var r = e.getAttribute("title");
  12380. r && ((t = r.match(n)) && (i = t[1],
  12381. e.setAttribute("title", this.localizeText(i) || i)))
  12382. }
  12383. for (e = e.firstChild; e; )
  12384. this.localizeTree(e),
  12385. e = e.nextSibling
  12386. }
  12387. ,
  12388. t.prototype.localizeText = function(e) {
  12389. var t = this[e];
  12390. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12391. t = s("./strings-en-US")[e]),
  12392. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12393. t
  12394. }
  12395. ,
  12396. l.exports = new t
  12397. }
  12398. ).call(this, "/js/localization/localize.js")
  12399. }
  12400. , {
  12401. "../enum/Locale": 31,
  12402. "../settings": 166,
  12403. "../util/common": 185,
  12404. "../util/logger": 189,
  12405. "./strings-cn-CN": 109,
  12406. "./strings-de-DE": 110,
  12407. "./strings-en-US": 111,
  12408. "./strings-es-MX": 112,
  12409. "./strings-fr-FR": 113,
  12410. "./strings-jp-JP": 114,
  12411. "./strings-ru-RU": 115
  12412. }],
  12413. 109: [function(e, t, i) {
  12414. "use strict";
  12415. t.exports = {
  12416. PAGE_TITLE: "",
  12417. LOADING: "正在加载",
  12418. PRESENTED_BY_CAPS: "呈现者:",
  12419. POWERED_BY: "技术支持:",
  12420. POWERED_BY_CAPS: "技术支持:",
  12421. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12422. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12423. PRESENTED_BY: "呈现者:",
  12424. MORE: "更多 ",
  12425. LESS: "更少 ",
  12426. TAG_CONTENT: "tag™ 内容",
  12427. SHOW: "显示",
  12428. HIDE: "隐藏",
  12429. DOLLHOUSE: "场景屋",
  12430. FLOOR_PLAN: "楼层平面图",
  12431. OPEN_HIGHLIGHTS: "打开精彩片段",
  12432. CLOSE_HIGHLIGHTS: "关闭",
  12433. PREVIOUS: "上一个",
  12434. PLAY: "播放",
  12435. PAUSE: "暂停",
  12436. NEXT: "下一个",
  12437. EXPLORE_3D_SPACE: "探索 3D 空间",
  12438. VIEW_DOLLHOUSE: "观看场景屋",
  12439. SOCIAL_SHARING: "分享这个空间",
  12440. VIEW_IN_VR: "以 VR 观看",
  12441. VIEW_FULLSCREEN: "全屏观看",
  12442. EXIT_FULLSCREEN: " 退出全屏",
  12443. ZOOM_IN: "放大",
  12444. ZOOM_OUT: "缩小",
  12445. FLOOR_NAME: "楼层",
  12446. FLOOR_ALL: "ALL",
  12447. FLOOR_Lang: ["Floor", ""],
  12448. TERMS: "条款",
  12449. PORT_TERMS: "port 条款",
  12450. TERMS_OF_USE: "使用条款",
  12451. CLOSE_TERMS: "关闭",
  12452. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12453. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12454. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12455. WEBVR_ENTER_WEBVR: "进入 VR",
  12456. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12457. WEBVR_LEARN_MORE: "了解更多",
  12458. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12459. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12460. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12461. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12462. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12463. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12464. VR_LEARN_MORE_CAPS: "了解更多",
  12465. VR_PREVIOUS_CAPS: "上一个’,",
  12466. VR_NEXT_CAPS: "下一个",
  12467. VR_GOT_IT_CAPS: "明白了",
  12468. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12469. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12470. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12471. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12472. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12473. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12474. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12475. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12476. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12477. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12478. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12479. VR_APP: "port VR 应用程序",
  12480. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12481. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12482. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12483. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12484. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12485. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12486. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12487. VR_ANDROID_DVICES: "Android 设备",
  12488. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12489. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12490. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12491. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12492. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12493. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12494. VR_DOWNLOAD_HERE: "在此下载",
  12495. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12496. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12497. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12498. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12499. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12500. SHARE_TO: "分享到",
  12501. SHARE_LINK: "直接链接",
  12502. SHARE_EXPLORE: "探索",
  12503. SHARE_AT: "在",
  12504. SHARE_WITH: "使用",
  12505. SHARE_3D: "以 3D",
  12506. SHARE_COPIED: "已复制!",
  12507. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12508. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12509. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12510. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12511. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12512. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12513. ERROR_GENERIC_ACTIONS_3: " 或",
  12514. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12515. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12516. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12517. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12518. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12519. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12520. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12521. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12522. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12523. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12524. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12525. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12526. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12527. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12528. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12529. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12530. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12531. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12532. LINK_TO_LOCATION: "地点链接",
  12533. MENU_COPY: "复制",
  12534. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12535. ROTATE: "旋转",
  12536. MOVE: "移动",
  12537. INSIDE: "内部",
  12538. ZOOM: "缩放",
  12539. HELP: "小帮手",
  12540. HELP_NAVIGATION_TAB: "导航",
  12541. HELP_MORE_HELP_TAB: "更多帮助",
  12542. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12543. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12544. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12545. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12546. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12547. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12548. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12549. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12550. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12551. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12552. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12553. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12554. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12555. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12556. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12557. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12558. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12559. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12560. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12561. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12562. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12563. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12564. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12565. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12566. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12567. HELP_MORE_HLR_A: "精彩片段集锦",
  12568. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12569. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12570. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12571. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12572. HELP_MORE_FLOORS_A: "楼层选择器",
  12573. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12574. HELP_MORE_TAG_A: "tag™ 贴文",
  12575. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12576. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12577. HELP_MORE_ZOOM_A: "缩放控件",
  12578. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12579. HELP_MORE_TOUR_A: "导览控件",
  12580. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12581. HELP_MORE_INSIDE_A: "内部视图",
  12582. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12583. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12584. HELP_MORE_VR_A: "VR 模式",
  12585. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12586. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12587. HELP_MORE_360_A: "360° 视图",
  12588. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12589. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12590. HELP_MORE_FULLSCREEN_A: "全屏",
  12591. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12592. CLOSE: "关闭"
  12593. }
  12594. }
  12595. , {}],
  12596. 110: [function(e, t, i) {
  12597. "use strict";
  12598. t.exports = {
  12599. PAGE_TITLE: "",
  12600. LOADING: "Lädt",
  12601. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12602. POWERED_BY: "Angetrieben von",
  12603. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12604. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12605. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12606. PRESENTED_BY: "Präsentiert von ",
  12607. MORE: "Mehr ",
  12608. LESS: "Weniger ",
  12609. TAG_CONTENT: "tag™ Inhalt",
  12610. SHOW: "Anzeigen",
  12611. HIDE: "Verbergen",
  12612. DOLLHOUSE: "Puppenhaus",
  12613. FLOOR_PLAN: "Grundriss",
  12614. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12615. CLOSE_HIGHLIGHTS: "Schließen",
  12616. PREVIOUS: "Vorheriges",
  12617. PLAY: "Abspielen",
  12618. PAUSE: "Pausieren",
  12619. NEXT: "Nächstes",
  12620. EXPLORE_3D_SPACE: "Innenraum betreten",
  12621. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12622. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12623. VIEW_IN_VR: "In VR ansehen",
  12624. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12625. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12626. ZOOM_IN: "Vergrößern",
  12627. ZOOM_OUT: "Verkleinern",
  12628. FLOOR_NAME: "Etage ",
  12629. FLOOR_ALL: "Alle",
  12630. TERMS: "Bedingungen",
  12631. PORT_TERMS: "port Bedingungen",
  12632. TERMS_OF_USE: "Nutzungsbedingungen",
  12633. TERMS_TEXT_FILE: "terms-de-DE.html",
  12634. CLOSE_TERMS: "Schließen",
  12635. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12636. HELP: "Hilfe",
  12637. HELP_NAVIGATION_TAB: "Navigation",
  12638. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12639. CLOSE: "Schließen",
  12640. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12641. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12642. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12643. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12644. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12645. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12646. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12647. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12648. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12649. 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.",
  12650. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12651. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12652. 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.",
  12653. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12654. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12655. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12656. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12657. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12658. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12659. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12660. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12661. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12662. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12663. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12664. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12665. HELP_MORE_HLR_A: "Liste das Highlight",
  12666. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12667. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12668. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12669. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12670. HELP_MORE_FLOORS_A: "Etage auswählen",
  12671. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12672. HELP_MORE_TAG_A: "tag™ Posts",
  12673. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12674. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12675. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12676. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12677. HELP_MORE_TOUR_A: "Tour Steuerung",
  12678. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12679. HELP_MORE_INSIDE_A: "Innenansicht",
  12680. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12681. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12682. HELP_MORE_VR_A: "VR Modus",
  12683. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12684. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12685. HELP_MORE_360_A: "360° Views Ansicht ",
  12686. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12687. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12688. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12689. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12690. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12691. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12692. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12693. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12694. WEBVR_LEARN_MORE: "Mehr Infos",
  12695. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12696. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12697. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12698. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12699. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12700. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12701. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12702. VR_APP: "port VR App",
  12703. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12704. 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",
  12705. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12706. VR_APP_FOR_ANDROID: "port VR app für Android",
  12707. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12708. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12709. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12710. VR_PREVIOUS_CAPS: "ZURÜCK",
  12711. VR_NEXT_CAPS: "WEITER",
  12712. VR_GOT_IT_CAPS: "VERSTANDEN",
  12713. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  12714. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  12715. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  12716. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  12717. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  12718. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  12719. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12720. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12721. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12722. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  12723. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  12724. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  12725. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  12726. VR_ANDROID_DVICES: "Android Geräte",
  12727. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  12728. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  12729. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  12730. VR_DOWNLOAD_HERE: "Hier runterladen",
  12731. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  12732. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  12733. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  12734. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  12735. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  12736. SHARE_TO: "Teilen auf",
  12737. SHARE_LINK: "Direkter Link",
  12738. SHARE_EXPLORE: "Umsehen",
  12739. SHARE_AT: "auf",
  12740. SHARE_WITH: "mit",
  12741. SHARE_3D: "in 3D",
  12742. SHARE_COPIED: "Kopiert!",
  12743. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  12744. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  12745. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  12746. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  12747. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12748. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  12749. ERROR_GENERIC_ACTIONS_3: " oder ",
  12750. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12751. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  12752. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  12753. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  12754. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  12755. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  12756. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  12757. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  12758. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  12759. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  12760. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  12761. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  12762. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  12763. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  12764. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12765. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12766. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  12767. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  12768. LINK_TO_LOCATION: "Link zu",
  12769. MENU_COPY: "Kopieren",
  12770. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  12771. ROTATE: "Drehen",
  12772. INSIDE: "Drinnen",
  12773. MOVE: "Bewegen",
  12774. ZOOM: "Vergrößern"
  12775. }
  12776. }
  12777. , {}],
  12778. 111: [function(e, t, i) {
  12779. "use strict";
  12780. t.exports = {
  12781. PAGE_TITLE: "",
  12782. LOADING: "Loading",
  12783. PRESENTED_BY_CAPS: "PRESENTED BY",
  12784. POWERED_BY: "powered by ",
  12785. POWERED_BY_CAPS: "POWERED BY",
  12786. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  12787. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  12788. PRESENTED_BY: "Presented by ",
  12789. MORE: "More ",
  12790. LESS: "Less ",
  12791. TAG_CONTENT: "tag™ Content",
  12792. SHOW: "Show",
  12793. HIDE: "Hide",
  12794. DOLLHOUSE: "Dollhouse",
  12795. FLOOR_PLAN: "Floor plan",
  12796. OPEN_HIGHLIGHTS: "Open Highlights",
  12797. CLOSE_HIGHLIGHTS: "Close",
  12798. PREVIOUS: "Previous",
  12799. PLAY: "Play",
  12800. PAUSE: "Pause",
  12801. NEXT: "Next",
  12802. EXPLORE_3D_SPACE: "Explore 3D Space",
  12803. VIEW_DOLLHOUSE: "View dollhouse",
  12804. SOCIAL_SHARING: "Share this Space",
  12805. VIEW_IN_VR: "View in VR",
  12806. VIEW_FULLSCREEN: "全屏",
  12807. EXIT_FULLSCREEN: "退出全屏",
  12808. ZOOM_IN: "Zoom in",
  12809. ZOOM_OUT: "Zoom out",
  12810. FLOOR_NAME: "Floor ",
  12811. FLOOR_ALL: "全部",
  12812. TERMS: "Terms",
  12813. PORT_TERMS: "port terms",
  12814. TERMS_OF_USE: "Terms of Use",
  12815. TERMS_TEXT_FILE: "terms-en-US.html",
  12816. CLOSE_TERMS: "Close",
  12817. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  12818. HELP: "Help",
  12819. HELP_NAVIGATION_TAB: "Navigation",
  12820. HELP_MORE_HELP_TAB: "More Help",
  12821. CLOSE: "Close",
  12822. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  12823. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  12824. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  12825. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  12826. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  12827. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  12828. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  12829. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  12830. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  12831. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  12832. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  12833. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  12834. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  12835. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  12836. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  12837. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  12838. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  12839. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  12840. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  12841. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  12842. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  12843. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  12844. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  12845. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  12846. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  12847. HELP_MORE_HLR_A: "Highlight Reel",
  12848. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  12849. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  12850. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  12851. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  12852. HELP_MORE_FLOORS_A: "Floor Selector",
  12853. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  12854. HELP_MORE_TAG_A: "tag™ Posts",
  12855. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  12856. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  12857. HELP_MORE_ZOOM_A: "Zoom Controls",
  12858. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  12859. HELP_MORE_TOUR_A: "Tour Controls",
  12860. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  12861. HELP_MORE_INSIDE_A: "Inside View",
  12862. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  12863. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  12864. HELP_MORE_VR_A: "VR Mode",
  12865. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  12866. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  12867. HELP_MORE_360_A: "360° Views",
  12868. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  12869. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  12870. HELP_MORE_FULLSCREEN_A: "Full screen",
  12871. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  12872. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  12873. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  12874. WEBVR_FOR_DAYDREAM: "For Daydream View",
  12875. WEBVR_ENTER_WEBVR: "ENTER VR",
  12876. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  12877. WEBVR_LEARN_MORE: "Learn more",
  12878. WEBVR_VIEW_SPACE: "View Space in VR",
  12879. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12880. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  12881. VR_VIEW_SPACE: "View Space in Virtual Reality",
  12882. VR_LEARN_MORE_CAPS: "LEARN MORE",
  12883. VR_PREVIOUS_CAPS: "PREVIOUS",
  12884. VR_NEXT_CAPS: "NEXT",
  12885. VR_GOT_IT_CAPS: "GOT IT",
  12886. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  12887. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  12888. VR_SHOW_IOS_1: "Tap to view the space in VR",
  12889. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  12890. VR_WHAT_YOU_NEED: "What You'll Need For...",
  12891. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  12892. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  12893. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  12894. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  12895. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12896. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12897. VR_APP: "port VR App",
  12898. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12899. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12900. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  12901. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  12902. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  12903. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  12904. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  12905. VR_ANDROID_DVICES: "Android Devices",
  12906. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  12907. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  12908. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  12909. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  12910. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  12911. VR_APP_OPEN: "Open with the port VR app instead",
  12912. VR_DOWNLOAD_HERE: "Download here",
  12913. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  12914. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  12915. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  12916. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  12917. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  12918. SHARE_TO: "Share to",
  12919. SHARE_LINK: "Direct Link",
  12920. SHARE_EXPLORE: "Explore ",
  12921. SHARE_AT: "at",
  12922. SHARE_WITH: "with",
  12923. SHARE_3D: " in 3D",
  12924. SHARE_COPIED: "Copied!",
  12925. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  12926. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  12927. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  12928. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  12929. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  12930. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  12931. ERROR_GENERIC_ACTIONS_3: " or ",
  12932. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  12933. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  12934. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  12935. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  12936. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  12937. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  12938. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  12939. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  12940. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  12941. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  12942. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  12943. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  12944. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  12945. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  12946. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  12947. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  12948. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  12949. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  12950. LINK_TO_LOCATION: "Link to location",
  12951. MENU_COPY: "Copy",
  12952. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  12953. ROTATE: "Rotate",
  12954. INSIDE: "Inside",
  12955. MOVE: "Move",
  12956. ZOOM: "Zoom"
  12957. }
  12958. }
  12959. , {}],
  12960. 112: [function(e, t, i) {
  12961. "use strict";
  12962. t.exports = {
  12963. PAGE_TITLE: "",
  12964. LOADING: "Cargando",
  12965. PRESENTED_BY_CAPS: "PRESENTADO POR",
  12966. POWERED_BY: "potenciando por ",
  12967. POWERED_BY_CAPS: "POTENCIADO POR ",
  12968. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  12969. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  12970. PRESENTED_BY: "Presentado por ",
  12971. MORE: "Más ",
  12972. LESS: "Menos ",
  12973. TAG_CONTENT: "Contenido de tag™",
  12974. SHOW: "Mostrar",
  12975. HIDE: "Ocultar",
  12976. DOLLHOUSE: "Dollhouse",
  12977. FLOOR_PLAN: "Planos",
  12978. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  12979. CLOSE_HIGHLIGHTS: "Cerrar",
  12980. PREVIOUS: "Anterior",
  12981. PLAY: "Play",
  12982. PAUSE: "Pausa",
  12983. NEXT: "Siguiente",
  12984. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  12985. VIEW_DOLLHOUSE: "Ver dollhouse",
  12986. SOCIAL_SHARING: "Compartir este espacio",
  12987. VIEW_IN_VR: "Ver en realidad virtual",
  12988. VIEW_FULLSCREEN: "Ver en pantalla completa",
  12989. EXIT_FULLSCREEN: "Salir de pantalla completa",
  12990. ZOOM_IN: "Acercar",
  12991. ZOOM_OUT: "Alejar",
  12992. FLOOR_NAME: "Piso ",
  12993. FLOOR_ALL: "Todas",
  12994. TERMS: "Condiciones",
  12995. PORT_TERMS: "port términos de uso",
  12996. TERMS_OF_USE: "Términos de uso",
  12997. TERMS_TEXT_FILE: "terms-es-MX.html",
  12998. CLOSE_TERMS: "Cerrar",
  12999. 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.",
  13000. HELP: "Ayuda",
  13001. HELP_NAVIGATION_TAB: "Navegación",
  13002. HELP_MORE_HELP_TAB: "Más Ayuda",
  13003. CLOSE: "Cerrar",
  13004. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13005. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13006. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13007. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13008. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13009. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13010. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13011. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13012. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13013. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13014. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13015. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13016. 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.",
  13017. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13018. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13019. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13020. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13021. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13022. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13023. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13024. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13025. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13026. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13027. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13028. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13029. HELP_MORE_HLR_A: "Galería destacada",
  13030. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13031. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13032. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13033. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13034. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13035. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13036. HELP_MORE_TAG_A: "tag™ Posts",
  13037. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13038. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13039. HELP_MORE_ZOOM_A: "Controles de zoom",
  13040. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13041. HELP_MORE_TOUR_A: "Controles de recorrido",
  13042. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13043. HELP_MORE_INSIDE_A: "Vista interior",
  13044. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13045. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13046. HELP_MORE_VR_A: "Modo de realidad virtual",
  13047. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13048. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13049. HELP_MORE_360_A: "360° Views",
  13050. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13051. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13052. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13053. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13054. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13055. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13056. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13057. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13058. WEBVR_LEARN_MORE: "Más información",
  13059. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13060. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13061. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13062. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13063. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13064. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13065. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13066. VR_APP: "port VR App",
  13067. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13068. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13069. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13070. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13071. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13072. VR_PREVIOUS_CAPS: "ANTERIOR",
  13073. VR_NEXT_CAPS: "SIGUIENTE",
  13074. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13075. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13076. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13077. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13078. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13079. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13080. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13081. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13082. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13083. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13084. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13085. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13086. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13087. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13088. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13089. VR_ANDROID_DVICES: "Dispositivos Android",
  13090. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13091. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13092. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13093. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13094. VR_DOWNLOAD_HERE: "Descargar aquí",
  13095. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13096. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13097. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13098. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13099. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13100. SHARE_TO: "Compartir en",
  13101. SHARE_LINK: "Enlace directo",
  13102. SHARE_EXPLORE: "Explorar ",
  13103. SHARE_AT: "en",
  13104. SHARE_WITH: "con",
  13105. SHARE_3D: " en 3D",
  13106. SHARE_COPIED: "¡Copiado!",
  13107. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13108. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13109. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13110. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13111. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13112. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13113. ERROR_GENERIC_ACTIONS_3: " o ",
  13114. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13115. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13116. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13117. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13118. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13119. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13120. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13121. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13122. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13123. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13124. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13125. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13126. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13127. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13128. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13129. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13130. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13131. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13132. LINK_TO_LOCATION: "Enlace a la ubicación",
  13133. MENU_COPY: "Copiar",
  13134. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13135. ROTATE: "Girar",
  13136. INSIDE: "Interior",
  13137. MOVE: "Moverse",
  13138. ZOOM: "Acercar o alejar"
  13139. }
  13140. }
  13141. , {}],
  13142. 113: [function(e, t, i) {
  13143. "use strict";
  13144. t.exports = {
  13145. PAGE_TITLE: "",
  13146. LOADING: "Chargement",
  13147. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13148. POWERED_BY: "alimenté par ",
  13149. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13150. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13151. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13152. PRESENTED_BY: "Présenté par ",
  13153. MORE: "Plus ",
  13154. LESS: "Moins ",
  13155. TAG_CONTENT: "Contenu tag™",
  13156. SHOW: "Montrer",
  13157. HIDE: "Cacher",
  13158. DOLLHOUSE: "Dollhouse",
  13159. FLOOR_PLAN: "Plan de sol",
  13160. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13161. CLOSE_HIGHLIGHTS: "Fermer",
  13162. PREVIOUS: "Précédent",
  13163. PLAY: "Lecture",
  13164. PAUSE: "Pause",
  13165. NEXT: "Suivant",
  13166. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13167. VIEW_DOLLHOUSE: "Voir dollhouse",
  13168. SOCIAL_SHARING: "Partager cet espace",
  13169. VIEW_IN_VR: "Voir en VR",
  13170. VIEW_FULLSCREEN: "Plein écran",
  13171. EXIT_FULLSCREEN: "Fermer plein écran",
  13172. ZOOM_IN: "Zoom avant",
  13173. ZOOM_OUT: "Zoom arrière",
  13174. FLOOR_NAME: "Étage ",
  13175. FLOOR_ALL: "Tous",
  13176. TERMS: "Mentions légales",
  13177. PORT_TERMS: "port mentions légales",
  13178. TERMS_OF_USE: "Conditions d'utilisation",
  13179. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13180. CLOSE_TERMS: "Fermer",
  13181. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13182. HELP: "Aide",
  13183. HELP_NAVIGATION_TAB: "Navigation",
  13184. HELP_MORE_HELP_TAB: "Aide",
  13185. CLOSE: "Fermer",
  13186. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13187. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13188. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13189. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13190. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13191. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13192. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13193. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13194. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13195. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13196. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13197. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13198. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13199. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13200. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13201. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13202. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13203. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13204. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13205. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13206. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13207. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13208. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13209. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13210. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13211. HELP_MORE_HLR_A: "Carrousel",
  13212. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13213. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13214. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13215. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13216. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13217. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13218. HELP_MORE_TAG_A: "tag™ Posts",
  13219. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13220. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13221. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13222. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13223. HELP_MORE_TOUR_A: "Commandes de la visite",
  13224. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13225. HELP_MORE_INSIDE_A: "Vue intérieure",
  13226. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13227. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13228. HELP_MORE_VR_A: "Mode RV",
  13229. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13230. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13231. HELP_MORE_360_A: "Vues 360°",
  13232. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13233. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13234. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13235. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13236. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13237. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13238. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13239. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13240. WEBVR_LEARN_MORE: "En savoir plus",
  13241. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13242. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13243. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13244. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13245. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13246. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13247. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13248. VR_NEXT_CAPS: "SUIVANT",
  13249. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13250. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13251. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13252. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13253. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13254. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13255. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13256. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13257. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13258. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13259. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13260. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13261. VR_APP: "port VR App",
  13262. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13263. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13264. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13265. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13266. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13267. 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",
  13268. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13269. VR_ANDROID_DVICES: "Appareils Android",
  13270. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13271. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13272. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13273. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13274. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13275. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13276. VR_DOWNLOAD_HERE: "Télécharger ici",
  13277. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13278. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13279. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13280. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13281. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13282. SHARE_TO: "Partager sur",
  13283. SHARE_LINK: "Lien direct",
  13284. SHARE_EXPLORE: "Explorer ",
  13285. SHARE_AT: "à",
  13286. SHARE_WITH: "avec",
  13287. SHARE_3D: " en 3D",
  13288. SHARE_COPIED: "Copié!",
  13289. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13290. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13291. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13292. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13293. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13294. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13295. ERROR_GENERIC_ACTIONS_3: " ou ",
  13296. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13297. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13298. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13299. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13300. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13301. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13302. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13303. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13304. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13305. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13306. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13307. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13308. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13309. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13310. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13311. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13312. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13313. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13314. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13315. MENU_COPY: "Copie",
  13316. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13317. ROTATE: "Faire pivoter",
  13318. INSIDE: "Intérieure",
  13319. MOVE: "Se déplacer",
  13320. ZOOM: "Zoom"
  13321. }
  13322. }
  13323. , {}],
  13324. 114: [function(e, t, i) {
  13325. "use strict";
  13326. t.exports = {
  13327. PAGE_TITLE: "",
  13328. LOADING: "読み込み中",
  13329. PRESENTED_BY_CAPS: "PRESENTED BY",
  13330. POWERED_BY: "powered by",
  13331. POWERED_BY_CAPS: "POWERED BY",
  13332. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13333. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13334. PRESENTED_BY: "Presented by ",
  13335. MORE: "全て表示 ",
  13336. LESS: "閉じる ",
  13337. TAG_CONTENT: "tag™コンテンツ ",
  13338. SHOW: "表示",
  13339. HIDE: "非表示",
  13340. DOLLHOUSE: "ドールハウス",
  13341. FLOOR_PLAN: "フロアプラン",
  13342. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13343. CLOSE_HIGHLIGHTS: "閉じる",
  13344. PREVIOUS: "前へ",
  13345. PLAY: "再生",
  13346. PAUSE: "一時停止",
  13347. NEXT: "次へ",
  13348. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13349. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13350. SOCIAL_SHARING: "このSpaceを共有する",
  13351. VIEW_IN_VR: "VRで表示",
  13352. VIEW_FULLSCREEN: "フルスクリーン表示",
  13353. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13354. ZOOM_IN: "ズームイン",
  13355. ZOOM_OUT: "ズームアウト",
  13356. FLOOR_NAME: "フロア ",
  13357. FLOOR_ALL: "すべて",
  13358. TERMS: "規約",
  13359. PORT_TERMS: "port規約",
  13360. TERMS_OF_USE: "利用規約",
  13361. CLOSE_TERMS: "閉じる",
  13362. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13363. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13364. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13365. WEBVR_ENTER_WEBVR: "VRに入る",
  13366. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13367. WEBVR_LEARN_MORE: "もっと詳しく",
  13368. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13369. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13370. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13371. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13372. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13373. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13374. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13375. VR_PREVIOUS_CAPS: "前へ",
  13376. VR_NEXT_CAPS: "次へ",
  13377. VR_GOT_IT_CAPS: "了解",
  13378. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13379. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13380. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13381. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13382. VR_WHAT_YOU_NEED: "必要なもの",
  13383. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13384. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13385. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13386. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13387. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13388. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13389. VR_APP: "port VRアプリ",
  13390. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13391. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13392. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13393. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13394. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13395. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13396. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13397. VR_ANDROID_DVICES: "Androidデバイス",
  13398. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13399. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13400. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13401. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13402. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13403. VR_APP_OPEN: "port VRアプリで開く",
  13404. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13405. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13406. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13407. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13408. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13409. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13410. SHARE_TO: "共有先",
  13411. SHARE_LINK: "ダイレクトリンク",
  13412. SHARE_EXPLORE: "探索",
  13413. SHARE_AT: "場所",
  13414. SHARE_WITH: "使用アプリ",
  13415. SHARE_3D: "3Dで",
  13416. SHARE_COPIED: "コピーされました!",
  13417. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13418. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13419. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13420. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13421. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13422. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13423. ERROR_GENERIC_ACTIONS_3: "または",
  13424. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13425. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13426. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13427. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13428. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13429. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13430. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13431. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13432. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13433. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13434. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13435. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13436. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13437. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13438. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13439. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13440. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13441. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13442. LINK_TO_LOCATION: "ロケーションへのリンク",
  13443. MENU_COPY: "コピー",
  13444. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13445. ROTATE: "回転",
  13446. MOVE: "移動",
  13447. INSIDE: "内側",
  13448. ZOOM: "ズーム",
  13449. HELP: "ヘルプ",
  13450. HELP_NAVIGATION_TAB: "ナビゲーション",
  13451. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13452. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13453. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13454. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13455. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13456. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13457. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13458. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13459. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13460. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13461. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13462. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13463. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13464. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13465. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13466. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13467. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13468. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13469. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13470. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13471. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13472. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13473. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13474. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13475. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13476. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13477. HELP_MORE_HLR_A: "ハイライト",
  13478. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13479. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13480. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13481. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13482. HELP_MORE_FLOORS_A: "フロアセレクター",
  13483. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13484. HELP_MORE_TAG_A: "tag™ Posts",
  13485. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13486. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13487. HELP_MORE_ZOOM_A: "ズームコントロール",
  13488. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13489. HELP_MORE_TOUR_A: "ツアーコントロール",
  13490. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13491. HELP_MORE_INSIDE_A: "内側ビュー",
  13492. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13493. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13494. HELP_MORE_VR_A: "VRモード",
  13495. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13496. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13497. HELP_MORE_360_A: "360° Views",
  13498. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13499. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13500. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13501. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13502. CLOSE: "閉じる"
  13503. }
  13504. }
  13505. , {}],
  13506. 115: [function(e, t, i) {
  13507. "use strict";
  13508. t.exports = {
  13509. PAGE_TITLE: "",
  13510. LOADING: "Загрузка",
  13511. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13512. POWERED_BY: "разработано на платформе ",
  13513. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13514. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13515. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13516. PRESENTED_BY: "Представлено ",
  13517. MORE: "Больше ",
  13518. LESS: "Меньше ",
  13519. TAG_CONTENT: "tag™ Контент",
  13520. SHOW: "Показать",
  13521. HIDE: "Скрыть",
  13522. DOLLHOUSE: "Dollhouse",
  13523. FLOOR_PLAN: "Планировка",
  13524. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13525. CLOSE_HIGHLIGHTS: "Закрыть",
  13526. PREVIOUS: "Предыдущий",
  13527. PLAY: "Воспроизвести",
  13528. PAUSE: "Пауза",
  13529. NEXT: "Следующий",
  13530. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13531. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13532. SOCIAL_SHARING: "Поделиться этой моделью",
  13533. VIEW_IN_VR: "Посмотреть в VR",
  13534. VIEW_FULLSCREEN: "Полный экран",
  13535. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13536. ZOOM_IN: "Увеличить",
  13537. ZOOM_OUT: "Уменьшить",
  13538. FLOOR_NAME: "Этаж ",
  13539. FLOOR_ALL: "Все",
  13540. TERMS: "Условия",
  13541. PORT_TERMS: "Правила пользования",
  13542. TERMS_OF_USE: "Условия использования",
  13543. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13544. CLOSE_TERMS: "Закрыть",
  13545. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13546. HELP: "Помощь",
  13547. HELP_NAVIGATION_TAB: "Навигация",
  13548. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13549. CLOSE: "Закрыть",
  13550. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13551. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13552. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13553. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13554. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13555. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13556. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13557. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13558. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13559. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13560. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13561. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13562. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13563. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13564. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13565. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13566. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13567. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13568. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13569. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13570. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13571. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13572. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13573. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13574. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13575. HELP_MORE_HLR_A: "Фотоколлаж",
  13576. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13577. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13578. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13579. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13580. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13581. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13582. HELP_MORE_TAG_A: "tag™ Posts",
  13583. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13584. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13585. HELP_MORE_ZOOM_A: "Масштаб",
  13586. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13587. HELP_MORE_TOUR_A: "Управление Туром",
  13588. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13589. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13590. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13591. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13592. HELP_MORE_VR_A: "Режим VR",
  13593. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13594. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13595. HELP_MORE_360_A: "360° Views",
  13596. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13597. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13598. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13599. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13600. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13601. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13602. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13603. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13604. WEBVR_LEARN_MORE: "Узнать больше",
  13605. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13606. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13607. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13608. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13609. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13610. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13611. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13612. VR_APP: "port VR App",
  13613. VR_APP_OPEN: "Или открыть через приложение port VR",
  13614. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13615. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13616. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13617. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13618. VR_VIEW_SPACE: "Запустить модель в VR",
  13619. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13620. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13621. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13622. VR_GOT_IT_CAPS: "ЯСНО",
  13623. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13624. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13625. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13626. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13627. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13628. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13629. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13630. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13631. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13632. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13633. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13634. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13635. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13636. VR_ANDROID_DVICES: "Android устройства",
  13637. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13638. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13639. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13640. VR_DOWNLOAD_HERE: "Скачать здесь",
  13641. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13642. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13643. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13644. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13645. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13646. SHARE_TO: "Поделиться",
  13647. SHARE_LINK: "Прямая ссылка",
  13648. SHARE_EXPLORE: "просмотреть",
  13649. SHARE_AT: "на",
  13650. SHARE_WITH: "с",
  13651. SHARE_3D: "в 3D",
  13652. SHARE_COPIED: "Скопировано!",
  13653. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13654. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13655. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13656. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13657. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13658. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13659. ERROR_GENERIC_ACTIONS_3: " или ",
  13660. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13661. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13662. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13663. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13664. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13665. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13666. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13667. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13668. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13669. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13670. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13671. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13672. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13673. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13674. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13675. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13676. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13677. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13678. LINK_TO_LOCATION: "Ссылка на местоположение",
  13679. MENU_COPY: "Копировать",
  13680. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13681. ROTATE: "Вращать",
  13682. MOVE: "Передвигаться",
  13683. INSIDE: "Вид изнутри",
  13684. ZOOM: "Масштаб"
  13685. }
  13686. }
  13687. , {}],
  13688. 116: [function(r, e, t) {
  13689. (function(i) {
  13690. "use strict";
  13691. function re(e) {
  13692. console.log("e1:" + e),
  13693. e = Math.round(.4 * e * 100),
  13694. console.log("e2:" + e);
  13695. var t = $(".progressbar");
  13696. t.find(".bar").css("width", e + "%"),
  13697. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  13698. t.find(".perc").text(e + "%")
  13699. }
  13700. $("#gui-loading").fadeIn(200),
  13701. re(.1);
  13702. var e = g_version ? "modeldata.js" : "someData.json";
  13703. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  13704. dataType: "json"
  13705. }).done(function(e) {
  13706. var t = matcher(e);
  13707. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  13708. t.user = {
  13709. is_authenticated: !1,
  13710. 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"]
  13711. }
  13712. try{//处理一下导览数据,旧的曾有第一个导览数据是错误的,将它删除
  13713. if(t.model.images[0] && !t.model.images[0].thumbnail_signed_src){
  13714. t.model.images = t.model.images.slice(1);
  13715. }
  13716. }catch(e){console.log(e) }
  13717. window.MP_PREFETCHED_MODELDATA = t,
  13718. re(.7),
  13719. function() {
  13720. function y(e) {
  13721. t.update(e)
  13722. }
  13723. function A(e, t) {
  13724. ne.error(t),
  13725. n.error(t),
  13726. N.report(e, "error-" + t)
  13727. }
  13728. function C(e, t, i) {
  13729. try {
  13730. e.start(t)
  13731. } catch (e) {
  13732. throw ne.warn(e.message),
  13733. function(e) {
  13734. var t = O.details();
  13735. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  13736. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  13737. N.report(e, "error-webgl-generic"))
  13738. }(i.sid),
  13739. e
  13740. }
  13741. }
  13742. function I(e) {
  13743. e.stopPropagation(),
  13744. e.preventDefault()
  13745. }
  13746. window.MP_PREFETCHED_MODELDATA.hoticon && (g_HotImage = {
  13747. point: window.MP_PREFETCHED_MODELDATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  13748. point2: window.MP_PREFETCHED_MODELDATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  13749. });
  13750. window.MP_PREFETCHED_MODELDATA.backgroundMusic ? (g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic,
  13751. $("#volume").show()) : "one" === g_version && (g_bgAudio.src = g_Prefix + "/audio/audio" + window.number + "/background.mp3");
  13752. window.MP_PREFETCHED_MODELDATA.loadlogo && showLogo();
  13753. r("./lib/three75-shim"),
  13754. r("./lib/array-polyfill"),
  13755. r("./lib/performance-polyfill"),
  13756. r("./lib/shaders/CopyShader.js"),
  13757. r("./lib/shaders/HorizontalBlurShader.js"),
  13758. r("./lib/shaders/VerticalBlurShader.js"),
  13759. r("./lib/postprocessing/EffectComposer.js"),
  13760. r("./lib/postprocessing/RenderPass.js"),
  13761. r("./lib/postprocessing/MaskPass.js"),
  13762. r("./lib/postprocessing/ShaderPass.js"),
  13763. window.Promise || (window.Promise = r("promise-polyfill"));
  13764. var E = r("three")
  13765. , _ = r("three")
  13766. , b = (r("./util/sentry"),
  13767. r("./player"))
  13768. , w = r("./director")
  13769. , T = r("./controls/CameraControls")
  13770. , x = r("./model/ModelManager")
  13771. , S = r("./DisplayController")
  13772. , M = r("./label/LabelDisplayController")
  13773. , R = r("./enum/Viewmode")
  13774. , e = r("./util/logger")
  13775. , P = r("./showcase")
  13776. , O = r("./util/browser")
  13777. , L = r("./settings")
  13778. , D = r("./gui/gui")
  13779. , n = r("./gui/error")
  13780. , N = r("./analytics")
  13781. , F = r("./util/transitions")
  13782. , B = r("./effects")
  13783. , V = r("./objects/Skybox")
  13784. , k = (r("./util/common"),
  13785. r("./util/PanoramaCollection"),
  13786. r("./util/math"),
  13787. r("./util/showcase"))
  13788. , U = r("./util/camera")
  13789. , H = (r("./objects/Panorama"),
  13790. r("./cameras/PanoramaCamera"),
  13791. r("./preloaders"))
  13792. , z = r("events").EventEmitter
  13793. , G = r("./featureflags")
  13794. , W = (r("./util/lerp"),
  13795. r("./util/ajax"),
  13796. r("./ab"))
  13797. , j = r("./sdk/automation.js")
  13798. , Y = r("./scene/SceneRenderer")
  13799. , q = r("./scene/QuickstartManager")
  13800. , X = r("./tile/QualityManager.js")
  13801. , Z = r("./localization/localize")
  13802. , K = r("./tag/tagManager")
  13803. , Q = r("./tile/TileDownloader")
  13804. , J = r("./tile/PanoRenderer")
  13805. , ee = (r("./enum/PanoSizeClass"),
  13806. r("./enum/PanoramaEvents"),
  13807. r("./enum/SceneRendererEvents"))
  13808. , t = r("./gui/memoryUsage")
  13809. , te = r("./enum/RenderLayers")
  13810. , ie = r("./TimingData")
  13811. , ne = new e(i);
  13812. e.level = L.logLevel,
  13813. e.consoleEnabled = L.console,
  13814. function() {
  13815. var e = k.getModelIDFromQueryString();
  13816. if (!e)
  13817. return A(null, "loading-failed");
  13818. var t = k.parseSidUrl(e)
  13819. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  13820. , n = {
  13821. panoElementsToLoad: 6,
  13822. modelElementsToLoad: 0,
  13823. totalElementsLoaded: 0,
  13824. totalElementsToLoad: 0,
  13825. totalPercentageLoaded: 0,
  13826. progressCallback: null
  13827. }
  13828. , r = document.getElementById("player")
  13829. , o = L.quickstart.enabled
  13830. , a = null
  13831. , s = null
  13832. , l = null
  13833. , c = null
  13834. , h = null
  13835. , u = null
  13836. , d = null
  13837. , p = null
  13838. , f = null
  13839. , g = null
  13840. , m = null
  13841. , v = new ie;
  13842. !function(e) {
  13843. ne.info("Version", "2.25.6-0-gd87e5b1"),
  13844. z.defaultMaxListeners = 1e3,
  13845. function(e) {
  13846. e.addEventListener("dragenter", I, !1),
  13847. e.addEventListener("dragover", I, !1)
  13848. }(e),
  13849. O.valueFromHash("title", !0) || $(document).ready(function() {
  13850. $(".model-title").hide()
  13851. })
  13852. }(r),
  13853. function(e) {
  13854. return G.loadFeatureFlags(e).done(function(e) {
  13855. G.updateDependentSettings(e, L)
  13856. })
  13857. }({
  13858. urlBase: t.urlBase
  13859. }).then(function() {
  13860. return Z.init(),
  13861. function(e, t) {
  13862. var i = P.getModel({
  13863. url: t,
  13864. floors: O.valueFromHash("f", !0),
  13865. autoload: !1
  13866. });
  13867. return $.when(i, y).then(null, function(e) {
  13868. return this
  13869. })
  13870. }(0, e)
  13871. }).then(function(e) {
  13872. return re(.9),
  13873. function(e, t, i, n, r) {
  13874. ne.info("Model data loaded"),
  13875. ne.debug("UUID: " + e.data.job.uuid),
  13876. W.init(G.getFlags()),
  13877. i && N.initKeen({
  13878. token: i,
  13879. appId: n
  13880. }),
  13881. N.initSegment({
  13882. model: e.sid,
  13883. version: "2.25.6-0-gd87e5b1",
  13884. startSource: r.startSource,
  13885. token: t,
  13886. autoplay: r.autoplay,
  13887. quickstart: r.quickstart
  13888. })
  13889. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  13890. startSource: i,
  13891. autoplay: L.autoplay,
  13892. quickstart: o
  13893. }),
  13894. g.urls.init()
  13895. }).then(function() {
  13896. return g.loadPanos()
  13897. }).then(function() {
  13898. s = U.getStartCameraOptions(g, g.panos);
  13899. //初始画面
  13900. window.MP_PREFETCHED_MODELDATA.camera_start && window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg && function(e) {
  13901. $("<img/>").attr("src", e).on("load", function() {
  13902. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  13903. $(this).remove()
  13904. $(".shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  13905. })
  13906. }(window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg);
  13907. d = function(e) {
  13908. var t = new E.PerspectiveCamera;
  13909. t.layers.enable(te.PANOMARKERS),
  13910. t.layers.enable(te.RETICULE),
  13911. t.layers.enable(te.TAG);
  13912. var o = new E.Scene
  13913. , i = new E.AmbientLight(16777215);
  13914. return o.add(i),
  13915. o.skybox = new V,
  13916. o.add(o.skybox),
  13917. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  13918. side: E.DoubleSide
  13919. })),
  13920. o.plane.position.y = 0,
  13921. o.plane.rotateX(-Math.PI / 2),
  13922. o.plane.material.visible = !1,
  13923. o.add(o.plane),
  13924. o.updateMatrixWorld(),
  13925. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  13926. if (e.metadata && e.metadata.camera_position) {
  13927. var t = e.metadata.camera_position
  13928. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  13929. i.position = t.clone(),
  13930. o.add(i);
  13931. var n = e.metadata.camera_quaternion
  13932. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  13933. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  13934. }
  13935. }),
  13936. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  13937. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  13938. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  13939. new Y(o,t,B)
  13940. }(g),
  13941. m = function(e, t) {
  13942. var i = e ? 1 : 1e3
  13943. , n = W.tilegen || W.imgopt ? 6 : 2;
  13944. n = O.valueFromHash("tileconc", n);
  13945. var r = new X
  13946. , o = new Q({
  13947. concurrentDownloads: n
  13948. })
  13949. , a = new J
  13950. , s = new x
  13951. , l = new w
  13952. , c = new b(t)
  13953. , h = new T
  13954. , u = new S(i)
  13955. , d = new M
  13956. , p = new K;
  13957. return {
  13958. qualityManager: r,
  13959. panoRenderer: a,
  13960. tileDownloader: o,
  13961. player: c,
  13962. director: l,
  13963. modelManager: s,
  13964. tagManager: p,
  13965. displayController: u,
  13966. labelDisplayController: d,
  13967. controls: h
  13968. }
  13969. }(o, s.mode),
  13970. l = m.controls,
  13971. c = m.player,
  13972. h = m.director,
  13973. u = m.tagManager,
  13974. p = m.tileDownloader,
  13975. f = m.qualityManager,
  13976. m.panoRenderer,
  13977. function(e, t, i, n) {
  13978. var r = i.controls
  13979. , o = i.qualityManager
  13980. , a = i.panoRenderer
  13981. , s = i.tileDownloader
  13982. , l = i.modelManager;
  13983. r.init(n, l),
  13984. j.init(i.director, r, i.player, l, t),
  13985. o.init(l),
  13986. s.init(o),
  13987. a.init(t, s, o),
  13988. l.init(s, a, o),
  13989. l.addModel(e),
  13990. t.addComponent(F)
  13991. }(g, d, m, r),
  13992. c.director = h,
  13993. g.supportsTiles && p.start(),
  13994. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  13995. o = !1);
  13996. var e = null;
  13997. if (o) {
  13998. ne.warn("Quickstart engaged. Hold on to your knickers.");
  13999. var t = l.controls[R.PANORAMA];
  14000. a = new q(f,d.scene,d.camera,t,r),
  14001. C(d, r, g),
  14002. e = a.load(s).then(function() {
  14003. d.addComponent(a),
  14004. d.once(ee.AfterRender, function() {
  14005. ne.warn("First render after quickstart load finished.")
  14006. })
  14007. })
  14008. }
  14009. return window.flyToFirst = function() {
  14010. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14011. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14012. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14013. c.flyToPano({
  14014. pano: e,
  14015. lookAtPoint: i
  14016. })
  14017. }
  14018. ,
  14019. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14020. }).then(function() {
  14021. return function(e, t, i, n, r) {
  14022. return r.progressCallback = t,
  14023. N.sessionStart(),
  14024. e.load(n).progress(function(e, t) {
  14025. e.modelElementsToLoad = t[1],
  14026. function(e) {
  14027. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14028. }(e),
  14029. function(e) {
  14030. e.totalElementsLoaded++,
  14031. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14032. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14033. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14034. console.log("pro:" + e.totalPercentageLoaded),
  14035. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14036. }(e)
  14037. }
  14038. .bind(this, r))
  14039. }(g, D.onProgress, 0, !o, n)
  14040. }).then(function() {
  14041. s.quickstart = o,
  14042. function(e, t, i, n) {
  14043. var r = i.qualityManager
  14044. , o = i.panoRenderer
  14045. , a = i.tileDownloader
  14046. , s = i.modelManager
  14047. , l = i.player
  14048. , c = i.director
  14049. , h = i.tagManager
  14050. , u = i.displayController
  14051. , d = i.labelDisplayController
  14052. , p = i.controls;
  14053. t.scene.add(e),
  14054. t.qualityManager = r;
  14055. var f = {
  14056. camera: t.camera,
  14057. director: c,
  14058. modelManager: s,
  14059. tileDownloader: a,
  14060. panoRenderer: o,
  14061. qualityManager: r,
  14062. tagManager: h,
  14063. container: n,
  14064. controls: p
  14065. };
  14066. l.init(f),
  14067. l.setScene(t.scene),
  14068. h.init(s, l),
  14069. c.init(l, s),
  14070. u.init(c, l, s, h, n),
  14071. d.init(l, s, n),
  14072. B.bindEvents(l),
  14073. t.addComponent(h),
  14074. t.addComponent(l),
  14075. t.addComponent(o),
  14076. l.sceneRenderer = t
  14077. }(g, d, m, r),
  14078. d.started || C(d, r, g),
  14079. N.modelLoaded(g, c, l, L.autoplay),
  14080. function(e, t, i, n) {
  14081. return ne.info("Starting player in " + i.mode),
  14082. N.report(t.sid, "started-playing", n, i.quickstart),
  14083. e.start(i)
  14084. }(c, g, s, L.autoplay).done(function() {
  14085. h.autoTour()
  14086. }),
  14087. g.supportsTiles || new H(g,c).start();
  14088. o && (d.removeComponent(a),
  14089. a.destroy(),
  14090. s.pano.enter()),
  14091. D.init(g, h, c, l, d, s, N.getSessionId()),
  14092. D.endLoading(g, h, u),
  14093. d.once(ee.AfterRender, function() {
  14094. v.setAppReadyTime();
  14095. var e = v.calcFullLoadingTime();
  14096. ne.warn("Total load time: " + e / 1e3),
  14097. N.loadComplete(e),
  14098. ne.warn("First render after model load finished.")
  14099. }),
  14100. d.on(ee.MemoryUsageUpdated, y)
  14101. }).fail(A.bind(this, e))
  14102. }()
  14103. }()
  14104. })
  14105. }
  14106. ).call(this, "/js/main.js")
  14107. }
  14108. , {
  14109. "./DisplayController": 1,
  14110. "./TimingData": 2,
  14111. "./ab": 3,
  14112. "./analytics": 4,
  14113. "./cameras/PanoramaCamera": 7,
  14114. "./controls/CameraControls": 9,
  14115. "./director": 15,
  14116. "./effects": 16,
  14117. "./enum/PanoSizeClass": 36,
  14118. "./enum/PanoramaEvents": 37,
  14119. "./enum/RenderLayers": 41,
  14120. "./enum/SceneRendererEvents": 43,
  14121. "./enum/Viewmode": 51,
  14122. "./featureflags": 59,
  14123. "./gui/error": 64,
  14124. "./gui/gui": 65,
  14125. "./gui/memoryUsage": 73,
  14126. "./label/LabelDisplayController": 91,
  14127. "./lib/array-polyfill": 92,
  14128. "./lib/performance-polyfill": 95,
  14129. "./lib/postprocessing/EffectComposer.js": 96,
  14130. "./lib/postprocessing/MaskPass.js": 97,
  14131. "./lib/postprocessing/RenderPass.js": 98,
  14132. "./lib/postprocessing/ShaderPass.js": 99,
  14133. "./lib/shaders/CopyShader.js": 100,
  14134. "./lib/shaders/HorizontalBlurShader.js": 101,
  14135. "./lib/shaders/VerticalBlurShader.js": 102,
  14136. "./lib/three75-shim": 103,
  14137. "./localization/localize": 108,
  14138. "./tag/tagManager": 124,
  14139. "./model/ModelManager": 140,
  14140. "./objects/Panorama": 148,
  14141. "./objects/Skybox": 152,
  14142. "./player": 155,
  14143. "./preloaders": 156,
  14144. "./scene/QuickstartManager": 157,
  14145. "./scene/SceneRenderer": 158,
  14146. "./sdk/automation.js": 164,
  14147. "./settings": 166,
  14148. "./showcase": 168,
  14149. "./tile/PanoRenderer": 169,
  14150. "./tile/QualityManager.js": 170,
  14151. "./tile/TileDownloader": 171,
  14152. "./util/PanoramaCollection": 178,
  14153. "./util/ajax": 181,
  14154. "./util/browser": 182,
  14155. "./util/camera": 183,
  14156. "./util/common": 185,
  14157. "./util/lerp": 188,
  14158. "./util/logger": 189,
  14159. "./util/math": 190,
  14160. "./util/sentry": 192,
  14161. "./util/showcase": 193,
  14162. "./util/transitions": 195,
  14163. events: 202,
  14164. "promise-polyfill": 213,
  14165. three: 217
  14166. }],
  14167. 117: [function(e, t, i) {
  14168. "use strict";
  14169. function n(e) {
  14170. e = e || {},
  14171. r.RawShaderMaterial.call(this, a.extendObject({
  14172. fragmentShader: o.cube.fragmentShader,
  14173. vertexShader: o.cube.vertexShader,
  14174. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14175. name: "CubemapMaterial"
  14176. }, e))
  14177. }
  14178. var r = e("three")
  14179. , o = e("../shaders")
  14180. , a = e("../util/common");
  14181. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14182. t.exports = n
  14183. }
  14184. , {
  14185. "../shaders": 167,
  14186. "../util/common": 185,
  14187. three: 217
  14188. }],
  14189. 118: [function(e, t, i) {
  14190. "use strict";
  14191. function n(e) {
  14192. e = e || {},
  14193. r.RawShaderMaterial.call(this, a.extendObject({
  14194. fragmentShader: o.model.fragmentShader,
  14195. vertexShader: o.model.vertexShader,
  14196. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14197. name: "ModelTextureMaterial"
  14198. }, e))
  14199. }
  14200. var r = e("three")
  14201. , o = e("../shaders")
  14202. , a = e("../util/common");
  14203. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14204. i && (this.uniforms.progress.value = 0),
  14205. e.ensureSkyboxReadyForRender(),
  14206. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14207. this.uniforms.pano0Position.value.copy(e.position),
  14208. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14209. t.ensureSkyboxReadyForRender(),
  14210. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14211. this.uniforms.pano1Position.value.copy(t.position),
  14212. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14213. }
  14214. ,
  14215. t.exports = n
  14216. }
  14217. , {
  14218. "../shaders": 167,
  14219. "../util/common": 185,
  14220. three: 217
  14221. }],
  14222. 119: [function(m, v, e) {
  14223. (function(e) {
  14224. "use strict";
  14225. function t(e, t, i, n) {
  14226. this.div = null,
  14227. this.body = null,
  14228. this.label = e,
  14229. this.description = t,
  14230. this.parsedDescription = [],
  14231. this.media = i || {
  14232. type: null
  14233. },
  14234. this.loadingSpinner = null,
  14235. this.parser = new r({
  14236. supportLinks: !c.valueFromHash("mls"),
  14237. keepLinkLabels: !0
  14238. }),
  14239. this.state = g.CLOSED,
  14240. this.orientation = "",
  14241. this.initialTransform = "",
  14242. this.hovering = !1,
  14243. this.openTransition = null,
  14244. this.closeTransition = null,
  14245. this.openPromise = null,
  14246. this.closePromise = null,
  14247. this.animationTransition = null,
  14248. this.animationScale = 0
  14249. }
  14250. var r = m("../Parser/DescriptionParser")
  14251. , i = m("../Media/Link")
  14252. , n = m("../Media/Image")
  14253. , o = m("../Media/EmbedlyPlayer")
  14254. , a = m("../Media/EmbedlyEmbed")
  14255. , s = m("../../util/transitions")
  14256. , l = m("../../util/lerp")
  14257. , c = m("../../util/browser")
  14258. , b = m("./BillboardEvent")
  14259. , w = m("../Media/MediaEvent")
  14260. , h = m("../Parser/DescriptionChunkType")
  14261. , u = m("events").EventEmitter
  14262. , d = m("./billboardSettings")
  14263. , T = m("./overlaySettings")
  14264. , p = new (m("../../util/logger"))(e)
  14265. , f = document.getElementById("tag-billboards");
  14266. f.addEventListener("touchend", function(e) {
  14267. f.style.pointerEvents = "none"
  14268. }),
  14269. f.addEventListener("touchcancel", function(e) {
  14270. f.style.pointerEvents = "none"
  14271. });
  14272. var g = {
  14273. CLOSED: "closed",
  14274. OPENING: "opening",
  14275. OPEN: "open",
  14276. CLOSING: "closing",
  14277. ACTIVE: "active"
  14278. };
  14279. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14280. this.parsedDescription = this.parser.parse(this.description);
  14281. var t = document.createElement("div");
  14282. t.className = "tag-container has-hotzone",
  14283. this.div = t,
  14284. this.body = document.createElement("div"),
  14285. this.body.className = "tag-body";
  14286. var i = document.createElement("div");
  14287. i.classList.add("tag-content");
  14288. var n = document.createElement("div");
  14289. n.classList.add("tag-text-content");
  14290. var r = document.createElement("div");
  14291. r.className = "tag-label",
  14292. r.textContent = this.label,
  14293. n.appendChild(r);
  14294. var o = document.createElement("div");
  14295. o.className = "tag-desc",
  14296. n.appendChild(o),
  14297. i.appendChild(n),
  14298. this.body.appendChild(i),
  14299. this.appendDescriptionElements(this.parsedDescription, o),
  14300. this.appendMedia(),
  14301. t.appendChild(this.body),
  14302. f.appendChild(t),
  14303. this.bindEvents(t, this.body)
  14304. }
  14305. ,
  14306. t.prototype.bindEvents = function(i, e) {
  14307. function t(n) {
  14308. return function(e) {
  14309. if (!this.div.classList.contains("overlay")) {
  14310. var t, i = document.getElementById("player");
  14311. try {
  14312. t = new MouseEvent(n,e)
  14313. } catch (i) {
  14314. (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)
  14315. }
  14316. i.dispatchEvent(t)
  14317. }
  14318. }
  14319. }
  14320. e.addEventListener("mousedown", function(e) {
  14321. e.stopPropagation()
  14322. }),
  14323. e.addEventListener("mouseup", function(e) {
  14324. e.stopPropagation()
  14325. }),
  14326. i.addEventListener("touchstart", function(e) {
  14327. f.style.pointerEvents = "auto"
  14328. }),
  14329. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14330. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14331. e.addEventListener("mouseover", function(e) {
  14332. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14333. }
  14334. .bind(this)),
  14335. i.addEventListener("mouseenter", function(e) {
  14336. this.state !== g.CLOSING && (this.hovering = !0,
  14337. this.emit(b.ENTER))
  14338. }
  14339. .bind(this)),
  14340. i.addEventListener("mouseleave", function(e) {
  14341. this.hovering = !1,
  14342. this.emit(b.LEAVE)
  14343. }
  14344. .bind(this)),
  14345. i.addEventListener("gesturestart", function(e) {
  14346. e.preventDefault()
  14347. });
  14348. var n = i.querySelector(".tag-text-content")
  14349. , r = 0;
  14350. n.addEventListener("touchstart", function(e) {
  14351. r = e.changedTouches[0].clientY
  14352. }),
  14353. n.addEventListener("touchmove", function(t) {
  14354. function e(e) {
  14355. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14356. }
  14357. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14358. }),
  14359. i.addEventListener("touchmove", function(e) {
  14360. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14361. })
  14362. }
  14363. ,
  14364. t.prototype.appendDescriptionElements = function(e, i) {
  14365. 0 < e.length && this.div.classList.add("has-text"),
  14366. e.forEach(function(e, t) {
  14367. switch (e.type) {
  14368. case h.TEXT:
  14369. i.appendChild(this.createTextElement(e.text));
  14370. break;
  14371. case h.LINK:
  14372. i.appendChild(this.createLinkElement(e.link))
  14373. }
  14374. }
  14375. .bind(this))
  14376. }
  14377. ,
  14378. t.prototype.appendLoadingSpinner = function() {
  14379. this.loadingSpinner = document.createElement("div"),
  14380. this.loadingSpinner.classList.add("loading-spinner");
  14381. var e = document.createElement("div");
  14382. e.classList.add("gui-spinner-icon"),
  14383. this.loadingSpinner.appendChild(e),
  14384. this.body.appendChild(this.loadingSpinner)
  14385. }
  14386. ,
  14387. t.prototype.onMediaLoadFinished = function() {
  14388. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14389. this.applyOrientation(this.orientation),
  14390. this.loadingSpinner = null)
  14391. }
  14392. ,
  14393. t.prototype.appendMedia = function() {
  14394. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14395. this.appendLoadingSpinner();
  14396. var e = document.createElement("div");
  14397. e.classList.add("tag-media-content");
  14398. var t = document.createElement("i");
  14399. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14400. t.classList.add(e)
  14401. }),
  14402. this.body.appendChild(t),
  14403. this.body.appendChild(e),
  14404. this.media.type) {
  14405. case h.IMAGE:
  14406. e.appendChild(this.createImageElement(this.media, this.body));
  14407. break;
  14408. case h.VIDEO:
  14409. e.appendChild(this.createVideoElement(this.media, this.body));
  14410. break;
  14411. case h.RICH:
  14412. e.appendChild(this.createEmbedElement(this.media, this.body))
  14413. }
  14414. }
  14415. }
  14416. ,
  14417. t.prototype.createTextElement = function(e) {
  14418. var t = document.createElement("span");
  14419. return t.textContent = e,
  14420. t
  14421. }
  14422. ,
  14423. t.prototype.createLinkElement = function(e) {
  14424. var t = new i(e);
  14425. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14426. t.createDomElement()
  14427. }
  14428. ,
  14429. t.prototype.createImageElement = function(t, C) {
  14430. function e() {
  14431. function e() {
  14432. p || (E.classList.remove("view-image"),
  14433. a.classList.add("overlay"),
  14434. t(),
  14435. window.addEventListener("resize", A),
  14436. a.addEventListener("click", i),
  14437. c.addEventListener("click", r),
  14438. o.addEventListener("click", n),
  14439. p = !0,
  14440. _.emit(w.IMAGE_OPENED))
  14441. }
  14442. function t() {
  14443. C.classList.add("show-info"),
  14444. s.classList.remove("collapsible"),
  14445. s.style.height = "";
  14446. var e = parseFloat(getComputedStyle(v).lineHeight)
  14447. , t = g + e
  14448. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14449. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14450. , r = n
  14451. , o = r * I.aspect;
  14452. i < o && (r = (o = i) / I.aspect),
  14453. n < r && (o = (r = n) * I.aspect),
  14454. o += m,
  14455. r += m + t,
  14456. C.style.width = o + "px",
  14457. C.style.height = r + "px",
  14458. l.style.paddingTop = e + m + "px",
  14459. 0 < _.description.length && (s.classList.add("collapsible"),
  14460. s.style.height = s.clientHeight + 12 + "px",
  14461. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14462. }
  14463. function i(e) {
  14464. e.target === a && n()
  14465. }
  14466. function n() {
  14467. p && (p = !1,
  14468. E.classList.add("view-image"),
  14469. a.classList.remove("overlay"),
  14470. s.style.height = "",
  14471. l.style.paddingTop = "",
  14472. C.style.width = "",
  14473. C.style.height = "",
  14474. window.removeEventListener("resize", A),
  14475. a.removeEventListener("click", i),
  14476. c.removeEventListener("click", r),
  14477. o.removeEventListener("click", n),
  14478. _.emit(w.IMAGE_CLOSED),
  14479. _.close(!0))
  14480. }
  14481. function r(e) {
  14482. C.classList.toggle("show-info")
  14483. }
  14484. var a = _.div
  14485. , s = a.getElementsByClassName("tag-content")[0]
  14486. , l = a.getElementsByClassName("tag-media-content")[0]
  14487. , o = C.getElementsByClassName("close")[0]
  14488. , c = s.getElementsByClassName("tag-label")[0];
  14489. a.classList.add("has-image"),
  14490. E.classList.add("view-image"),
  14491. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14492. _.applyOrientation(_.orientation);
  14493. 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,
  14494. function() {
  14495. clearInterval(h),
  14496. clearTimeout(u),
  14497. h = setInterval(function() {
  14498. var e = a.clientHeight;
  14499. d !== e && (t(),
  14500. d = e)
  14501. }, 100),
  14502. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14503. }
  14504. );
  14505. I.on(w.IMAGE_OPENING, e),
  14506. _.on(b.ACTIVATE, e),
  14507. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14508. _.on(b.CLOSING, n)
  14509. }
  14510. var I = new n
  14511. , E = I.createDomElement();
  14512. this.once(b.OPENED, function() {
  14513. I.load(t.src).then(e).catch(function(e) {
  14514. p.warn("Failed to load image:", t.src),
  14515. p.warn("with error:", e)
  14516. }).then(this.onMediaLoadFinished.bind(this))
  14517. });
  14518. var _ = this;
  14519. return E
  14520. }
  14521. ,
  14522. t.prototype.createVideoElement = function(t, e) {
  14523. var i = new o({
  14524. autoPlay: !0,
  14525. autoResume: !0,
  14526. startMuted: !1,
  14527. loop: !1
  14528. })
  14529. , n = i.createDomElement();
  14530. return this.once(b.OPENED, function() {
  14531. i.load(t.src).then(function() {
  14532. this.div.classList.add("has-video"),
  14533. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14534. i.play()),
  14535. this.on(b.OPENING, i.show.bind(i)),
  14536. this.on(b.OPENED, i.play.bind(i)),
  14537. this.on(b.CLOSING, i.pause.bind(i)),
  14538. this.on(b.CLOSED, i.hide.bind(i))
  14539. }
  14540. .bind(this)).catch(function(e) {
  14541. p.warn("Failed to embed video:", t.src),
  14542. p.warn("with error:", e)
  14543. }).then(this.onMediaLoadFinished.bind(this))
  14544. }
  14545. .bind(this)),
  14546. n
  14547. }
  14548. ,
  14549. t.prototype.createEmbedElement = function(t, e) {
  14550. var i = new a
  14551. , n = i.createDomElement();
  14552. return this.once(b.OPENED, function() {
  14553. i.load(t.src).then(function() {
  14554. this.div.classList.add("has-embed"),
  14555. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14556. this.applyOrientation(this.orientation),
  14557. this.on(b.OPENING, i.show.bind(i)),
  14558. this.on(b.CLOSED, i.hide.bind(i))
  14559. }
  14560. .bind(this)).catch(function(e) {
  14561. p.warn("Failed to embed:", t.src),
  14562. p.warn("with error:", e)
  14563. }).then(this.onMediaLoadFinished.bind(this))
  14564. }
  14565. .bind(this)),
  14566. n
  14567. }
  14568. ,
  14569. t.prototype.open = function(e) {
  14570. return this.openPromise = $.Deferred(),
  14571. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14572. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14573. this.state !== g.OPEN && (this.emit(b.OPENING),
  14574. e && this.emit(b.ACTIVATING),
  14575. this.state = g.OPENING,
  14576. this.animateOpen(function() {
  14577. e && this.setActiveState(),
  14578. this.openPromise.resolve()
  14579. }
  14580. .bind(this)))
  14581. }
  14582. .bind(this), d.animation.openDelay),
  14583. s.cancel(this.closeTransition),
  14584. this.closePromise && this.closePromise.reject(),
  14585. this.closeTransition = void 0,
  14586. this.openPromise.promise())
  14587. }
  14588. ,
  14589. t.prototype.close = function(e) {
  14590. return this.closePromise = $.Deferred(),
  14591. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14592. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14593. this.state = g.CLOSING,
  14594. this.animateClose())
  14595. }
  14596. .bind(this), d.animation.closeDelay)),
  14597. s.cancel(this.openTransition),
  14598. this.openPromise && this.openPromise.reject(),
  14599. this.openTransition = void 0,
  14600. this.closePromise.resolve(),
  14601. this.closePromise.promise())
  14602. }
  14603. ,
  14604. t.prototype.setActiveState = function() {
  14605. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14606. this.emit(b.ACTIVATE),
  14607. this.div.classList.remove("has-hotzone"))
  14608. }
  14609. ,
  14610. t.prototype.animateOpen = function(e) {
  14611. if (this.state === g.OPENING) {
  14612. if (s.cancel(this.animationTransition),
  14613. c.detectSamsungNative())
  14614. return this.boardOrientation = null,
  14615. this.div.style.visibility = "visible",
  14616. this.emit(b.OPENED),
  14617. this.state = g.OPEN,
  14618. void (e && e());
  14619. this.div.style.webkitTransform = "scale(0)",
  14620. this.div.style.transform = "scale(0)",
  14621. this.div.style.visibility = "visible",
  14622. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  14623. this.emit(b.OPENED),
  14624. this.state = g.OPEN,
  14625. e && e()
  14626. }
  14627. .bind(this))
  14628. }
  14629. }
  14630. ,
  14631. t.prototype.animateClose = function(e) {
  14632. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  14633. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  14634. this.emit(b.CLOSED),
  14635. this.state = g.CLOSED,
  14636. this.div.style.visibility = "hidden",
  14637. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14638. e && e()
  14639. }
  14640. .bind(this)))
  14641. }
  14642. ,
  14643. t.prototype.needsUpdate = function() {
  14644. return this.state !== g.CLOSED
  14645. }
  14646. ,
  14647. t.prototype.update = function(e, t) {
  14648. if (this.needsUpdate()) {
  14649. var i = (this.updateOrientation(e),
  14650. this.calcScale(t))
  14651. , n = {
  14652. x: (e.x + 1) * $("#player").width() / 2,
  14653. y: (e.y + 1) * $("#player").height() / 2
  14654. };
  14655. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  14656. this.div.style.webkitTransform = this.div.screenTransform,
  14657. this.div.style.transform = this.div.screenTransform
  14658. }
  14659. }
  14660. ,
  14661. t.prototype.getDimensions = function() {
  14662. return this.div.getBoundingClientRect()
  14663. }
  14664. ,
  14665. t.prototype.calcScale = function(e) {
  14666. return Math.sqrt(e / 40) * d.boardToDiscRatio
  14667. }
  14668. ,
  14669. t.prototype.updateOrientation = function(e) {
  14670. if (this.state !== g.ACTIVE) {
  14671. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  14672. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  14673. , n = "";
  14674. n += 0 == i ? "right" : 2 == i ? "left" : "",
  14675. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  14676. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  14677. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  14678. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  14679. }
  14680. }
  14681. ,
  14682. t.prototype.applyOrientation = function(e) {
  14683. this.div.style.transform = this.div.style.webkitTransform = "",
  14684. this.div.classList.remove("tag-container-" + this.orientation),
  14685. this.div.classList.add("tag-container-" + e);
  14686. var t = window.getComputedStyle(this.div);
  14687. this.initialTransform = t.transform || t.webkitTransform,
  14688. "none" === this.initialTransform && (this.initialTransform = "");
  14689. var i = t.transform.slice(7, -1).split(",")
  14690. , n = -i[4]
  14691. , r = -i[5];
  14692. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  14693. this.div.style.transformOrigin = n + "px " + r + "px",
  14694. this.orientation = e
  14695. }
  14696. ,
  14697. v.exports = t
  14698. }
  14699. ).call(this, "/js/tag/Billboard/Billboard.js")
  14700. }
  14701. , {
  14702. "../../util/browser": 182,
  14703. "../../util/lerp": 188,
  14704. "../../util/logger": 189,
  14705. "../../util/transitions": 195,
  14706. "../Media/EmbedlyEmbed": 125,
  14707. "../Media/EmbedlyPlayer": 126,
  14708. "../Media/Image": 128,
  14709. "../Media/Link": 129,
  14710. "../Media/MediaEvent": 131,
  14711. "../Parser/DescriptionChunkType": 133,
  14712. "../Parser/DescriptionParser": 134,
  14713. "./BillboardEvent": 120,
  14714. "./billboardSettings": 121,
  14715. "./overlaySettings": 122,
  14716. events: 202
  14717. }],
  14718. 120: [function(e, t, i) {
  14719. "use strict";
  14720. t.exports = Object.freeze({
  14721. ENTER: "billboard.enter",
  14722. LEAVE: "billboard.leave",
  14723. OPENING: "billboard.opening",
  14724. OPENED: "billboard.open",
  14725. CLOSING: "billboard.closing",
  14726. CLOSED: "billboard.closed",
  14727. ACTIVATING: "billboard.activating",
  14728. ACTIVATE: "billboard.activate"
  14729. })
  14730. }
  14731. , {}],
  14732. 121: [function(e, t, i) {
  14733. "use strict";
  14734. t.exports = Object.freeze({
  14735. animation: Object.freeze({
  14736. hoverOnClosing: !1,
  14737. openDelay: 100,
  14738. closeDelay: 50,
  14739. openDuration: 200,
  14740. closeDuration: 100
  14741. }),
  14742. boardToDiscRatio: 1.2
  14743. })
  14744. }
  14745. , {}],
  14746. 122: [function(e, t, i) {
  14747. "use strict";
  14748. t.exports = Object.freeze({
  14749. boundaryWidth: 30,
  14750. boundaryHeight: 0
  14751. })
  14752. }
  14753. , {}],
  14754. hot: [function(e, t, i) {
  14755. "use strict";
  14756. function n(e, t, i) {
  14757. this.sid = e,
  14758. this.position = this.conversionArray(t.position)
  14759. if(t.quaternion){
  14760. this.quaternion = t.quaternion;
  14761. }else{
  14762. this.rotation = this.conversionArray(t.rotation)
  14763. }
  14764. this.link = t.link,
  14765. this.model = i,
  14766. this.size = t.size;
  14767. console.log(t.position)
  14768. this.styleTex = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
  14769. this.build()
  14770. this.changeTex()
  14771. }
  14772. var g = e("three")
  14773. , r = e("../shaders")
  14774. , m = e("../settings")
  14775. , v = e("../enum/Viewmode")
  14776. , d = e("../objects/Panorama")
  14777. , o = e("../util/texture")
  14778. , p = new g.Raycaster
  14779. , a = new g.PlaneBufferGeometry(g_HotMeshSize.g_HotMeshWidth,g_HotMeshSize.g_HotMeshHeight,1,1)
  14780. var defaultTex1 = o.load(g_HotImage.point);
  14781. var defaultTex2 = o.load(g_HotImage.point2)
  14782. n.prototype.changeTex = function(){
  14783. var u = this.mesh.material.uniforms
  14784. if(this.styleTex.length){
  14785. u.texture1.value = o.load(this.styleTex[0].src);
  14786. u.texture2.value = o.load(this.styleTex[1]&&this.styleTex[1].src || this.styleTex[0].src);
  14787. }else{
  14788. u.texture1.value = defaultTex1;
  14789. u.texture2.value = defaultTex2;
  14790. }
  14791. }
  14792. n.prototype.initStyleImg = function(t){
  14793. this.styleTex = []
  14794. t.styleImg = t.styleImg || [];
  14795. t.styleImg.forEach((src)=>{
  14796. this.styleTex.push({src:src})
  14797. })
  14798. this.changeTex()
  14799. }
  14800. n.prototype.build = function() {
  14801. var t = g.UniformsUtils.clone(r.hot.uniforms);
  14802. var e = new g.Mesh(a, new g.ShaderMaterial({
  14803. uniforms: t,
  14804. vertexShader: r.hot.vertexShader,
  14805. fragmentShader: r.hot.fragmentShader,
  14806. transparent: !0
  14807. }))
  14808. , t = parseFloat(window.MP_PREFETCHED_MODELDATA.hotIconScale);
  14809. e.dynamic = !0,
  14810. e.position.copy((new g.Vector3).fromArray(this.position));
  14811. if(this.quaternion){
  14812. e.quaternion.copy(this.quaternion)
  14813. }else{
  14814. e.rotation.copy((new g.Euler).fromArray(this.rotation));
  14815. }
  14816. t && e.scale.set(t, t, t),
  14817. e.name = this.sid,
  14818. e.type = "hotSprite",
  14819. (e.belongHot = this).link && (e.hotLink = this.link),
  14820. this.mesh = e,
  14821. this.model.add(e),
  14822. g_HotMeshes.push(e);
  14823. }
  14824. ,
  14825. n.prototype.closestPanoTowardTag = function(e, t) {
  14826. var i = []
  14827. , n = []
  14828. , r = this.mesh.position;
  14829. if (e === v.PANORAMA) {
  14830. var o = t.position.clone().sub(r).normalize();
  14831. n.push(d.scoreFunctions.direction(r, o))
  14832. }
  14833. var a = new g.Vector3;
  14834. i.push(function(e) {
  14835. return Math.abs(e.position.x - r.x) > m.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > m.tags.visibility.cameraClearance
  14836. }, function(e) {
  14837. a.copy(r).sub(e.position);
  14838. var t = -g.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  14839. , i = m.tags.navigate.tiltTolerance;
  14840. return m.insideLookLimitDown - i < t && t < m.insideLookLimitUp + i
  14841. },
  14842. (pano)=>{ // add
  14843. player.checkHasNeighbor(pano)
  14844. }
  14845. ),
  14846. n.push(d.scoreFunctions.distanceSquared(this.mesh, -2));
  14847. var s = t.model.panos.sortByScore(i, n);
  14848. if (s && m.tags.navigate.lineOfSight) {
  14849. for (var l = 0; l < s.length; l++) {
  14850. var c = s[l].pano
  14851. , h = c.position.distanceTo(r);
  14852. p.set(c.position, r.clone().sub(c.position).normalize());
  14853. var u = p.intersectObjects(t.model.colliders);
  14854. if (0 === u.length || u[0].distance > h)
  14855. return console.log(l),
  14856. c
  14857. }
  14858. return null
  14859. }
  14860. return s && 0 < s.length && s[0].pano
  14861. }
  14862. ,
  14863. n.prototype.examine = function(e, options) {
  14864. var i = document.getElementById("popup");
  14865. options = options || {}
  14866. if (this.link && !options.dontOpen) {
  14867. g_currentHot = this,
  14868. i.style.display = "block",
  14869. i.classList.add("wait");
  14870. var n = document.createElement("iframe");
  14871. if(g_bgAudio && !g_bgAudio.paused){
  14872. manage.switchBgmState(false);
  14873. g_bgAudio.pauseByHot = true
  14874. }
  14875. if(g_tourAudio)g_tourAudio.pause()
  14876. var r = this.link.substring(this.link.indexOf("html") + 4)
  14877. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";
  14878. -1 == r.indexOf("?") ? n.src = this.link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : n.src = this.link + "&time=" + randomTime().getTime() + "&id=" + window.number + o,
  14879. n.id = "id1",
  14880. n.allowTransparency = "true";
  14881. var a = document.getElementById("id1");
  14882. if (void 0 === a || null == a) {
  14883. document.querySelector(".popup-content").appendChild(n);
  14884. var s = !1;
  14885. window.loaddingSuccess = function() {
  14886. s = !0
  14887. }
  14888. ,
  14889. setTimeout(function e() {
  14890. if (s) {
  14891. var t = document.querySelector("#id1").contentWindow.document;
  14892. t.querySelector("video") && (t.querySelector("video").play(),
  14893. !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")),
  14894. t.querySelector("audio") && t.querySelector("audio").play()
  14895. } else
  14896. setTimeout(e, 300)
  14897. }, 800)
  14898. }
  14899. }
  14900. var l = e.mode
  14901. , c = m.tags.navigate.nearestPano && this.closestPanoTowardTag(l, e.currentPano) || e.currentPano
  14902. , h = this.mesh.position;
  14903. e.flyingToTag = !0;
  14904. var u = function() {
  14905. e.flyingToTag = !1;
  14906. options.dontOpen || this.link && i.classList.remove("wait")
  14907. }
  14908. .bind(this);
  14909. if (l === v.PANORAMA) {
  14910. var d = {
  14911. pano: c,
  14912. lookAtPoint: h,
  14913. duration: null,
  14914. maxDistanceOverride: null,
  14915. skipWarpingCheck: !1
  14916. };
  14917. e.flyToPano(d, u)
  14918. } else {
  14919. var p = {
  14920. pano: c
  14921. };
  14922. if (h) {
  14923. var f = (new g.Matrix4).lookAt(c.position, h, new g.Vector3(0,1,0));
  14924. p.quaternion = (new g.Quaternion).setFromRotationMatrix(f)
  14925. }
  14926. p.callback = u,
  14927. p.duration = 1500,
  14928. p.mode = v.PANORAMA,
  14929. e.flyToNewMode(p)
  14930. }
  14931. }
  14932. ,
  14933. n.prototype.conversionArray = function(e) {
  14934. if ("[object Array]" == Object.prototype.toString.call(e))
  14935. return e;
  14936. var t = [];
  14937. for (var i in e)
  14938. t.push(parseFloat(e[i]));
  14939. return t
  14940. }
  14941. ,
  14942. t.exports = n
  14943. }
  14944. , {
  14945. three: 217,
  14946. "../shaders": 167,
  14947. "../enum/Viewmode": 51,
  14948. "../objects/Panorama": 148,
  14949. "../util/texture": 194,
  14950. "../settings": 166
  14951. }],
  14952. 123: [function(M, R, e) {
  14953. (function(e) {
  14954. "use strict";
  14955. function d(e, t, i) {
  14956. var n = i.version || "0";
  14957. "0" !== n && w.info("tag defined using version " + n),
  14958. this.model = e,
  14959. this.sid = t,
  14960. this.color = (new f.Color).set(i.color || o.tagDefault),
  14961. this.hoverColor = o._darken(this.color, .2),
  14962. this.floor = null,
  14963. this.floorIndex = i.floor,
  14964. this.mode = m.PANORAMA,
  14965. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  14966. this.obj3d = null,
  14967. this.disc = null,
  14968. this.materials = {
  14969. disc: null,
  14970. pole: null
  14971. },
  14972. this.position = (new f.Vector3).copy(i.position),
  14973. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  14974. this.discWorldPosition = null,
  14975. this.discScale = .05,
  14976. this.poleEnabled = i.stem.enabled,
  14977. this.billboard = new r(i.label,i.description,i.media,this),
  14978. this.visibleTransition = null,
  14979. this.hoveringDisc = !1
  14980. }
  14981. 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"),
  14982. 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);
  14983. d.prototype = Object.create(b.prototype),
  14984. d.raycaster = new f.Raycaster,
  14985. d.prototype.bindEvents = function() {
  14986. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  14987. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  14988. }
  14989. ,
  14990. d.prototype.build = function() {
  14991. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  14992. this.floor && (this.billboard.build(this.model.sid),
  14993. this.obj3d = this.buildObject3D(),
  14994. this.floor.add(this.obj3d)),
  14995. this
  14996. }
  14997. ,
  14998. d.prototype.buildObject3D = function() {
  14999. var e = new f.Object3D;
  15000. e.position.copy(this.position);
  15001. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15002. t.bg.value = x,
  15003. t.mask.value = T,
  15004. t.color.value.copy(this.color),
  15005. this.materials.disc = new f.RawShaderMaterial({
  15006. transparent: !0,
  15007. vertexShader: A.tagDisc.vertexShader,
  15008. fragmentShader: A.tagDisc.fragmentShader,
  15009. uniforms: t
  15010. }),
  15011. this.disc = new f.Mesh(S,this.materials.disc),
  15012. this.disc.layers.set(a.TAG),
  15013. this.disc.position.copy(this.discPosition),
  15014. this.disc.renderOrder = s.tagDisc;
  15015. var i = (this.disc.tag = this).buildPole();
  15016. return i.layers.set(a.TAG),
  15017. i.renderOrder = s.tagStem,
  15018. e.add(i),
  15019. e.layers.set(a.TAG),
  15020. e.add(this.disc)
  15021. }
  15022. ,
  15023. d.prototype.buildPole = function() {
  15024. var e = new f.BufferGeometry
  15025. , t = new Float32Array(6);
  15026. return t[0] = t[1] = t[2] = 0,
  15027. t[3] = this.discPosition.x,
  15028. t[4] = this.discPosition.y,
  15029. t[5] = this.discPosition.z,
  15030. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15031. this.materials.pole = new f.LineBasicMaterial({
  15032. linewidth: g.tags.pole.width,
  15033. color: g.tags.pole.color,
  15034. opacity: 0,
  15035. visible: this.poleEnabled,
  15036. transparent: !0,
  15037. depthWrite: !1
  15038. }),
  15039. new f.Line(e,this.materials.pole)
  15040. }
  15041. ,
  15042. d.prototype.setFreeState = function(e) {
  15043. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15044. this.materials.disc.uniforms.color.value = this.color
  15045. }
  15046. .bind(this))
  15047. }
  15048. ,
  15049. d.prototype.setHoverState = function(e) {
  15050. this.billboard.open(e),
  15051. this.materials.disc.uniforms.color.value = this.hoverColor
  15052. }
  15053. ,
  15054. d.prototype.hide = function(e, t) {
  15055. var i = $.Deferred();
  15056. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15057. return i.resolve().promise();
  15058. e = e || 0,
  15059. t = t || 0,
  15060. C.cancel(this.visibleTransition);
  15061. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15062. return this.visibleTransition = C.start((n = this,
  15063. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15064. o = I.property(n.materials.pole, "opacity", 0),
  15065. function(e) {
  15066. r(e),
  15067. n.materials.pole && o(e)
  15068. }
  15069. ), s * a, function() {
  15070. i.resolve()
  15071. }, l, E[g.warp.blendEasing]),
  15072. i.promise()
  15073. }
  15074. ,
  15075. d.prototype.show = function(e, t) {
  15076. var i = $.Deferred();
  15077. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15078. return i.resolve().promise();
  15079. e = e || 0,
  15080. t = t || 0,
  15081. C.cancel(this.visibleTransition);
  15082. 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;
  15083. return this.visibleTransition = C.start((n = this,
  15084. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15085. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15086. function(e) {
  15087. r(e),
  15088. n.materials.pole && o(e)
  15089. }
  15090. ), s * a, function() {
  15091. i.resolve()
  15092. }, l, E[g.warp.blendEasing]),
  15093. i.promise()
  15094. }
  15095. ,
  15096. d.prototype.closestPanoTowardTag = function(e, t) {
  15097. var i = []
  15098. , n = []
  15099. , r = this.disc.getWorldPosition();
  15100. if (e === m.PANORAMA) {
  15101. var o = t.position.clone().sub(r).normalize();
  15102. i.push(y.filters.isPanoAligned()),
  15103. i.push(y.filters.inPanoDirection(r, o, .5)),
  15104. i.push(y.filters.isNeighbourPanoTo(t)),
  15105. n.push(y.scoreFunctions.direction(r, o))
  15106. }
  15107. var a = new f.Vector3;
  15108. i.push(function(e) {
  15109. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15110. }, function(e) {
  15111. a.copy(r).sub(e.position);
  15112. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15113. , i = g.tags.navigate.tiltTolerance;
  15114. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15115. }),
  15116. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15117. var s = this.model.panos.sortByScore(i, n);
  15118. if (g.tags.navigate.lineOfSight) {
  15119. for (var l = 0; l < s.length; l++) {
  15120. var c = s[l].pano
  15121. , h = c.position.distanceTo(r);
  15122. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15123. return null;
  15124. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15125. var u = d.raycaster.intersectObjects(this.model.colliders);
  15126. if (0 === u.length || u[0].distance > h)
  15127. return c
  15128. }
  15129. return null
  15130. }
  15131. return 0 < s.length && s[0].pano
  15132. }
  15133. ,
  15134. d.prototype.examine = function(i) {
  15135. var e = i.mode
  15136. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15137. , t = this.disc.getWorldPosition();
  15138. this.billboard.setActiveState();
  15139. var r = function() {
  15140. var e = this.billboard.getDimensions()
  15141. , t = new f.Vector3;
  15142. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15143. t.unproject(i.camera),
  15144. i.flyToPano({
  15145. pano: n,
  15146. lookAtPoint: t
  15147. })
  15148. }
  15149. .bind(this);
  15150. if (e === m.PANORAMA)
  15151. if (n !== i.currentPano) {
  15152. var o = {
  15153. pano: n,
  15154. lookAtPoint: t,
  15155. duration: null,
  15156. maxDistanceOverride: null,
  15157. skipWarpingCheck: !1
  15158. };
  15159. i.flyToPano(o, r)
  15160. } else
  15161. setTimeout(function() {
  15162. this.billboard.open().then(function() {
  15163. r()
  15164. })
  15165. }
  15166. .bind(this), 0);
  15167. else {
  15168. var a = {
  15169. pano: n
  15170. };
  15171. if (t) {
  15172. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15173. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15174. }
  15175. a.callback = r,
  15176. a.duration = 1500,
  15177. a.mode = m.PANORAMA,
  15178. i.flyToNewMode(a)
  15179. }
  15180. }
  15181. ,
  15182. d.prototype.update = (n = new f.Vector3,
  15183. function(e, t) {
  15184. this.discWorldPosition = this.disc.getWorldPosition(),
  15185. this.updateDisc(e, t),
  15186. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15187. n.z < 1 && (n.y *= -1,
  15188. this.billboard.update(n, this.getDiscRadius(n, t))))
  15189. }
  15190. ),
  15191. d.prototype.updateDisc = (l = new f.Vector3,
  15192. c = new f.Vector3,
  15193. h = new f.Vector3,
  15194. u = new f.Vector3,
  15195. p = new f.Vector3,
  15196. function(e, t) {
  15197. var i = g.tags.visibility
  15198. , n = g.tags.disc.scale
  15199. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15200. 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)),
  15201. this.obj3d.visible) {
  15202. this.disc.quaternion.copy(t.quaternion);
  15203. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15204. l.copy(this.discWorldPosition).project(t),
  15205. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15206. h.set(o / 2, 0, 0).add(c),
  15207. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15208. p.copy(u).unproject(t);
  15209. var a = p.distanceTo(this.discWorldPosition)
  15210. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15211. this.discScale = a * s,
  15212. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15213. }
  15214. }
  15215. ),
  15216. d.prototype.getDiscRadius = (i = new f.Vector3,
  15217. function(e, t) {
  15218. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15219. Math.abs(e.x - i.x) * $("#player").width()
  15220. }
  15221. ),
  15222. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15223. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15224. }
  15225. ,
  15226. d.prototype.offScreen = function(e, t) {
  15227. var i = e.getWorldPosition().project(t);
  15228. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15229. }
  15230. ,
  15231. d.viewportScale = function() {
  15232. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15233. d.viewportHeight = $("#player").height(),
  15234. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15235. d.currentViewportScale
  15236. }
  15237. ,
  15238. R.exports = d
  15239. }
  15240. ).call(this, "/js/tag/tag.js")
  15241. }
  15242. , {
  15243. "../enum/Colors": 19,
  15244. "../enum/RenderLayers": 41,
  15245. "../enum/RenderOrder": 42,
  15246. "../enum/Viewmode": 51,
  15247. "../objects/Panorama": 148,
  15248. "../settings": 166,
  15249. "../shaders": 167,
  15250. "../util/common": 185,
  15251. "../util/easing": 186,
  15252. "../util/lerp": 188,
  15253. "../util/logger": 189,
  15254. "../util/math": 190,
  15255. "../util/texture": 194,
  15256. "../util/transitions": 195,
  15257. "./Billboard/Billboard": 119,
  15258. "./Billboard/BillboardEvent": 120,
  15259. events: 202,
  15260. three: 217
  15261. }],
  15262. 124: [function(M, R, e) {
  15263. (function(e) {
  15264. "use strict";
  15265. function t() {
  15266. this.tagState = T.IDLE,
  15267. this.intersectTag = null,
  15268. this.hoveredTag = null,
  15269. this.activeTag = null,
  15270. this.tagDiscs = [],
  15271. this.raycaster = new i.Raycaster,
  15272. this.modelManager = null,
  15273. this.player = null,
  15274. this.totaltags = 0,
  15275. this.navigatingViaTag = !1,
  15276. this.enabled = !1
  15277. }
  15278. 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"),
  15279. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15280. r.extend(t, x),
  15281. t.prototype.init = function(e, t) {
  15282. this.modelManager = e,
  15283. this.player = t,
  15284. this.updateModel(),
  15285. this.bindEvents()
  15286. }
  15287. ,
  15288. t.prototype.update = function(e) {
  15289. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15290. }
  15291. ,
  15292. t.prototype.updateTags = function(e, t, i, n) {
  15293. for (var r in this.model.tags)
  15294. this.model.tags[r].update(e, t, i, n)
  15295. }
  15296. ,
  15297. t.prototype.updateModel = function() {
  15298. this.model = this.modelManager.getActiveModel(),
  15299. this.gettagsFromModel(),
  15300. this.totaltags = Object.keys(this.model.tags).length
  15301. }
  15302. ,
  15303. t.prototype.gettagsFromModel = function() {
  15304. for (var e in this.tagDiscs = [],
  15305. this.model.tags) {
  15306. var t = this.model.tags[e].disc;
  15307. t && this.tagDiscs.push(t)
  15308. }
  15309. }
  15310. ,
  15311. t.prototype.bindEvents = function() {
  15312. function e() {
  15313. Object.keys(this.model.tags).forEach(function(e) {
  15314. var t = this.model.tags[e];
  15315. t.bindEvents(),
  15316. t.billboard.on(y.LINK_CLICK, function(e) {
  15317. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15318. }
  15319. .bind(this)),
  15320. t.billboard.on(y.IMAGE_OPENED, function() {
  15321. this.tagState = T.EXAMINE,
  15322. this.emit(y.IMAGE_OPENED)
  15323. }
  15324. .bind(this)),
  15325. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15326. }
  15327. .bind(this))
  15328. }
  15329. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15330. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15331. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15332. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15333. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15334. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15335. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15336. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15337. e.call(this)
  15338. }
  15339. ,
  15340. t.prototype.navigateViaLink = function(e) {
  15341. var t = a.deserialize(e);
  15342. if (t)
  15343. if (t.mode === C.PANORAMA) {
  15344. try {
  15345. this.player.model.panos.get(t.panoId)
  15346. } catch (e) {
  15347. return void S.warn("Unable to find panorama location", t.panoId)
  15348. }
  15349. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15350. } else {
  15351. var i = {
  15352. cameraMode: t.mode,
  15353. position: t.position,
  15354. quaternion: t.quaternion,
  15355. scanId: t.panoId,
  15356. orthoZoom: t.zoom,
  15357. floorVisibility: t.floorVisibility,
  15358. thumbUrl: null,
  15359. name: null
  15360. };
  15361. this.player.flyToNewMode({
  15362. mode: t.mode,
  15363. duration: m.warp.outsideTime,
  15364. warpDest: new g(i),
  15365. force: !0
  15366. })
  15367. }
  15368. }
  15369. ,
  15370. t.prototype.handleWarpStart = function(e, t, i, n) {
  15371. this.dismissExaminedTag(),
  15372. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15373. e && (i = E.END),
  15374. this.hideShowTagsForBlackoutStyle(i, n))
  15375. }
  15376. ,
  15377. t.prototype.handleWarpInterruption = function(e, t, i) {
  15378. null != i || (i = m.warp.teleportTime),
  15379. this.hideShowTagsForBlackoutStyle(t, i)
  15380. }
  15381. ,
  15382. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15383. var i = 0
  15384. , n = 0
  15385. , r = t / 2;
  15386. switch (null != e || (e = E.MIDDLE),
  15387. e) {
  15388. case E.END:
  15389. this.hideAlltags(r);
  15390. break;
  15391. case E.BEGINNING:
  15392. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15393. break;
  15394. case E.NONE:
  15395. break;
  15396. case E.MIDDLE:
  15397. n = i = r,
  15398. this.hideAlltags(n),
  15399. setTimeout(function() {
  15400. this.showAlltags(i)
  15401. }
  15402. .bind(this), n);
  15403. break;
  15404. case E.FADEIN:
  15405. setTimeout(function() {
  15406. this.showAlltags(r)
  15407. }
  15408. .bind(this), r)
  15409. }
  15410. }
  15411. ,
  15412. t.prototype.onPlayerModeChanging = function(e, t) {
  15413. t !== C.PANORAMA && this.dismissExaminedTag(),
  15414. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15415. var i = t !== C.OUTDOOR;
  15416. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15417. }
  15418. ,
  15419. t.prototype.onPanoChange = function(e, t) {
  15420. var i = this.navigatingViaTag;
  15421. if (this.navigatingViaTag = !1,
  15422. !i) {
  15423. this.dismissExaminedTag();
  15424. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15425. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15426. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15427. }
  15428. }
  15429. ,
  15430. t.prototype.onPlayerReady = function(e, t, i) {
  15431. this.startAlltags(e, t ? i : null)
  15432. }
  15433. ,
  15434. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15435. this.updateClosestTags(e)
  15436. }
  15437. ,
  15438. t.prototype.dismissExaminedTag = function() {
  15439. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15440. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15441. this.hoveredTag = null)
  15442. }
  15443. ,
  15444. t.prototype.startAlltags = function(e, t) {
  15445. this.model.shouldShowtags = m.tags.enabled,
  15446. this.enabled = !0,
  15447. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15448. t && setTimeout(function() {
  15449. this.activateTag(this.model.getTagBySid(t))
  15450. }
  15451. .bind(this), m.tags.startup.fadeInDuration / 2))
  15452. }
  15453. ,
  15454. t.prototype.showAlltags = function(e, t, i) {
  15455. function n() {
  15456. ++o === this.totaltags && (this.model.tagsShown = !0,
  15457. r.resolve())
  15458. }
  15459. var r = $.Deferred();
  15460. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15461. return r.resolve().promise();
  15462. var o = 0;
  15463. for (var a in this.model.tags) {
  15464. this.model.tags[a].show(e, t).done(n.bind(this))
  15465. }
  15466. return r.promise()
  15467. }
  15468. ,
  15469. t.prototype.hideAlltags = function(e, t) {
  15470. function i() {
  15471. ++r === this.totaltags && (this.model.tagsShown = !1,
  15472. n.resolve())
  15473. }
  15474. var n = $.Deferred()
  15475. , r = 0;
  15476. for (var o in this.model.tags) {
  15477. var a = this.model.tags[o];
  15478. a.hide(e, t).done(i.bind(this)),
  15479. a === this.activeTag && this.dismissActiveTag()
  15480. }
  15481. return n.promise()
  15482. }
  15483. ,
  15484. t.prototype.enableHovering = function() {
  15485. this.enabled = !0
  15486. }
  15487. ,
  15488. t.prototype.disableHovering = function() {
  15489. this.enabled = !1
  15490. }
  15491. ,
  15492. t.prototype.activateTag = function(e, t) {
  15493. t = t || T.EXAMINE,
  15494. this.activeTag = e,
  15495. this.activeTag.hoveringDisc = !0,
  15496. this.activeTag.setHoverState(t === T.EXAMINE),
  15497. this.tagState = t,
  15498. this.emit(b.TagActivated, e)
  15499. }
  15500. ,
  15501. t.prototype.dismissActiveTag = function() {
  15502. this.activeTag.hoveringDisc = !1,
  15503. this.activeTag.setFreeState(!0);
  15504. var e = this.activeTag;
  15505. this.activeTag = null,
  15506. this.tagState = T.IDLE,
  15507. this.emit(b.TagDismissed, e)
  15508. }
  15509. ,
  15510. t.prototype.clickedOnTag = function(e) {
  15511. var t = function() {
  15512. this.navigatingViaTag = !0,
  15513. this.activeTag.examine(this.player),
  15514. this.emit(b.TagNavigation, this.activeTag)
  15515. }
  15516. .bind(this);
  15517. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  15518. this.activeTag = this.intersectTag,
  15519. t(),
  15520. !0) : (this.dismissActiveTag(),
  15521. !1)
  15522. }
  15523. ,
  15524. t.prototype.intersecttag = (s = new i.Vector3,
  15525. l = new i.Vector3,
  15526. c = new i.Vector3,
  15527. function(e, t, i) {
  15528. if (!this.enabled)
  15529. return null;
  15530. var n = null
  15531. , r = this.tagDiscs.filter(function(e) {
  15532. return e.parent.visible
  15533. });
  15534. if (0 < r.length) {
  15535. var o = this.model.floors.reduce(function(e, t) {
  15536. return t.hidden ? e : e.concat(t.collider.children)
  15537. }, r);
  15538. s.set(e.x, e.y, -1).unproject(i),
  15539. l.set(e.x, e.y, 1).unproject(i),
  15540. c.copy(l).sub(s).normalize(),
  15541. this.raycaster.set(s, c);
  15542. var a = this.raycaster.intersectObjects(o);
  15543. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15544. }
  15545. return this.intersectTag = n,
  15546. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  15547. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  15548. this.hoveredTag = n
  15549. }
  15550. .bind(this)),
  15551. n.billboard.on(v.LEAVE, function() {
  15552. this.hoveredTag = null
  15553. }
  15554. .bind(this))),
  15555. this.activateTag(n, T.BROWSE))),
  15556. n
  15557. }
  15558. ),
  15559. t.prototype.rankedtagInDirection = (h = [],
  15560. u = [],
  15561. d = new i.Vector3,
  15562. p = new i.Vector3,
  15563. f = new i.Vector3,
  15564. function(e, t, i, n) {
  15565. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  15566. var a = this.closesttags[o];
  15567. p.copy(a.position),
  15568. p.add(a.discPosition),
  15569. d.copy(t),
  15570. d.sub(p).negate(),
  15571. d.normalize();
  15572. var s = d.dot(n);
  15573. if (0 <= s && (f.copy(p),
  15574. f.project(i),
  15575. this.intersecttag(f, !1, i))) {
  15576. if (r >= h.length)
  15577. for (var l = 0; l < 64; l++)
  15578. h.push({
  15579. tag: a,
  15580. dot: s
  15581. });
  15582. var c = h[r];
  15583. c.tag = a,
  15584. c.dot = s,
  15585. c.position = math.projectPositionToCanvas(p, i),
  15586. u.push(c),
  15587. r++
  15588. }
  15589. }
  15590. return u.sort(function(e, t) {
  15591. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15592. }),
  15593. e < u.length ? u[e].tag : null
  15594. }
  15595. ),
  15596. t.prototype.updateClosestTags = (o = new i.Vector3,
  15597. function(e) {
  15598. this.closesttags || (this.closesttags = []),
  15599. this.closesttags.length = 0;
  15600. var t = this.model.tags;
  15601. if (t)
  15602. for (var i in t)
  15603. if (t.hasOwnProperty(i)) {
  15604. var n = t[i]
  15605. , r = n.position;
  15606. o.copy(e),
  15607. o.sub(r).negate(),
  15608. o.lengthSq() < 30 && this.closesttags.push(n)
  15609. }
  15610. }
  15611. ),
  15612. R.exports = t
  15613. }
  15614. ).call(this, "/js/tag/tagManager.js")
  15615. }
  15616. , {
  15617. "../controls/serializer": 14,
  15618. "../enum/BlackoutStyle": 18,
  15619. "../enum/tagEvents": 32,
  15620. "../enum/ModelManagerEvents": 33,
  15621. "../enum/PlayerEvents": 40,
  15622. "../enum/TagStates": 44,
  15623. "../enum/Viewmode": 51,
  15624. "../enum/WarpStyle": 52,
  15625. "../objects/Snapshot": 153,
  15626. "../settings": 166,
  15627. "../util/common": 185,
  15628. "../util/lerp": 188,
  15629. "../util/logger": 189,
  15630. "./Billboard/BillboardEvent": 120,
  15631. "./Media/LinkType": 130,
  15632. "./Media/MediaEvent": 131,
  15633. events: 202,
  15634. three: 217
  15635. }],
  15636. 125: [function(r, o, e) {
  15637. (function(e) {
  15638. "use strict";
  15639. function t() {
  15640. this.embedWrapper = null,
  15641. this.embedElement = null
  15642. }
  15643. var i = r("../../util/ajax")
  15644. , a = r("./mediaSettings")
  15645. , n = r("../../settings")
  15646. , s = new (r("../../util/logger"))(e);
  15647. t.prototype.createDomElement = function() {
  15648. return this.embedWrapper = document.createElement("div"),
  15649. this.embedWrapper.classList.add("tag-embed"),
  15650. this.embedWrapper.classList.add("hidden"),
  15651. this.embedWrapper
  15652. }
  15653. ,
  15654. t.prototype.load = function(e) {
  15655. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  15656. return new Promise(function(r, o) {
  15657. i.get(t).then(function(e) {
  15658. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  15659. this.embedWrapper.innerHTML = e.html;
  15660. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  15661. if (this.embedWrapper.style.width = t + "px",
  15662. e.height) {
  15663. var i = e.height / e.width;
  15664. this.embedWrapper.style.height = t * i + "px"
  15665. }
  15666. this.embedElement = this.embedWrapper.firstChild;
  15667. var n = [];
  15668. try {
  15669. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  15670. } catch (e) {
  15671. s.debug("Error getting `a` elements for embed; was it an iframe?")
  15672. }
  15673. n.forEach(function(e) {
  15674. e.setAttribute("target", "_blank")
  15675. }),
  15676. this.embedElement.classList.add("hidden"),
  15677. this.embedWrapper.classList.remove("hidden"),
  15678. r()
  15679. } else
  15680. o("Not a valid embed")
  15681. }
  15682. .bind(this), function(e) {
  15683. o(e.response)
  15684. })
  15685. }
  15686. .bind(this))
  15687. }
  15688. ,
  15689. t.prototype.show = function() {
  15690. this.embedElement && this.embedElement.classList.remove("hidden")
  15691. }
  15692. ,
  15693. t.prototype.hide = function() {
  15694. this.embedElement && this.embedElement.classList.add("hidden")
  15695. }
  15696. ,
  15697. o.exports = t
  15698. }
  15699. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  15700. }
  15701. , {
  15702. "../../settings": 166,
  15703. "../../util/ajax": 181,
  15704. "../../util/logger": 189,
  15705. "./mediaSettings": 132
  15706. }],
  15707. 126: [function(a, s, e) {
  15708. (function(e) {
  15709. "use strict";
  15710. function t(e) {
  15711. r.call(this),
  15712. this.options = e,
  15713. this.playerControls = null,
  15714. this.state = o.NOT_READY
  15715. }
  15716. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  15717. Object.freeze({
  15718. NOT_READY: "player.not.ready",
  15719. CUED: "player.cued",
  15720. PLAYING: "player.playing",
  15721. PAUSED: "player.paused"
  15722. }));
  15723. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15724. return this.embedWrapper = document.createElement("div"),
  15725. this.embedWrapper.classList.add("tag-video"),
  15726. this.embedWrapper.classList.add("hidden"),
  15727. this.embedWrapper
  15728. }
  15729. ,
  15730. t.prototype.load = function(e) {
  15731. var t = function() {
  15732. function e(e) {
  15733. this.playerState = e
  15734. }
  15735. this.playerControls = new playerjs.Player(this.embedElement),
  15736. this.playerControls.on("ready", function(e) {
  15737. this.playerState = o.CUED,
  15738. this.options.startMuted && this.playerControls.mute()
  15739. }
  15740. .bind(this)),
  15741. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  15742. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  15743. this.playerControls.on("ended", function(e) {
  15744. this.playerControls.setCurrentTime(0),
  15745. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  15746. }
  15747. .bind(this))
  15748. }
  15749. .bind(this);
  15750. return r.prototype.load.call(this, e).then(t.bind(this))
  15751. }
  15752. ,
  15753. t.prototype.play = (i = n.isMobile(),
  15754. function() {
  15755. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  15756. }
  15757. ),
  15758. t.prototype.pause = function() {
  15759. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  15760. }
  15761. ,
  15762. s.exports = t
  15763. }
  15764. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  15765. }
  15766. , {
  15767. "../../util/browser": 182,
  15768. "../../util/logger": 189,
  15769. "./EmbedlyEmbed": 125
  15770. }],
  15771. 127: [function(t, i, e) {
  15772. (function(e) {
  15773. "use strict";
  15774. var r = t("../../util/ajax")
  15775. , o = new (t("./mediaSettings"),
  15776. t("../../util/logger"))(e)
  15777. , a = Promise.resolve();
  15778. i.exports.enqueue = function(i) {
  15779. function n() {}
  15780. return a = new Promise(function(e, t) {
  15781. a.catch(n).then(function() {
  15782. (o.debug("requesting file from embedly:", i.href),
  15783. r.get(i.href, {
  15784. responseType: i.responseType
  15785. }).then(function(e) {
  15786. return o.debug("requesting file finished:", i.href),
  15787. e
  15788. })).then(e, t)
  15789. })
  15790. }
  15791. )
  15792. }
  15793. }
  15794. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  15795. }
  15796. , {
  15797. "../../util/ajax": 181,
  15798. "../../util/logger": 189,
  15799. "./mediaSettings": 132
  15800. }],
  15801. 128: [function(s, l, e) {
  15802. (function(e) {
  15803. "use strict";
  15804. function t() {
  15805. this.imageWrapper = null,
  15806. this.width = 0,
  15807. this.height = 0,
  15808. this.aspect = 1
  15809. }
  15810. var i = s("./MediaEvent")
  15811. , n = s("./EmbedlyQueue")
  15812. , r = s("events").EventEmitter
  15813. , o = s("../../util/logger")
  15814. , a = s("../../settings");
  15815. new o(e),
  15816. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15817. return this.imageWrapper = document.createElement("div"),
  15818. this.imageWrapper.classList.add("tag-image"),
  15819. this.imageWrapper.classList.add("hidden"),
  15820. this.imageWrapper.addEventListener("click", function(e) {
  15821. e.stopPropagation(),
  15822. this.emit(i.IMAGE_OPENING),
  15823. this.imageWrapper.style.pointerEvents = "none"
  15824. }
  15825. .bind(this)),
  15826. this.imageWrapper
  15827. }
  15828. ,
  15829. t.prototype.onClosed = function() {
  15830. this.imageWrapper.style.pointerEvents = "auto"
  15831. }
  15832. ,
  15833. t.prototype.load = function(e) {
  15834. var t = Math.max(window.screen.height, window.screen.width)
  15835. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  15836. return new Promise(function(o, e) {
  15837. n.enqueue({
  15838. href: i,
  15839. responseType: "arraybuffer"
  15840. }).then(function(e) {
  15841. var t = new Uint8Array(e)
  15842. , i = new Blob([t])
  15843. , n = new window.Image;
  15844. n.addEventListener("load", function(e) {
  15845. var t = e.target;
  15846. this.width = t.naturalWidth,
  15847. this.height = t.naturalHeight,
  15848. this.aspect = this.width / this.height;
  15849. var i = e.target.src;
  15850. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  15851. this.imageWrapper.style.width = this.width + "px",
  15852. this.imageWrapper.style.height = this.height + "px",
  15853. this.imageWrapper.classList.remove("hidden"),
  15854. o()
  15855. }
  15856. .bind(this));
  15857. var r = URL.createObjectURL(i);
  15858. n.src = r
  15859. }
  15860. .bind(this), e)
  15861. }
  15862. .bind(this))
  15863. }
  15864. ,
  15865. l.exports = t
  15866. }
  15867. ).call(this, "/js/tag/Media/Image.js")
  15868. }
  15869. , {
  15870. "../../settings": 166,
  15871. "../../util/logger": 189,
  15872. "./EmbedlyQueue": 127,
  15873. "./MediaEvent": 131,
  15874. events: 202
  15875. }],
  15876. 129: [function(e, t, i) {
  15877. "use strict";
  15878. function n(e) {
  15879. this.label = e.label,
  15880. this.href = e.url,
  15881. this.type = this.updateLinkForType(),
  15882. this.domElement = null,
  15883. this.id = c++
  15884. }
  15885. var r = e("./LinkType")
  15886. , o = e("./MediaEvent")
  15887. , a = e("../../util/browser")
  15888. , s = e("../../analytics")
  15889. , l = e("events").EventEmitter
  15890. , c = 0;
  15891. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  15892. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  15893. 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,
  15894. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  15895. r.NAVIGATION) : (this.href = this.href + "&play=1",
  15896. r.MODEL) : r.EXT_LINK
  15897. }
  15898. ;
  15899. var h = {};
  15900. n.prototype.createDomElement = function() {
  15901. if (this.domElement = document.createElement("a"),
  15902. this.domElement.classList.add("tag-link"),
  15903. this.domElement.textContent = this.label,
  15904. this.type === r.EXT_LINK) {
  15905. this.domElement.textContent += " ";
  15906. var e = document.createElement("i");
  15907. e.classList.add("icon-ext-link"),
  15908. e.title = "Link to external web site",
  15909. this.domElement.appendChild(e)
  15910. }
  15911. return this.domElement.addEventListener("click", function(e) {
  15912. switch (e.stopPropagation(),
  15913. h[this.id] = !0,
  15914. s.trackAlways("click_tag_link", {
  15915. link_type: this.type,
  15916. link_count: c,
  15917. links_clicked: Object.keys(h).length
  15918. }),
  15919. this.type) {
  15920. case r.MODEL:
  15921. window.location.replace(this.href);
  15922. break;
  15923. case r.EXT_LINK:
  15924. window.open(this.href, "_blank")
  15925. }
  15926. this.emit(o.LINK_CLICK, {
  15927. type: this.type,
  15928. url: this.href
  15929. })
  15930. }
  15931. .bind(this)),
  15932. this.domElement
  15933. }
  15934. ,
  15935. t.exports = n
  15936. }
  15937. , {
  15938. "../../analytics": 4,
  15939. "../../util/browser": 182,
  15940. "./LinkType": 130,
  15941. "./MediaEvent": 131,
  15942. events: 202
  15943. }],
  15944. 130: [function(e, t, i) {
  15945. "use strict";
  15946. t.exports = {
  15947. NAVIGATION: "navigation",
  15948. MODEL: "model",
  15949. EXT_LINK: "ext-link"
  15950. }
  15951. }
  15952. , {}],
  15953. 131: [function(e, t, i) {
  15954. "use strict";
  15955. t.exports = Object.freeze({
  15956. LINK_CLICK: "mtmedia.link",
  15957. IMAGE_LOADED: "mtmedia.image.loaded",
  15958. IMAGE_OPENING: "mtmedia.image.opening",
  15959. IMAGE_OPENED: "mtmedia.image.opened",
  15960. IMAGE_CLOSING: "mtmedia.image.closing",
  15961. IMAGE_CLOSED: "mtmedia.image.closed",
  15962. VIDEO_START: "mtmedia.video.start",
  15963. VIDEO_PAUSE: "mtmedia.video.pause",
  15964. VIDEO_ENDED: "mtmedia.video.end"
  15965. })
  15966. }
  15967. , {}],
  15968. 132: [function(e, t, i) {
  15969. "use strict";
  15970. t.exports = Object.freeze({
  15971. maxEmbedWidth: 350,
  15972. defaultAspectRatio: .75
  15973. })
  15974. }
  15975. , {}],
  15976. 133: [function(e, t, i) {
  15977. "use strict";
  15978. t.exports = Object.freeze({
  15979. TEXT: "text",
  15980. LINK: "link",
  15981. IMAGE: "photo",
  15982. VIDEO: "video",
  15983. RICH: "rich"
  15984. })
  15985. }
  15986. , {}],
  15987. 134: [function(e, t, i) {
  15988. "use strict";
  15989. function n(e) {
  15990. this.capabilities = {
  15991. links: {
  15992. enable: e.supportLinks,
  15993. keepLabels: e.keepLinkLabels
  15994. }
  15995. }
  15996. }
  15997. var r = e("./DescriptionChunkType");
  15998. n.prototype.parse = function(e, i) {
  15999. var n = [];
  16000. return e.split("[").map(function(e, t) {
  16001. return 0 === t ? e : "[" + e
  16002. }).forEach(function(e) {
  16003. var t = this.findMarkdown(e);
  16004. if (t) {
  16005. if (-1 !== t.url.indexOf("javascript:"))
  16006. return;
  16007. this.addLinkChunk(n, t, i),
  16008. this.addTextChunk(n, e.slice(t.markdown.length))
  16009. } else
  16010. this.addTextChunk(n, e)
  16011. }
  16012. .bind(this)),
  16013. n
  16014. }
  16015. ,
  16016. n.prototype.findMarkdown = function(e) {
  16017. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16018. if (t) {
  16019. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16020. 0 !== n); )
  16021. r++;
  16022. var o = i.length - r;
  16023. return {
  16024. markdown: t[0].substring(0, t[0].length - o),
  16025. label: t[1],
  16026. url: t[2].substring(0, r)
  16027. }
  16028. }
  16029. }
  16030. ,
  16031. n.prototype.addTextChunk = function(e, t) {
  16032. 0 !== t.length && e.push({
  16033. type: r.TEXT,
  16034. text: t
  16035. })
  16036. }
  16037. ,
  16038. n.prototype.addLinkChunk = function(e, t) {
  16039. if (this.capabilities.links.enable) {
  16040. var i = {
  16041. label: t.label,
  16042. url: t.url
  16043. };
  16044. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16045. e.push({
  16046. type: r.LINK,
  16047. link: i
  16048. })
  16049. } else
  16050. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16051. }
  16052. ,
  16053. t.exports = n
  16054. }
  16055. , {
  16056. "./DescriptionChunkType": 133
  16057. }],
  16058. 135: [function(t, r, e) {
  16059. (function(e) {
  16060. "use strict";
  16061. var i = new (t("../util/logger"))(e)
  16062. , n = {
  16063. parseIdsFromChunkName: function(e, t) {
  16064. t.floorId = n.parseFloor(e),
  16065. t.roomId = n.parseRoom(e)
  16066. },
  16067. parseFloor: function(e) {
  16068. var t = e.match(/_group([0-9]+)/);
  16069. if (!t)
  16070. return 0;
  16071. try {
  16072. return parseInt(t[1], 10)
  16073. } catch (e) {
  16074. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16075. 0
  16076. }
  16077. },
  16078. parseRoom: function(e) {
  16079. var t = e.match(/_sub([0-9]+)/);
  16080. if (!t)
  16081. return -1;
  16082. try {
  16083. return parseInt(t[1], 10)
  16084. } catch (e) {
  16085. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16086. 0
  16087. }
  16088. }
  16089. };
  16090. r.exports = n
  16091. }
  16092. ).call(this, "/js/model/Chunks.js")
  16093. }
  16094. , {
  16095. "../util/logger": 189
  16096. }],
  16097. 136: [function(a, c, e) {
  16098. (function(e) {
  16099. "use strict";
  16100. function t(e) {
  16101. r.call(this),
  16102. this.model = e,
  16103. this.exploded = !1
  16104. }
  16105. var i = a("../objects/Floor")
  16106. , n = (a("../settings"),
  16107. a("../util/logger"))
  16108. , s = a("../util/transitions")
  16109. , r = a("../util/IndexedCollection")
  16110. , o = a("../util/common")
  16111. , l = a("../util/easing");
  16112. new n(e),
  16113. o.inherit(t, r),
  16114. t.prototype.add = function(e) {
  16115. r.prototype.add.call(this, e),
  16116. this.model.add(e)
  16117. }
  16118. ,
  16119. t.prototype.getIndex = function(e) {
  16120. return e.floorIndex
  16121. }
  16122. ,
  16123. t.prototype.build = function() {
  16124. this.list.forEach(function(e) {
  16125. e.build()
  16126. })
  16127. }
  16128. ,
  16129. t.prototype.size = function() {
  16130. return this.length
  16131. }
  16132. ,
  16133. t.prototype.sort = function() {
  16134. r.prototype.sort.call(this, function(e, t) {
  16135. return e.floorIndex - t.floorIndex
  16136. })
  16137. }
  16138. ,
  16139. t.prototype.nextFloor = function(e, t) {
  16140. return this.index[e.floorIndex + t] || null
  16141. }
  16142. ,
  16143. t.prototype.getFloorAtPoint = function(e) {
  16144. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16145. var r = this.list[n]
  16146. , o = r.distanceToPoint(e);
  16147. (!t || o < i) && (i = o,
  16148. t = r)
  16149. }
  16150. return t
  16151. }
  16152. ,
  16153. t.prototype.getOrMakeFloor = function(e) {
  16154. var t = this.index[e];
  16155. return t || (t = new i(this.model,e),
  16156. this.add(t)),
  16157. t
  16158. }
  16159. ,
  16160. t.prototype.hide = function() {
  16161. this.list.forEach(function(e) {
  16162. e.hide()
  16163. })
  16164. }
  16165. ,
  16166. t.prototype.show = function() {
  16167. this.list.forEach(function(e) {
  16168. e.show()
  16169. })
  16170. }
  16171. ,
  16172. t.prototype.names = function() {
  16173. return this.list.reduce(function(e, t) {
  16174. return e.concat(t.name)
  16175. }, [])
  16176. }
  16177. ,
  16178. t.prototype.toggleExplodeHorizontal = function() {
  16179. function i(e, t) {
  16180. a.copy(e.position),
  16181. e.position.x = r[e.floorIndex] * t,
  16182. e.position.y = 1 * e.floorIndex * t,
  16183. a.sub(e.position).multiplyScalar(-1),
  16184. e.panos.forEach(function(e) {
  16185. e.translate(a)
  16186. })
  16187. }
  16188. var n, r = [], o = 0;
  16189. this.list.forEach(function(e, t, i) {
  16190. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16191. o += n,
  16192. r[t] = o
  16193. }),
  16194. r = r.map(function(e) {
  16195. return e - o / 2
  16196. });
  16197. var a = this.list[0].position.clone();
  16198. this.exploded ? this.list.forEach(function(t) {
  16199. s.start(function(e) {
  16200. i(t, 1 - e)
  16201. }, 1500, null, 0, l.easeOutExpo)
  16202. }) : this.list.forEach(function(t) {
  16203. s.start(function(e) {
  16204. i(t, e)
  16205. }, 1500, null, 0, l.easeOutExpo)
  16206. }),
  16207. this.exploded = !this.exploded
  16208. }
  16209. ,
  16210. t.prototype.toggleExplodeVertical = function() {
  16211. function i(e, t) {
  16212. var i = i.copy(e.position);
  16213. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16214. i.sub(e.position).multiplyScalar(-1),
  16215. e.panos.forEach(function(e) {
  16216. e.translate(i)
  16217. })
  16218. }
  16219. var n = this.model.size;
  16220. this.list[0].position.clone(),
  16221. this.exploded ? this.list.forEach(function(t) {
  16222. s.start(function(e) {
  16223. i(t, 1 - e)
  16224. }, 1500, null, 0, l.easeOutExpo)
  16225. }) : this.list.forEach(function(t) {
  16226. s.start(function(e) {
  16227. i(t, e)
  16228. }, 1500, null, 0, l.easeOutExpo)
  16229. }),
  16230. this.exploded = !this.exploded
  16231. }
  16232. ,
  16233. c.exports = t
  16234. }
  16235. ).call(this, "/js/model/FloorCollection.js")
  16236. }
  16237. , {
  16238. "../objects/Floor": 146,
  16239. "../settings": 166,
  16240. "../util/IndexedCollection": 175,
  16241. "../util/common": 185,
  16242. "../util/easing": 186,
  16243. "../util/logger": 189,
  16244. "../util/transitions": 195
  16245. }],
  16246. 137: [function(r, o, e) {
  16247. (function(e) {
  16248. "use strict";
  16249. function h() {
  16250. n.call(this)
  16251. }
  16252. var u = r("../settings")
  16253. , t = r("../util/logger")
  16254. , d = r("../enum/Viewmode")
  16255. , p = r("../objects/Snapshot")
  16256. , i = (r("../util/math"),
  16257. r("../util/common"))
  16258. , n = r("../util/IndexedCollection")
  16259. , l = new t(e);
  16260. i.inherit(h, n),
  16261. h.prototype.getImage = function(e) {
  16262. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16263. }
  16264. ,
  16265. h.prototype.filterByModesAndReel = function(e, t) {
  16266. for (var i = [], n = 0; n < t.length; n += 1) {
  16267. var r = t[n]
  16268. , o = this.index[r.sid];
  16269. o && i.push(o)
  16270. }
  16271. var a = e[d.DOLLHOUSE]
  16272. , s = e[d.FLOORPLAN];
  16273. (i = i.filter(function(e) {
  16274. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16275. return !0;
  16276. var t;
  16277. try {
  16278. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16279. } catch (e) {
  16280. return l.debug(e.message),
  16281. !1
  16282. }
  16283. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16284. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16285. this.list = i,
  16286. this.reIndex()
  16287. }
  16288. ,
  16289. h.prototype.getHeroLocations = function(e) {
  16290. if (0 === this.list.length)
  16291. return [];
  16292. for (var t = [], i = 0; i < this.list.length; ++i) {
  16293. var n = this.list[i]
  16294. , r = n.thumbnail_signed_src
  16295. , o = n.name || "";
  16296. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16297. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16298. var a = e.get(n.metadata.scan_id);
  16299. if (a && !a.isAligned())
  16300. continue
  16301. }
  16302. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16303. if (s === d.MESH)
  16304. continue;
  16305. var l = {
  16306. cameraMode: s,
  16307. position: n.metadata.camera_position,
  16308. quaternion: n.metadata.camera_quaternion,
  16309. zoom: n.metadata.zoom,
  16310. panoId: n.metadata.scan_id,
  16311. orthoZoom: n.metadata.ortho_zoom,
  16312. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16313. thumbUrl: "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime(),
  16314. name: h.filterImageName(o),
  16315. sid: n.sid
  16316. }
  16317. , c = new p(l);
  16318. t.push(c)
  16319. }
  16320. }
  16321. return t
  16322. }
  16323. ,
  16324. h.prototype.getIndex = function(e) {
  16325. return e.sid
  16326. }
  16327. ,
  16328. h.filterImageName = function(e) {
  16329. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16330. }
  16331. ,
  16332. o.exports = h
  16333. }
  16334. ).call(this, "/js/model/ImageCollection.js")
  16335. }
  16336. , {
  16337. "../enum/Viewmode": 51,
  16338. "../objects/Snapshot": 153,
  16339. "../settings": 166,
  16340. "../util/IndexedCollection": 175,
  16341. "../util/common": 185,
  16342. "../util/logger": 189,
  16343. "../util/math": 190
  16344. }],
  16345. 138: [function(h, u, e) {
  16346. (function(e) {
  16347. "use strict";
  16348. function n() {
  16349. c.call(this)
  16350. }
  16351. var r = h("../label/Label")
  16352. , i = h("../settings")
  16353. , t = h("../util/logger")
  16354. , o = h("../util/math")
  16355. , a = h("../util/ajax")
  16356. , s = h("./RoomCollection")
  16357. , l = h("../util/common")
  16358. , c = h("../util/IndexedCollection");
  16359. new t(e),
  16360. l.inherit(n, c),
  16361. n.prototype.getIndex = function(e) {
  16362. return e.labelId
  16363. }
  16364. ,
  16365. n.prototype.associateWithRooms = function(e) {
  16366. this.forEach(function(t) {
  16367. e.forEach(function(e) {
  16368. e.roomId === t.roomId && (t.room = e)
  16369. })
  16370. })
  16371. }
  16372. ,
  16373. n.prototype.createFromLabelData = function(e) {
  16374. e.forEach(function(e) {
  16375. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16376. t = s.generateRoomId(e.floorId, t);
  16377. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16378. i.position = o.convertWorkshopVector(i.position),
  16379. this.add(i),
  16380. i.build()
  16381. }
  16382. .bind(this))
  16383. }
  16384. ,
  16385. n.prototype.load = function(e, t) {
  16386. return a.get(e, {
  16387. responseType: "json",
  16388. auth: t ? i.authorizationHeader : null
  16389. }).done(function(e) {
  16390. var t = [];
  16391. for (var i in e) {
  16392. var n = e[i];
  16393. t.push(n)
  16394. }
  16395. this.createFromLabelData(t)
  16396. }
  16397. .bind(this))
  16398. }
  16399. ,
  16400. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16401. var t = -1;
  16402. if (e) {
  16403. var i = e.split("_");
  16404. t = parseInt(i[0])
  16405. }
  16406. return t
  16407. }
  16408. ,
  16409. u.exports = n
  16410. }
  16411. ).call(this, "/js/model/LabelCollection.js")
  16412. }
  16413. , {
  16414. "../label/Label": 90,
  16415. "../settings": 166,
  16416. "../util/IndexedCollection": 175,
  16417. "../util/ajax": 181,
  16418. "../util/common": 185,
  16419. "../util/logger": 189,
  16420. "../util/math": 190,
  16421. "./RoomCollection": 141
  16422. }],
  16423. 139: [function(P, O, e) {
  16424. (function(e) {
  16425. "use strict";
  16426. function t(e, t) {
  16427. o.Object3D.call(this),
  16428. this.sid = window.number;//t.sid,
  16429. this.data = t,
  16430. this.options = e,
  16431. this.urls = new i(e.urlFiles),
  16432. this.isPublic = void 0 !== t.is_public && t.is_public,
  16433. this.images = new E(this),
  16434. this.images.extend(t.images),
  16435. this.heroImage = this.images.getImage(t.icon),
  16436. this.heroLocations = [],
  16437. this.outdoorPanoLocations = [],
  16438. this.floors = new c(this),
  16439. this.floorsEnabled = void 0 === e.floors || e.floors,
  16440. this.changingFloor = !1,
  16441. this.chunks = [],
  16442. this.panos = new g,
  16443. this.colliders = [],
  16444. this.loadPanosPromise = null,
  16445. this.loadMeshTexturesPromise = null,
  16446. this.auxDataPromise = null,
  16447. this.meshTexturesLoaded = !1,
  16448. this.meshTextures = [],
  16449. this.tags = {},
  16450. this.tagsShown = !1,
  16451. this.shouldShowtags = !1,
  16452. this.has360Views = !1,
  16453. this.showingLabels = u.labels.enabled && t.player_options.labels,
  16454. this.supportedModes = {},
  16455. this.supportedModes[s.PANORAMA] = !0,
  16456. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  16457. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  16458. this.supportedModes[s.TRANSITIONING] = !0,
  16459. this.supportsTiles = this.configureTiling(),
  16460. this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || !0,
  16461. this.mode = s.DOLLHOUSE,
  16462. this.size = null,
  16463. this.center = null,
  16464. this.boundingBox = new o.Box3,
  16465. this.currentFloor = null,
  16466. this.allFloorsVisible = !0,
  16467. this.projectedPano0 = null,
  16468. this.projectedPano1 = null,
  16469. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  16470. this.addFloor(new r(this,t,e.trim()))
  16471. }
  16472. .bind(this)),
  16473. this.waitQueue = [],
  16474. this.on("load", function(e) {
  16475. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16476. return !e.isLoadedCallback()
  16477. }),
  16478. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16479. }
  16480. .bind(this)),
  16481. this.setupCustomProperties(),
  16482. this.hots = {}
  16483. }
  16484. var o = P("three")
  16485. , a = P("../util/ajax")
  16486. , i = P("../util/ModelUrls")
  16487. , n = P("../objects/BoundingTextureSkybox")
  16488. , s = P("../enum/Viewmode")
  16489. , l = P("../enum/RenderOrder")
  16490. , r = (P("../enum/AlignmentType"),
  16491. P("../objects/Floor"))
  16492. , c = P("./FloorCollection")
  16493. , h = P("../objects/Chunk")
  16494. , u = (P("../objects/Room"),
  16495. P("../objects/Snapshot"),
  16496. P("../label/Label"),
  16497. P("../util/math"),
  16498. P("../settings"))
  16499. , d = P("../shaders")
  16500. , p = P("../util/logger")
  16501. , f = (P("../tag/tag"),
  16502. P("../tag/tagManager"),
  16503. P("../objects/Panorama"))
  16504. , g = P("../util/PanoramaCollection")
  16505. , m = P("../loaders/ModelLoader")
  16506. , v = P("../loaders/ModelTextureLoader")
  16507. , y = P("../loaders/SweepDataLoader")
  16508. , A = P("../util/transitions")
  16509. , C = (P("../util/easing"),
  16510. P("../util/lerp"),
  16511. P("../util/common"))
  16512. , I = (P("../util/texture"),
  16513. P("./../util/browser"))
  16514. , E = P("./ImageCollection")
  16515. , _ = P("./RoomCollection")
  16516. , b = P("./LabelCollection")
  16517. , w = P("./Chunks")
  16518. , T = P("./../util/showcase")
  16519. , x = P("../exception/BasicException")
  16520. , S = (P("../constants"),
  16521. P("events").EventEmitter)
  16522. , M = P("hot")
  16523. , R = new p(e);
  16524. t.prototype = Object.create(o.Object3D.prototype),
  16525. C.extend(t, S),
  16526. t.prototype.setupCustomProperties = function() {
  16527. var t = u.modelAlpha;
  16528. Object.defineProperty(this, "alpha", {
  16529. get: function() {
  16530. return t
  16531. },
  16532. set: function(e) {
  16533. t = e,
  16534. this.chunks.forEach(function(e) {
  16535. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16536. })
  16537. }
  16538. })
  16539. }
  16540. ,
  16541. t.prototype.configureTiling = function() {
  16542. var e = function() {
  16543. try {
  16544. var e = document.createElement("canvas")
  16545. , t = e.getContext("webgl");
  16546. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16547. } catch (e) {
  16548. return 0
  16549. }
  16550. }();
  16551. if (e < 2048)
  16552. return !1;
  16553. R.warn("Max cube texture size: " + e);
  16554. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16555. var i = u.tiling.tilingFlagNames[t];
  16556. if ("1" === I.valueFromHash(i, null))
  16557. return !0;
  16558. if ("0" === I.valueFromHash(i, null))
  16559. return !1
  16560. }
  16561. return !!T.modelDataPromisesTiles(this.data)
  16562. }
  16563. ,
  16564. t.prototype.toggleAlpha = function() {
  16565. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16566. }
  16567. ,
  16568. t.prototype.load = function(e) {
  16569. var t = this.urls.init().then(function() {
  16570. return $.when(this.loadPanos(), this.loadMesh())
  16571. }
  16572. .bind(this));
  16573. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  16574. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  16575. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  16576. }
  16577. ,
  16578. t.prototype.loadMesh = function() {
  16579. var n = $.Deferred()
  16580. , r = this;
  16581. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  16582. if (0 === e.length) {
  16583. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16584. r.supportedModes[s.DOLLHOUSE] = !1,
  16585. r.supportedModes[s.FLOORPLAN] = !1;
  16586. var i = new h({
  16587. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16588. });
  16589. i.material.visible = !1,
  16590. i.rotateX(-Math.PI / 2),
  16591. i.geometry.computeBoundingBox(),
  16592. e = [i]
  16593. }
  16594. e.forEach(function(e) {
  16595. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  16596. r.addChunk(t, e)
  16597. }),
  16598. r.floors.sort(),
  16599. n.resolve(r)
  16600. }, function(e, t) {
  16601. n.notify(e, t)
  16602. }, function(e) {
  16603. R.error(e),
  16604. n.reject("loading-failed")
  16605. }),
  16606. n.promise()
  16607. }
  16608. ,
  16609. t.prototype.loadMeshTextures = function() {
  16610. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  16611. this.meshTexturesLoaded = !0
  16612. }
  16613. .bind(this))),
  16614. this.loadTexturesPromise
  16615. }
  16616. ,
  16617. t.prototype.shineHots = function() {
  16618. A.trigger({
  16619. func: function(e) {
  16620. var opa = e <= .5 ? 2 * e : -2 * e + 2
  16621. for(var i in this.hots){
  16622. this.hots[i].mesh.material.uniforms.opac.value = opa;
  16623. }
  16624. }
  16625. .bind(this),
  16626. cycling: !0,
  16627. duration: 3e3,
  16628. name: "hotShine"
  16629. })
  16630. }
  16631. ,
  16632. t.prototype.createHotItem = function(e, t) {
  16633. for (var i = document.createDocumentFragment(), n = Object.keys(e), r = 0; r < n.length; r++) {
  16634. var o = document.createElement("li")
  16635. , a = document.createElement("span");
  16636. a.innerHTML = e[n[r]].title || "热点",
  16637. o.hot = t[n[r]],
  16638. o.appendChild(a),
  16639. i.appendChild(o)
  16640. }
  16641. document.querySelector("#hotListContent ul").appendChild(i),
  16642. console.log(i)
  16643. }
  16644. ,
  16645. t.prototype.loadOverlays = function(overlays){
  16646. var overlays = window.data2 && window.data2.overlays /* ||
  16647. [
  16648. { depth: 0.02,
  16649. file: "https://super.4dage.com/data/TEST/overlay/b6fe7cb6bd2b6.mp4",
  16650. hasBox: 0,
  16651. height: 0.8165,
  16652. media: ["video"],
  16653. pos: [-4.3132, 0.6788, -13.5162],
  16654. qua: [0, 0.9396, 0, 0.3421],
  16655. sid: "1591079418827",
  16656. width: 0.6124
  16657. }] */
  16658. overlays && overlays.forEach((info)=>{
  16659. new Overlay(info)
  16660. })
  16661. }
  16662. ,
  16663. t.prototype.loadhots = function() {
  16664. var r = $.Deferred()
  16665. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  16666. return a.get(e, {
  16667. responseType: "json",
  16668. auth: this.isPublic ? null : u.authorizationHeader
  16669. }).done(function(e) {
  16670. window.data2 = e;
  16671. for (var t in g_data2 = hotMatcher(e),
  16672. this.hotsCount = 0,
  16673. e.hots)
  16674. this.hotsCount++,
  16675. this.hots[t] = new M(t,e.hots[t],this);
  16676. g_index = I.valueFromHash("m"),
  16677. e.tourAudio && (g_tourAudio = new Audio,
  16678. g_tourAudio.loop = !1,
  16679. g_tourAudio.addEventListener("ended", function() {
  16680. var e = document.createEvent("MouseEvent");
  16681. e.initEvent("tourAudioEnded", !0, !0),
  16682. window.dispatchEvent(e)
  16683. }));
  16684. var i = $.Deferred()
  16685. , n = g_Prefix + "data/" + this.sid + "/hot/js/data.js?" + randomTime().getTime();
  16686. a.get(n, {
  16687. responseType: "json",
  16688. auth: this.isPublic ? null : u.authorizationHeader
  16689. }).done(function(e) {
  16690. window.hotData = e,
  16691. this.createHotItem(e, this.hots);
  16692. for(let i in this.hots){
  16693. e[i] && this.hots[i].initStyleImg(e[i]);
  16694. }
  16695. i.resolve()
  16696. }
  16697. .bind(this)).fail(function() {
  16698. console.log("Data.js is empty"),
  16699. i.resolve()
  16700. }),
  16701. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc),
  16702. //window.wx && manage.weixinShare(),
  16703. r.resolve()
  16704. }
  16705. .bind(this)).fail(function() {
  16706. console.log("没有热点"),
  16707. //window.wx && manage.weixinShare(),
  16708. r.resolve()
  16709. }),
  16710. r
  16711. }
  16712. ,
  16713. t.prototype.loadPanos = function() {
  16714. if (this.loadPanosPromise)
  16715. return this.loadPanosPromise;
  16716. var e = new y(this);
  16717. return this.loadPanosPromise = e.load().then(function(e) {
  16718. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  16719. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  16720. else console.log(e.uuid)
  16721. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  16722. }
  16723. .bind(this))),
  16724. this.panos.extend(e.map(function(e) {
  16725. return new f(this,e.uuid,e,this.supportsTiles)
  16726. }
  16727. .bind(this))),
  16728. this.panos.forEach(function(i) {
  16729. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  16730. var t = this.panos.get(e);
  16731. t && this.panos.setNeighbour(i, t, !0)
  16732. }
  16733. .bind(this)),
  16734. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  16735. }
  16736. .bind(this)),
  16737. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  16738. this.supportedModes[s.PANORAMA] = !1),
  16739. $.when(this)
  16740. }
  16741. .bind(this)),
  16742. this.loadPanosPromise
  16743. }
  16744. ,
  16745. t.prototype.loadHighlightReel = function() {
  16746. var t = $.Deferred()
  16747. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  16748. return a.get(e, {
  16749. responseType: "json",
  16750. auth: this.isPublic ? null : u.authorizationHeader
  16751. }).done(function(e) {
  16752. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  16753. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  16754. t.resolve()
  16755. }
  16756. .bind(this)).fail(function() {
  16757. R.warn("Getting highlight reel failed, no highlights available"),
  16758. t.resolve()
  16759. }),
  16760. t
  16761. }
  16762. ,
  16763. t.prototype.waitForLoad = function(e, t) {
  16764. t() || (this.waitQueue.push({
  16765. object: e,
  16766. isLoadedCallback: t
  16767. }),
  16768. 1 === this.waitQueue.length && this.emit("waiting"))
  16769. }
  16770. ,
  16771. t.prototype.hide = function() {
  16772. this.floors.hide()
  16773. }
  16774. ,
  16775. t.prototype.show = function() {
  16776. this.floors.show()
  16777. }
  16778. ,
  16779. t.prototype.floorNames = function() {
  16780. return this.floors.names()
  16781. }
  16782. ,
  16783. t.prototype.warpDestFloors = function(e, t) {
  16784. if (e && this.floors.length === e.length) {
  16785. var i = e.findIndex(function(e) {
  16786. return e
  16787. }
  16788. .bind(this));
  16789. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  16790. } else
  16791. this.toggleAllFloors(!0)
  16792. }
  16793. ,
  16794. t.prototype.setFloor = function(e, t, i) {
  16795. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  16796. this.allFloorsVisible = !1,
  16797. this._setFloor(e, t, i)
  16798. }
  16799. ,
  16800. t.prototype.toggleAllFloors = function(e) {
  16801. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  16802. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  16803. this._setFloor(this.currentFloor)
  16804. }
  16805. ,
  16806. t.prototype._setFloor = function(e, t, i) {
  16807. var n;
  16808. if (t = t || this.mode,
  16809. this.emit("floor.changed", e, t, this.currentFloor),
  16810. this.currentFloor = e,
  16811. t === s.PANORAMA) {
  16812. if (this.show(),
  16813. this.shouldShowtags && this.tagsShown)
  16814. for (n in this.tags)
  16815. this.tags[n].show(u.showFloorDuration)
  16816. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  16817. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  16818. }
  16819. .bind(this)),
  16820. this.shouldShowtags && this.tagsShown))
  16821. for (n in this.tags) {
  16822. var r = this.tags[n];
  16823. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  16824. }
  16825. var o = this
  16826. , a = e;
  16827. A.start(function() {}, u.showFloorDelay, function() {
  16828. o.floors.forEach(function(t) {
  16829. t.chunks.forEach(function(e) {
  16830. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  16831. })
  16832. })
  16833. }
  16834. .bind(this))
  16835. }
  16836. ,
  16837. t.prototype.toggleExplode = function() {
  16838. this.floors.toggleExplodeHorizontal()
  16839. }
  16840. ,
  16841. t.prototype.toggleExplodeUp = function() {
  16842. this.floors.toggleExplodeVertical()
  16843. }
  16844. ,
  16845. t.prototype.nextFloor = function(e) {
  16846. return this.floors.nextFloor(this.currentFloor, e)
  16847. }
  16848. ,
  16849. t.prototype.addFloor = function(e) {
  16850. this.floors.add(e)
  16851. }
  16852. ,
  16853. t.prototype.getFloorAtPoint = function(e) {
  16854. return this.floors.getFloorAtPoint(e)
  16855. }
  16856. ,
  16857. t.prototype.getTagBySid = function(e) {
  16858. return this.tags[e]
  16859. }
  16860. ,
  16861. t.prototype.addChunk = function(e, t) {
  16862. this.floors.getOrMakeFloor(e).addChunk(t),
  16863. this.chunks.push(t)
  16864. }
  16865. ,
  16866. t.prototype.setMode = function(t) {
  16867. if (!this.supportedModes[t])
  16868. throw new x("Mode not supported for this model: " + t);
  16869. this.mode = t,
  16870. this.chunks.forEach(function(e) {
  16871. e.setMode(t)
  16872. })
  16873. }
  16874. ,
  16875. t.prototype.build = function() {
  16876. this.heroLocations = this.images.getHeroLocations(this.panos);
  16877. var e = function() {
  16878. 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()
  16879. }
  16880. .bind(this)();
  16881. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  16882. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  16883. }
  16884. .bind(this)) || e,
  16885. null === this.heroImage && R.warn("No hero image defined."),
  16886. this.currentFloor = this.floors.last(),
  16887. this.floors.build(),
  16888. this.colliders = this.floors.reduce(function(e, t) {
  16889. return e.concat(t.collider.children)
  16890. }, []),
  16891. this.panos.forEach(function(e) {
  16892. e.build1(),
  16893. e.on("enter", function() {
  16894. e.floor !== this.currentFloor && this.setFloor(e.floor)
  16895. }
  16896. .bind(this))
  16897. }
  16898. .bind(this)),
  16899. this.panos.forEach(function(e) {
  16900. e.build2()
  16901. }),
  16902. this.floors.forEach(function(e) {
  16903. this.boundingBox.union(e.boundingBox)
  16904. }
  16905. .bind(this)),
  16906. this.size = this.boundingBox.size(),
  16907. this.center = this.boundingBox.center(),
  16908. this.floors.forEach(function(e) {
  16909. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  16910. }
  16911. .bind(this)),
  16912. this.panos.populate_path_graph(),
  16913. this.skybox = new n(this.boundingBox),
  16914. this.skybox.matrixWorldNeedsUpdate = !0,
  16915. this.add(this.skybox),
  16916. setTimeout(function() {
  16917. this.hotsCount && this.shineHots()
  16918. }
  16919. .bind(this), 1300),
  16920. this.tags)
  16921. this.tags[t].build();
  16922. return R.debug("Done building model"),
  16923. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  16924. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  16925. this.buildRooms(),
  16926. this.labels.associateWithRooms(this.rooms),
  16927. $.when(this)
  16928. }
  16929. ,
  16930. t.prototype.loadLabels = function() {
  16931. this.labels = new b(this);
  16932. var e = $.Deferred();
  16933. /* if (window.MP_PREFETCHED_MODELDATA.model.player_options.labels && (this.showingLabels = !0),
  16934. !this.showingLabels) */
  16935. return e.resolve();
  16936. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  16937. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  16938. R.warn("Getting labels failed, not displaying labels."),
  16939. e.resolve()
  16940. }),
  16941. e
  16942. }
  16943. ,
  16944. t.prototype.buildRooms = function() {
  16945. this.rooms = new _(this),
  16946. this.rooms.createFromChunks(this.chunks),
  16947. this.rooms.calcRoomBoundaries()
  16948. }
  16949. ,
  16950. t.prototype.updateProjectedPanos = function() {
  16951. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  16952. }
  16953. ,
  16954. t.prototype.setProjectedPanos = function(t, i, n) {
  16955. null != n || (n = !0),
  16956. n = !!n,
  16957. this.projectedPano0 = t,
  16958. this.projectedPano1 = i,
  16959. this.skybox.material.setProjectedPanos(t, i, n),
  16960. this.chunks.forEach(function(e) {
  16961. e.materialInside.setProjectedPanos(t, i, n)
  16962. })
  16963. }
  16964. ,
  16965. t.prototype.setSide = function(t) {
  16966. this.floors.forEach(function(e) {
  16967. e.collider.material.side = t
  16968. })
  16969. }
  16970. ,
  16971. t.prototype.heroCount = function() {
  16972. return this.heroLocations ? this.heroLocations.length : 0
  16973. }
  16974. ,
  16975. t.prototype.getHeroDescriptorByIndex = function(e) {
  16976. if (e < 0)
  16977. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  16978. null;
  16979. if (this.heroCount() < 1)
  16980. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  16981. null;
  16982. var t = this.heroLocations[e];
  16983. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  16984. null) : t
  16985. }
  16986. ,
  16987. t.prototype.findPanoramicHero = function() {
  16988. for (var e in this.heroLocations)
  16989. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  16990. return this.heroLocations[e];
  16991. return null
  16992. }
  16993. ,
  16994. t.prototype.listImagePanos = function() {
  16995. var i = []
  16996. , n = this;
  16997. return this.images.forEach(function(e) {
  16998. if (e.metadata && e.metadata.scan_id) {
  16999. var t = n.panos.get(e.metadata.scan_id);
  17000. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17001. }
  17002. }),
  17003. i
  17004. }
  17005. ,
  17006. t.prototype.fadePanoMarkers = function(e, t) {
  17007. this.panos.fadeMarkerOpacity(e, t)
  17008. }
  17009. ,
  17010. t.prototype.setSweepVisibility = function(t) {
  17011. this.panos.forEach(function(e) {
  17012. e.marker && (e.marker.visible = t)
  17013. })
  17014. }
  17015. ,
  17016. t.prototype.outsideAllowed = function() {
  17017. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17018. }
  17019. ,
  17020. O.exports = t
  17021. }
  17022. ).call(this, "/js/model/Model.js")
  17023. }
  17024. , {
  17025. "../constants": 8,
  17026. "../enum/AlignmentType": 17,
  17027. "../enum/RenderOrder": 42,
  17028. "../enum/Viewmode": 51,
  17029. "../exception/BasicException": 55,
  17030. "../label/Label": 90,
  17031. "../loaders/ModelLoader": 105,
  17032. "../loaders/ModelTextureLoader": 106,
  17033. "../loaders/SweepDataLoader": 107,
  17034. "../tag/tag": 123,
  17035. "../tag/tagManager": 124,
  17036. "../objects/BoundingTextureSkybox": 143,
  17037. "../objects/Chunk": 144,
  17038. "../objects/Floor": 146,
  17039. "../objects/Panorama": 148,
  17040. "../objects/Room": 150,
  17041. "../objects/Snapshot": 153,
  17042. "../settings": 166,
  17043. "../shaders": 167,
  17044. "../util/ModelUrls": 177,
  17045. "../util/PanoramaCollection": 178,
  17046. "../util/ajax": 181,
  17047. "../util/common": 185,
  17048. "../util/easing": 186,
  17049. "../util/lerp": 188,
  17050. "../util/logger": 189,
  17051. "../util/math": 190,
  17052. "../util/texture": 194,
  17053. "../util/transitions": 195,
  17054. "./../util/browser": 182,
  17055. "./../util/showcase": 193,
  17056. "./Chunks": 135,
  17057. "./FloorCollection": 136,
  17058. "./ImageCollection": 137,
  17059. "./LabelCollection": 138,
  17060. "./RoomCollection": 141,
  17061. events: 202,
  17062. three: 217,
  17063. hot: "hot"
  17064. }],
  17065. 140: [function(e, t, i) {
  17066. "use strict";
  17067. function n() {
  17068. this.modelMap = {},
  17069. this.activeModel = null,
  17070. this.modelCount = 0,
  17071. this.tileDownloader = null,
  17072. this.panoRenderer = null
  17073. }
  17074. var r = (e("three"),
  17075. e("../util/common"))
  17076. , o = e("../exception/BasicException")
  17077. , a = e("../enum/ModelManagerEvents")
  17078. , s = e("../enum/PanoRendererEvents")
  17079. , l = e("events").EventEmitter;
  17080. n.prototype.init = function(e, t, i) {
  17081. this.tileDownloader = e,
  17082. this.panoRenderer = t,
  17083. this.qualityManager = i,
  17084. this.bindEvents()
  17085. }
  17086. ,
  17087. n.prototype.bindEvents = function() {
  17088. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17089. }
  17090. ,
  17091. n.prototype.onTileRendered = function(e, t, i, n) {}
  17092. ,
  17093. n.prototype.addModel = function(e) {
  17094. this.modelMap[e.sid] = e,
  17095. 0 === this.modelCount && this.activateModel(e.sid),
  17096. this.modelCount++,
  17097. this.emit(a.ModelAdded)
  17098. }
  17099. ,
  17100. n.prototype.getModel = function(e) {
  17101. return this.modelMap[e]
  17102. }
  17103. ,
  17104. n.prototype.activateModel = function(e) {
  17105. var t = this.modelMap[e];
  17106. if (!t)
  17107. throw new o("Tried to activate invalid model!");
  17108. var i = this.activeModel;
  17109. this.activeModel = t,
  17110. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17111. this.tileDownloader.setUrls(t.urls),
  17112. t.panos.forEach(function(e) {
  17113. e.attachToPanoRenderer(this.panoRenderer),
  17114. e.tileDownloader = this.tileDownloader,
  17115. e.qualityManager = this.qualityManager
  17116. }
  17117. .bind(this)),
  17118. this.emit(a.ActiveModelChanged, {
  17119. oldModel: i,
  17120. model: t
  17121. })
  17122. }
  17123. ,
  17124. n.prototype.getActiveModel = function() {
  17125. return this.activeModel
  17126. }
  17127. ,
  17128. r.extend(n, l),
  17129. t.exports = n
  17130. }
  17131. , {
  17132. "../enum/ModelManagerEvents": 33,
  17133. "../enum/PanoRendererEvents": 35,
  17134. "../exception/BasicException": 55,
  17135. "../util/common": 185,
  17136. events: 202,
  17137. three: 217
  17138. }],
  17139. 141: [function(r, l, e) {
  17140. (function(e) {
  17141. "use strict";
  17142. function o() {
  17143. n.call(this)
  17144. }
  17145. var a = r("../objects/Room")
  17146. , t = (r("../settings"),
  17147. r("../util/logger"))
  17148. , i = (r("../util/transitions"),
  17149. r("../util/easing"),
  17150. r("../util/common"))
  17151. , n = r("../util/IndexedCollection")
  17152. , s = r("./Chunks");
  17153. new t(e),
  17154. i.inherit(o, n),
  17155. o.prototype.getIndex = function(e) {
  17156. return e.roomId
  17157. }
  17158. ,
  17159. o.prototype.calcRoomBoundaries = function() {
  17160. this.forEach(function(e) {
  17161. e.calcBoundaries()
  17162. })
  17163. }
  17164. ,
  17165. o.prototype.createFromChunks = function(e) {
  17166. var n = {
  17167. floorId: -1,
  17168. roomId: -1
  17169. }
  17170. , r = {};
  17171. e.forEach(function(e) {
  17172. s.parseIdsFromChunkName(e.name, n);
  17173. var t = r[n.roomId];
  17174. if (!t) {
  17175. var i = o.generateRoomId(n.floorId, n.roomId);
  17176. t = new a(n.floorId,i),
  17177. this.add(t),
  17178. r[n.roomId] = t
  17179. }
  17180. t.addChunk(e)
  17181. }
  17182. .bind(this)),
  17183. this.calcRoomBoundaries()
  17184. }
  17185. ,
  17186. o.generateRoomId = function(e, t) {
  17187. return e + "_" + t
  17188. }
  17189. ,
  17190. l.exports = o
  17191. }
  17192. ).call(this, "/js/model/RoomCollection.js")
  17193. }
  17194. , {
  17195. "../objects/Room": 150,
  17196. "../settings": 166,
  17197. "../util/IndexedCollection": 175,
  17198. "../util/common": 185,
  17199. "../util/easing": 186,
  17200. "../util/logger": 189,
  17201. "../util/transitions": 195,
  17202. "./Chunks": 135
  17203. }],
  17204. 142: [function(e, t, i) {
  17205. "use strict";
  17206. function n(e, t, i) {
  17207. var n = (e = e.clone()).size()
  17208. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17209. r.boundingBox = e,
  17210. o.Mesh.call(this, r, t),
  17211. this.position.copy(e.center()),
  17212. this.frustumCulled = !1,
  17213. i && this.add(new o.WireframeHelper(this))
  17214. }
  17215. var o = e("three");
  17216. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17217. t.exports = n
  17218. }
  17219. , {
  17220. three: 217
  17221. }],
  17222. 143: [function(l, c, e) {
  17223. (function(e) {
  17224. "use strict";
  17225. function t(e) {
  17226. s.time("Computing a nice bounding cubemap");
  17227. var t = new r({
  17228. side: i.BackSide,
  17229. transparent: !0
  17230. });
  17231. t.uniforms.modelAlpha.value = 0,
  17232. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17233. this.renderOrder = a.boundingSkybox,
  17234. n.call(this, e, t),
  17235. s.timeEnd("Computing a nice bounding cubemap")
  17236. }
  17237. var i = l("three")
  17238. , n = (l("../enum/Viewmode"),
  17239. l("../shaders"),
  17240. l("./BoundingMesh"))
  17241. , r = l("../materials/ModelTextureMaterial")
  17242. , o = l("../settings")
  17243. , a = l("../enum/RenderOrder")
  17244. , s = new (l("../util/logger"))(e);
  17245. (t.prototype = Object.create(n.prototype)).constructor = t,
  17246. c.exports = t
  17247. }
  17248. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17249. }
  17250. , {
  17251. "../enum/RenderOrder": 42,
  17252. "../enum/Viewmode": 51,
  17253. "../materials/ModelTextureMaterial": 118,
  17254. "../settings": 166,
  17255. "../shaders": 167,
  17256. "../util/logger": 189,
  17257. "./BoundingMesh": 142,
  17258. three: 217
  17259. }],
  17260. 144: [function(e, t, i) {
  17261. "use strict";
  17262. function n(e) {
  17263. this.materialInside = new s({
  17264. side: r.DoubleSide
  17265. });
  17266. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17267. this.materialOutside = new r.RawShaderMaterial({
  17268. fragmentShader: o.modelOutside.fragmentShader,
  17269. vertexShader: o.modelOutside.vertexShader,
  17270. uniforms: t,
  17271. side: r.FrontSide,
  17272. name: "chunkOut"
  17273. }),
  17274. r.Mesh.call(this, e.geometry, this.materialInside),
  17275. this.name = e.name || "",
  17276. this.textureName = e.textureName,
  17277. this.meshUrl = e.meshUrl
  17278. }
  17279. var r = e("three")
  17280. , o = e("../shaders")
  17281. , a = e("../enum/Viewmode")
  17282. , s = e("../materials/ModelTextureMaterial");
  17283. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17284. this.materialInside.uniforms.map.value = e,
  17285. this.materialOutside.uniforms.map.value = e
  17286. }
  17287. ,
  17288. n.prototype.setMode = function(e) {
  17289. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17290. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17291. t.transparent = this.material.transparent,
  17292. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17293. this.material = t
  17294. }
  17295. ,
  17296. t.exports = n
  17297. }
  17298. , {
  17299. "../enum/Viewmode": 51,
  17300. "../materials/ModelTextureMaterial": 118,
  17301. "../shaders": 167,
  17302. three: 217
  17303. }],
  17304. 145: [function(e, t, i) {
  17305. "use strict";
  17306. function n(e) {
  17307. this.chunksize = e || 10,
  17308. this.chunks = {},
  17309. this.boundingBoxes = {},
  17310. this.children = [],
  17311. this.offset = new m.Vector3(0,.5,0),
  17312. this.material = new m.MeshBasicMaterial({
  17313. color: 16777215 * Math.random(),
  17314. side: m.DoubleSide
  17315. })
  17316. }
  17317. var m = e("three");
  17318. e("../enum/Viewmode"),
  17319. n.prototype.add = function(e) {
  17320. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17321. u ? (t = u.position.array,
  17322. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17323. e.faces);
  17324. var d = new m.Vector3;
  17325. if (i)
  17326. for (n = 0,
  17327. r = i.length; n < r; n += 3) {
  17328. var p = 3 * i[n]
  17329. , f = 3 * i[n + 1]
  17330. , g = 3 * i[n + 2];
  17331. o = (t[p] + t[f] + t[g]) / 3,
  17332. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17333. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17334. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17335. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17336. this.boundingBoxes[l] = new m.Box3),
  17337. 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]),
  17338. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17339. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17340. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17341. }
  17342. else
  17343. for (n = 0,
  17344. r = t.length; n < r; n += 9)
  17345. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17346. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17347. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17348. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17349. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17350. this.boundingBoxes[l] = new m.Box3),
  17351. 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]),
  17352. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17353. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17354. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17355. }
  17356. ,
  17357. n.prototype.build = function() {
  17358. var e = new m.Object3D;
  17359. for (var t in e.material = this.material,
  17360. this.chunks) {
  17361. var i = this.chunks[t]
  17362. , n = new m.BufferGeometry;
  17363. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17364. n.boundingBox = this.boundingBoxes[t];
  17365. var r = new m.Mesh(n,this.material);
  17366. r.material.visible = !1,
  17367. e.add(r),
  17368. this.chunks[t] = []
  17369. }
  17370. return e
  17371. }
  17372. ,
  17373. t.exports = n
  17374. }
  17375. , {
  17376. "../enum/Viewmode": 51,
  17377. three: 217
  17378. }],
  17379. 146: [function(e, t, i) {
  17380. "use strict";
  17381. var n = e("three")
  17382. , r = e("../settings")
  17383. , o = e("../util/common")
  17384. , a = e("../util/lerp")
  17385. , s = e("./ChunkedCollider")
  17386. , l = e("../util/transitions")
  17387. , c = e("../util/easing")
  17388. , h = (e("../objects/Panorama"),
  17389. e("../enum/RenderOrder"));
  17390. e("../localization/localize");
  17391. function u(e, t, i) {
  17392. n.Object3D.call(this),
  17393. this.model = e,
  17394. this.floorIndex = t,
  17395. this.lang = r.languageTag,
  17396. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17397. this.panos = [],
  17398. this.chunks = [],
  17399. this.colliderBuilder = new s(3),
  17400. this.collider = null,
  17401. this.center = null,
  17402. this.boundingBox = new n.Box3,
  17403. this.size = null,
  17404. this.hidden = !1,
  17405. this.conservativeBoundingBox = new n.Box3,
  17406. this.debugColor = 16777215 * Math.random(),
  17407. this.transition = null
  17408. }
  17409. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17410. this.model.setFloor(this, e)
  17411. }
  17412. ,
  17413. u.prototype.hide = function(e) {
  17414. if (!this.hidden || this.transition) {
  17415. this.chunks.forEach(function(e) {
  17416. e.material.transparent = !0
  17417. }),
  17418. l.cancel(this.transition);
  17419. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  17420. , i = e ? 0 : r.hideFloorDelay / t;
  17421. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  17422. this.hidden = !0
  17423. }
  17424. .bind(this), i, c.easeInOutQuad)
  17425. }
  17426. }
  17427. ,
  17428. u.prototype.show = function(e) {
  17429. if (this.hidden || this.transition) {
  17430. this.hidden = !1,
  17431. l.cancel(this.transition);
  17432. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  17433. , i = e ? 0 : r.showFloorDelay / t;
  17434. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  17435. this.hidden || this.chunks.forEach(function(e) {
  17436. e.material.transparent = !1
  17437. })
  17438. }
  17439. .bind(this), i, c.easeInOutQuad)
  17440. }
  17441. }
  17442. ,
  17443. u.prototype.toggle = function(e, t) {
  17444. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17445. }
  17446. ,
  17447. u.prototype.containsPoint = function(t) {
  17448. return this.collider.children.some(function(e) {
  17449. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  17450. e.geometry.boundingBox.containsPoint(t)
  17451. })
  17452. }
  17453. ,
  17454. u.prototype.distanceToPoint = function(i) {
  17455. var n = null
  17456. , r = 1 / 0;
  17457. return this.collider.children.forEach(function(e) {
  17458. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  17459. var t = e.geometry.boundingBox.distanceToPoint(i);
  17460. (!n || t < r) && (r = t,
  17461. n = e)
  17462. }),
  17463. r
  17464. }
  17465. ,
  17466. u.prototype.addChunk = function(e) {
  17467. e.renderOrder = h.ghostFloor,
  17468. this.add(e),
  17469. this.chunks.push(e),
  17470. this.boundingBox.union(e.geometry.boundingBox),
  17471. this.size = this.boundingBox.size(),
  17472. this.colliderBuilder.add(e.geometry)
  17473. }
  17474. ,
  17475. u.prototype.addPano = function(e) {
  17476. this.panos.push(e),
  17477. this.add(e.skyboxMesh),
  17478. e.marker && this.add(e.marker);
  17479. var t = new n.Vector3(1,1,1)
  17480. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  17481. this.boundingBox.union(i)
  17482. }
  17483. ,
  17484. u.prototype.build = function() {
  17485. this.collider = this.colliderBuilder.build(!0),
  17486. this.add(this.collider),
  17487. this.center = this.boundingBox.center(),
  17488. this.conservativeBoundingBox.copy(this.boundingBox),
  17489. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  17490. return e.geometry.boundingBox.min.y
  17491. }), 5),
  17492. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  17493. return e.geometry.boundingBox.max.y
  17494. }), 5),
  17495. this.colliderBuilder = null
  17496. }
  17497. ,
  17498. u.prototype.toShortString = function() {
  17499. return o.nth(this.floorIndex + 1)
  17500. }
  17501. ,
  17502. u.prototype.toString = function() {
  17503. return this.name
  17504. }
  17505. ,
  17506. t.exports = u
  17507. }
  17508. , {
  17509. "../enum/RenderOrder": 42,
  17510. "../localization/localize": 108,
  17511. "./strings-cn-CN": 109,
  17512. "../objects/Panorama": 148,
  17513. "../settings": 166,
  17514. "../util/common": 185,
  17515. "../util/easing": 186,
  17516. "../util/lerp": 188,
  17517. "../util/transitions": 195,
  17518. "./ChunkedCollider": 145,
  17519. three: 217
  17520. }],
  17521. 147: [function(e, t, i) {
  17522. "use strict";
  17523. function n(e) {
  17524. this.player = e,
  17525. this.obj3d = null,
  17526. this.UP = new u.Vector3(0,1,0)
  17527. }
  17528. var u = e("three")
  17529. , d = e("../settings");
  17530. n.prototype.prefs = {
  17531. linewidth: 3,
  17532. height: .07,
  17533. opacity: .45,
  17534. endScale: .05
  17535. },
  17536. n.prototype.discard = function() {
  17537. if (this.obj3d) {
  17538. var e = this.obj3d.parent;
  17539. e && e.remove(this.obj3d)
  17540. }
  17541. this.obj3d = null
  17542. }
  17543. ,
  17544. n.prototype.draw = function() {
  17545. if (this.discard(),
  17546. d.showNeighbors) {
  17547. var e = this.player.currentPano.floor;
  17548. this.obj3d = new u.Object3D;
  17549. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17550. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17551. i.y += this.prefs.height;
  17552. var n = .1525
  17553. , r = new u.Matrix4;
  17554. for (var o in t)
  17555. if (t[o]) {
  17556. var a = this.player.model.panos.get(o)
  17557. , s = (a.position.clone().sub(this.player.model.position),
  17558. a.position.clone().sub(a.floorPosition))
  17559. , l = a.floorPosition.clone().sub(this.player.model.position);
  17560. l.y += this.prefs.height;
  17561. var c = new u.Geometry;
  17562. 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)),
  17563. 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)),
  17564. r.identity().setPosition(s),
  17565. c.applyMatrix(r),
  17566. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  17567. 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)),
  17568. r.lookAt(l, i, this.UP).setPosition(l),
  17569. c.applyMatrix(r),
  17570. c.vertices.push(l, i);
  17571. var h = new u.Line(c,new u.LineBasicMaterial({
  17572. color: a.debugColor.getHex(),
  17573. transparent: !0,
  17574. opacity: this.prefs.opacity,
  17575. depthWrite: !1,
  17576. name: "sLine" + o,
  17577. linewidth: this.prefs.linewidth
  17578. }));
  17579. this.obj3d.add(h)
  17580. }
  17581. e.add(this.obj3d)
  17582. }
  17583. }
  17584. ,
  17585. n.prototype.update = function() {
  17586. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17587. }
  17588. ,
  17589. t.exports = n
  17590. }
  17591. , {
  17592. "../settings": 166,
  17593. three: 217
  17594. }],
  17595. 148: [function(S, M, e) {
  17596. (function(e) {
  17597. "use strict";
  17598. function r(e, t, i, n) {
  17599. this.model = e,
  17600. this.id = t,
  17601. this.alignmentType = i.alignmentType || c.ALIGNED,
  17602. this.neighbourUUIDs = i.neighbours || null,
  17603. this.neighbourPanos = null,
  17604. this.floor = null,
  17605. this.floorIndex = i.floor,
  17606. this.failedLoadingAt = 0,
  17607. this.maxLoadRetries = 4,
  17608. this.origin = i.position.clone(),
  17609. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  17610. this.quaternion = i.quaternion.clone(),
  17611. this.skyboxMesh = new s.Mesh(E),
  17612. this.skyboxMesh.position.copy(this.position),
  17613. this.skyboxMesh.quaternion.copy(this.quaternion),
  17614. this.skyboxMesh.name = "skybox",
  17615. this.skyboxMesh.visible = !1,
  17616. this.skyboxMesh.updateMatrix(),
  17617. this.skyboxMesh.updateMatrixWorld(),
  17618. this.marker = null,
  17619. this.showFloorMarker = this.showFloorMarker = !window.MP_PREFETCHED_MODELDATA.hideFloorMarker,
  17620. this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  17621. map: b,
  17622. side: s.DoubleSide,
  17623. opacity: 0,
  17624. transparent: !0,
  17625. depthWrite: !1
  17626. })),
  17627. this.marker.visible = this.showFloorMarker,
  17628. this.marker.renderOrder = l.panoMarker,
  17629. this.marker.name = "marker",
  17630. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  17631. this.marker.updateMatrixWorld(),
  17632. a.colorMarkerOnLoad && this.on("load", function() {
  17633. this.marker.material.color.set(65280)
  17634. })),
  17635. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  17636. this.floorPosition = i.puck ? i.puck.clone() : null,
  17637. this.tiled = n,
  17638. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  17639. this.solidSkybox.flipY = !1,
  17640. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  17641. this.solidSkybox.magFilter = s.LinearFilter,
  17642. this.solidSkybox.generateMipmaps = !1)),
  17643. this.zoomed = !1,
  17644. this.panoRenderer = null,
  17645. this.qualityManager = null,
  17646. this.tileDownloader = null,
  17647. this.tiledPanoRenderTarget = null,
  17648. this.minimumTiledPanoLoaded = !1,
  17649. this.highestPartialTileRenderOpCompleted = 0,
  17650. this.highestFullTileRenderOpCompleted = 0,
  17651. this.shouldRedrawOnBaseLoaded = !1,
  17652. this.lockUntilRenderingComplete = !1,
  17653. a.colorMarkerOnLoad && this.on("load", function() {
  17654. this.marker.material.color.set(65280)
  17655. }),
  17656. (e = new s.TextureLoader).setCrossOrigin(!0);
  17657. var r = e.load("images/texture.jpg");
  17658. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  17659. color: 16777215,
  17660. transparent: !0,
  17661. opacity: .75,
  17662. map: r
  17663. })),
  17664. this.vrMarker.boluoType = "vr",
  17665. this.vrMarker.position.z = 1,
  17666. this.vrMarker.enabled = !0,
  17667. this.vrMarker.visible = !1,
  17668. window.vrMarkers = window.vrMarkers || [],
  17669. window.vrMarkers.push(this.vrMarker),
  17670. this.marker && this.marker.add(this.vrMarker),
  17671. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  17672. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  17673. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  17674. this.adjustAngleEnable) {
  17675. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  17676. this.skyboxMesh.quaternion.multiply(i);
  17677. var o = new s.Quaternion;
  17678. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  17679. this.skyboxMesh.quaternion.multiply(o),
  17680. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  17681. this.skyboxMesh.quaternion.multiply(n),
  17682. this.skyboxMesh.updateMatrix(),
  17683. this.skyboxMesh.updateMatrixWorld(),
  17684. this.model.updateProjectedPanos()
  17685. }
  17686. }
  17687. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  17688. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  17689. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  17690. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  17691. S("../enum/GLCubeFaces"),
  17692. 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");
  17693. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  17694. function() {
  17695. this.setZoomed(!1),
  17696. this.emit("enter", {
  17697. oldPano: t,
  17698. newPano: this
  17699. }),
  17700. t = this
  17701. }
  17702. ),
  17703. r.prototype.exit = function() {
  17704. this.tiled ? (this.clearWaitDeferreds(),
  17705. this.minimumTiledPanoLoaded = !1,
  17706. this.tiledPanoRenderTarget = null,
  17707. this.setZoomed(!1),
  17708. this.panoRenderer.deactivateTiledPano(this),
  17709. this.highestPartialTileRenderOpCompleted = 0,
  17710. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  17711. this.solidSkybox.loaded = !1,
  17712. this.solidSkybox.version = 0),
  17713. this.emit("exit")
  17714. }
  17715. ,
  17716. r.prototype.hoverOn = function(e) {
  17717. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  17718. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  17719. }
  17720. ,
  17721. r.prototype.hoverOff = function(e) {
  17722. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  17723. }
  17724. ,
  17725. r.prototype.build1 = function() {
  17726. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  17727. this.floor.addPano(this),
  17728. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  17729. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  17730. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  17731. }
  17732. ,
  17733. r.prototype.build2 = function() {
  17734. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  17735. this.height = this.position.distanceTo(this.floorPosition),
  17736. this.placeMarker()
  17737. }
  17738. ,
  17739. r.prototype.interpolateFloorPosition = function() {
  17740. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  17741. return !!e.floorPosition
  17742. }).sort(function(e, t) {
  17743. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  17744. }
  17745. .bind(this))
  17746. , t = this.position.clone();
  17747. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  17748. t
  17749. }
  17750. ,
  17751. r.prototype.raycastFloorPosition = function() {
  17752. I.warn("Performance warning: Raycasting to find floor position");
  17753. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  17754. return e.length ? e[0].point : null
  17755. }
  17756. ,
  17757. 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)],
  17758. function() {
  17759. I.warn("Performance warning: Raycasting to find floor index");
  17760. for (var e = 0; e < i.length; e++) {
  17761. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  17762. if (t.length)
  17763. return t[0].object.parent.parent
  17764. }
  17765. return null
  17766. }
  17767. ),
  17768. r.prototype.placeMarker = function() {
  17769. this.marker && (this.marker.position.copy(this.floorPosition),
  17770. this.marker.position.y += .05,
  17771. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  17772. }
  17773. ,
  17774. r.prototype.translate = function(e) {
  17775. this.position.add(e),
  17776. this.floorPosition.add(e)
  17777. }
  17778. ,
  17779. r.prototype.findClosestMidtpointPanoTo = function(e) {
  17780. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  17781. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  17782. }
  17783. ,
  17784. r.prototype.attachToPanoRenderer = function(e) {
  17785. this.panoRenderer = e,
  17786. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  17787. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  17788. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  17789. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  17790. }
  17791. ;
  17792. var w, T, x = {};
  17793. r.prototype.getWaitDeferred = function(e) {
  17794. var t = x[this.id];
  17795. t || (t = {},
  17796. x[this.id] = t);
  17797. var i = t[e];
  17798. return i || (i = {
  17799. deferred: $.Deferred(),
  17800. active: !1
  17801. },
  17802. t[e] = i),
  17803. i
  17804. }
  17805. ,
  17806. r.prototype.resetWaitDeferred = function(e) {
  17807. var t = this.getWaitDeferred(e);
  17808. t.active = !1,
  17809. t.deferred = $.Deferred()
  17810. }
  17811. ,
  17812. r.prototype.clearWaitDeferreds = function() {
  17813. var e = x[this.id];
  17814. for (var t in e || (e = {},
  17815. x[this.id] = e),
  17816. e)
  17817. if (e.hasOwnProperty(t)) {
  17818. var i = e[t];
  17819. i.active = !1,
  17820. i.deferred = $.Deferred()
  17821. }
  17822. }
  17823. ,
  17824. r.prototype.loadTiledPano = (new s.Vector3,
  17825. w = [],
  17826. T = [],
  17827. function(e, t, i, n, r, o) {
  17828. null != n || (n = !0),
  17829. null != r || (r = !0);
  17830. var a = this.getWaitDeferred(e)
  17831. , s = a.deferred
  17832. , l = null
  17833. , c = null;
  17834. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  17835. c = i.vFov)),
  17836. !this.isLoaded(e)) {
  17837. if (!a.active) {
  17838. if (a.active = !0,
  17839. i) {
  17840. var h = A.matchingTilesInDirection(this, e, t, l, c);
  17841. w[this.id + ":" + e] = {
  17842. tileCount: 0,
  17843. targetTileCount: h
  17844. },
  17845. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  17846. }
  17847. T[this.id] || (T[this.id] = !0,
  17848. this.on(f.LoadComplete, function(e, t) {
  17849. var i = this.getWaitDeferred(e).deferred;
  17850. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  17851. this.resetWaitDeferred(e))
  17852. }
  17853. .bind(this)),
  17854. this.on(f.LoadFailed, function(e) {
  17855. var t = this.getWaitDeferred(e).deferred;
  17856. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  17857. this.resetWaitDeferred(e))
  17858. }
  17859. .bind(this)),
  17860. this.on(f.TileLoaded, function(e, t, i) {
  17861. var n = this.getWaitDeferred(e).deferred;
  17862. if (n && "pending" === n.state()) {
  17863. n.notify(e, t, i);
  17864. var r = w[this.id + ":" + e];
  17865. r && (r.tileCount++,
  17866. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  17867. n.resolve(e, i),
  17868. this.resetWaitDeferred(e)))
  17869. }
  17870. }
  17871. .bind(this)))
  17872. }
  17873. this.tileDownloader.clearForceQueue(),
  17874. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  17875. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  17876. this.panoRenderer.renderPanoTiles(this.id, t, r)
  17877. }
  17878. return s.promise()
  17879. }
  17880. ),
  17881. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  17882. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  17883. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  17884. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  17885. }
  17886. ,
  17887. r.prototype.onTileRendered = function(e, t, i, n) {
  17888. e === this.id && this.emit(f.TileLoaded, t, i, n)
  17889. }
  17890. ,
  17891. r.prototype.onPanoRendered = function(e, t, i, n) {
  17892. e === this.id && (this.minimumTiledPanoLoaded = !0,
  17893. this.updateSkyboxForZoomLevel(),
  17894. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  17895. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  17896. this.emit("load", t),
  17897. this.model.emit("load", this),
  17898. this.emit(f.LoadComplete, t, i))
  17899. }
  17900. ,
  17901. r.prototype.setZoomed = function(e) {
  17902. this.zoomed = e,
  17903. this.updateSkyboxForZoomLevel()
  17904. }
  17905. ,
  17906. r.prototype.ensureSkyboxReadyForRender = function() {
  17907. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  17908. this.solidSkybox.loaded = !0)
  17909. }
  17910. ,
  17911. r.prototype.updateSkyboxForZoomLevel = function() {
  17912. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  17913. }
  17914. ,
  17915. r.prototype.getSkyboxTexture = function() {
  17916. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  17917. }
  17918. ,
  17919. r.prototype.onTileRenderFail = function(e, t, i) {
  17920. e === this.id && this.emit(f.LoadFailed, t)
  17921. }
  17922. ,
  17923. r.prototype.isLoaded = function(e) {
  17924. if (this.tiled) {
  17925. if (e && "string" == typeof e)
  17926. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  17927. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  17928. }
  17929. if (e && "number" == typeof e)
  17930. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  17931. return !!this.solidSkybox.high || e in this.solidSkybox
  17932. }
  17933. ,
  17934. r.prototype.loadCube = function(a) {
  17935. if (this.isLoaded(a))
  17936. return I.info("Skipping load of pano, already loaded"),
  17937. $.when();
  17938. this.emit("loading", a),
  17939. this.model.emit("loading", this);
  17940. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  17941. , e = n.filter(function(e) {
  17942. return !e
  17943. });
  17944. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  17945. a = "high",
  17946. n = p.getCubemapUrls(this.model.urls, this.id, a));
  17947. var t = 0
  17948. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  17949. return u.getImage(n[t])
  17950. }
  17951. .bind(this));
  17952. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  17953. return this.solidSkybox[a] = [e, t, i, n, r, o],
  17954. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  17955. this.solidSkybox.low = null),
  17956. this.solidSkybox.needsUpdate = !0,
  17957. this.emit("load", a),
  17958. this.model.emit("load", this),
  17959. this
  17960. }
  17961. .bind(this), function() {
  17962. I.error("Downloading cubemap for pano", this.id, "failed"),
  17963. this.failedLoadingAt = Date.now()
  17964. }
  17965. .bind(this), function() {
  17966. return $.when(++t, 6)
  17967. })
  17968. }
  17969. ,
  17970. r.raycastsSkipped = 0,
  17971. r.raycastsDone = 0,
  17972. r.prototype.findNeighourPanos = function() {
  17973. return this.model.panos.setNeighbour(this.id, this.id, !1),
  17974. this.model.panos.forEach(function(e) {
  17975. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  17976. var t = this.position.distanceTo(e.position);
  17977. if (t > a.panoramaNeighbourMaxDistance)
  17978. return this.model.panos.setNeighbour(this, e, !1),
  17979. void r.raycastsSkipped++;
  17980. var i = e.position.clone().sub(this.position).normalize()
  17981. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  17982. r.raycastsDone++,
  17983. this.model.panos.setNeighbour(this, e, 0 === n.length),
  17984. 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)))
  17985. }
  17986. }
  17987. .bind(this)),
  17988. this.model.panos.neighbourMap[this.id]
  17989. }
  17990. ,
  17991. r.prototype.worldPosition = function() {
  17992. return this.position
  17993. }
  17994. ,
  17995. r.prototype.addTextSprite = function(e, t) {
  17996. this.removeTextSprite();
  17997. var i = document.createElement("canvas")
  17998. , n = i.getContext("2d");
  17999. i.width = 256,
  18000. i.height = 256;
  18001. n.font = "bold 60px Arial",
  18002. n.fillStyle = "white";
  18003. var r = n.measureText(e).width;
  18004. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18005. var o = new s.Texture(i);
  18006. o.needsUpdate = !0;
  18007. var a = new s.SpriteMaterial({
  18008. map: o,
  18009. color: t || 16428055
  18010. });
  18011. this.text3d = new s.Sprite(a),
  18012. this.text3d.position.copy(this.skyboxMesh.position),
  18013. this.floor.add(this.text3d)
  18014. }
  18015. ,
  18016. r.prototype.removeTextSprite = function() {
  18017. this.text3d && (this.floor.remove(this.text3d),
  18018. this.text3d = null)
  18019. }
  18020. ,
  18021. r.prototype.isAligned = function() {
  18022. return this.alignmentType === c.ALIGNED
  18023. }
  18024. ,
  18025. r.filters = {
  18026. inDirection: function(t, i, n) {
  18027. return function(e) {
  18028. return e.position.clone().sub(t).normalize().dot(i) > n
  18029. }
  18030. },
  18031. inFloorDirection: function(t, i, n) {
  18032. return function(e) {
  18033. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18034. }
  18035. },
  18036. inPanoDirection: function(n, r, o) {
  18037. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18038. function(e) {
  18039. var t = e.floorPosition.clone().sub(n).normalize()
  18040. , i = e.position.clone().sub(n).normalize();
  18041. return t.dot(r) > o || i.dot(r) > o
  18042. }
  18043. },
  18044. atFloor: function(t) {
  18045. return function(e) {
  18046. return !t || e.floor === t
  18047. }
  18048. },
  18049. not: function(t) {
  18050. return function(e) {
  18051. return e !== t
  18052. }
  18053. },
  18054. notIn: function(t) {
  18055. return function(e) {
  18056. return -1 === t.indexOf(e)
  18057. }
  18058. },
  18059. isLoaded: function() {
  18060. return function(e) {
  18061. return e.isLoaded()
  18062. }
  18063. },
  18064. isNotLoaded: function() {
  18065. return function(e) {
  18066. return !e.isLoaded()
  18067. }
  18068. },
  18069. isCloseEnoughTo: function(t, i) {
  18070. return function(e) {
  18071. return t.distanceTo(e.floorPosition) < i
  18072. }
  18073. },
  18074. hasMinimumHeightDifferenceTo: function(t, i) {
  18075. return function(e) {
  18076. return Math.abs(e.position.y - t.y) > i
  18077. }
  18078. },
  18079. isNotBehindNormal: function(t, i) {
  18080. var n = new s.Vector3;
  18081. return i = i.clone(),
  18082. function(e) {
  18083. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18084. }
  18085. },
  18086. isNeighbourPanoTo: function(t) {
  18087. return function(e) {
  18088. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18089. }
  18090. },
  18091. isNeighbourOfNeighbourTo: function(n) {
  18092. return function(i) {
  18093. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18094. var t = n.model.panos.get(e);
  18095. return !!t && t.neighbourPanos[i.id]
  18096. })
  18097. }
  18098. },
  18099. isNotRecentlyFailed: function(t) {
  18100. return function(e) {
  18101. return Date.now() - e.failedLoadingAt > t
  18102. }
  18103. },
  18104. isOnVisibleFloor: function() {
  18105. return function(e) {
  18106. return !e.floor.hidden
  18107. }
  18108. },
  18109. isPanoAligned: function() {
  18110. return function(e) {
  18111. return e.isAligned()
  18112. }
  18113. }
  18114. },
  18115. r.sortFunctions = {
  18116. distanceToPoint: function(i) {
  18117. return function(e, t) {
  18118. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18119. }
  18120. },
  18121. floorDistanceToPoint: function(i) {
  18122. return function(e, t) {
  18123. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18124. }
  18125. },
  18126. choose: function(i) {
  18127. return function(e, t) {
  18128. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18129. }
  18130. }
  18131. },
  18132. r.scoreFunctions = {
  18133. distance: function(t, i) {
  18134. return i = i || a.navigation.distanceFactor,
  18135. function(e) {
  18136. return t ? t.position.distanceTo(e.position) * i : 0
  18137. }
  18138. },
  18139. distanceSquared: function(t, i) {
  18140. return i = i || a.navigation.distanceFactor,
  18141. function(e) {
  18142. return t ? t.position.distanceToSquared(e.position) * i : 0
  18143. }
  18144. },
  18145. direction: function(t, i) {
  18146. return function(e) {
  18147. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18148. }
  18149. },
  18150. angle: function(t, i) {
  18151. return function(e) {
  18152. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18153. }
  18154. },
  18155. inFieldOfView: function(t, i) {
  18156. return function(e) {
  18157. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18158. }
  18159. },
  18160. optionality: function(t) {
  18161. return function(e) {
  18162. return e.neighbourUUIDs.filter(function(e) {
  18163. return !(e in t.neighbourUUIDs) && e !== t.id
  18164. }).length * a.navigation.optionalityFactor
  18165. }
  18166. },
  18167. penalizeHeightDifferenceUnder: function(t, i) {
  18168. return function(e) {
  18169. return t.y - e.position.y < i ? -20 : 0
  18170. }
  18171. }
  18172. },
  18173. M.exports = r
  18174. }
  18175. ).call(this, "/js/objects/Panorama.js")
  18176. }
  18177. , {
  18178. "../enum/AlignmentType": 17,
  18179. "../enum/GLCubeFaces": 25,
  18180. "../enum/PanoRendererEvents": 35,
  18181. "../enum/PanoSizeClass": 36,
  18182. "../enum/PanoramaEvents": 37,
  18183. "../enum/RenderLayers": 41,
  18184. "../enum/RenderOrder": 42,
  18185. "../enum/TileDownloaderEvents": 45,
  18186. "../enum/Viewmode": 51,
  18187. "../exception/BasicException": 55,
  18188. "../scene/SceneRenderer": 158,
  18189. "../settings": 166,
  18190. "../tile/TileUtils": 174,
  18191. "../util/ajax": 181,
  18192. "../util/common": 185,
  18193. "../util/lerp": 188,
  18194. "../util/logger": 189,
  18195. "../util/panorama": 191,
  18196. "../util/texture": 194,
  18197. "../util/transitions": 195,
  18198. events: 202,
  18199. three: 217
  18200. }],
  18201. 149: [function(e, t, i) {
  18202. "use strict";
  18203. function n(e) {
  18204. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18205. t.map.value = d,
  18206. t.opacity.value = 0,
  18207. t.color.value.set(o.reticuleColor),
  18208. t.showMouseMarker = !window.MP_PREFETCHED_MODELDATA.hideMouseMarker;
  18209. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18210. side: r.DoubleSide,
  18211. depthWrite: !1,
  18212. depthTest: !1,
  18213. transparent: !0,
  18214. vertexShader: c.waypoint.vertexShader,
  18215. fragmentShader: c.waypoint.fragmentShader,
  18216. uniforms: t,
  18217. name: "waypoint",
  18218. opacity: 0,
  18219. visible: t.showMouseMarker
  18220. })),
  18221. this.layers.set(h.RETICULE),
  18222. this.renderOrder = u.reticule,
  18223. this.player = e,
  18224. this.direction = new r.Vector3,
  18225. this.hidden = !0,
  18226. this.mouseLastMoveTime = Date.now()
  18227. }
  18228. var r = e("three")
  18229. , o = e("../settings")
  18230. , a = e("../util/transitions")
  18231. , s = e("../util/texture")
  18232. , l = e("../util/lerp")
  18233. , c = e("../shaders")
  18234. , h = e("../enum/RenderLayers")
  18235. , u = e("../enum/RenderOrder")
  18236. , d = s.load("images/reticule-256x256.png");
  18237. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18238. this.hidden = i,
  18239. this.mouseLastMoveTime = Date.now()
  18240. }
  18241. ,
  18242. n.prototype.hide = function() {
  18243. this.hidden || (this.hidden = !0,
  18244. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18245. }
  18246. ,
  18247. n.prototype.show = function() {
  18248. this.hidden = !1,
  18249. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18250. }
  18251. ,
  18252. n.prototype.update = function() {
  18253. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18254. }
  18255. ,
  18256. n.prototype.updatePosition = function(e, t) {
  18257. if (!this.hidden) {
  18258. if (!t)
  18259. return this.hide();
  18260. var i = t.point
  18261. , n = e.distanceTo(i)
  18262. , r = 1 + .01 * n;
  18263. n < 1 && (r -= 1 - n),
  18264. this.show(),
  18265. this.scale.set(r, r, r),
  18266. this.direction = this.direction.multiplyScalar(.8),
  18267. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18268. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18269. this.lookAt(this.position.clone().add(this.direction))
  18270. }
  18271. }
  18272. ,
  18273. n.prototype.writeAstag = function() {
  18274. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18275. , t = new Date;
  18276. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18277. var i = {
  18278. enabled: !0,
  18279. version: "0",
  18280. created: t.toISOString(),
  18281. created_by: "APITest",
  18282. position: this.position.clone(),
  18283. stem: {
  18284. enabled: o.tags.pole.enabled,
  18285. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18286. },
  18287. label: "tag " + this.tagCount,
  18288. description: "Description " + e,
  18289. floor: function(e) {
  18290. if (e.currentFloor) {
  18291. var t = e.floors.indexOf(e.currentFloor);
  18292. return -1 < t ? t : void 0
  18293. }
  18294. }(this.player.model),
  18295. type: "info",
  18296. metadata: {
  18297. preferred_camera: {
  18298. mode: this.player.mode
  18299. }
  18300. }
  18301. };
  18302. console.log("--------------------------"),
  18303. console.log(JSON.stringify(i));
  18304. var n = this.player.model.addtag(e, i).build();
  18305. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18306. n.visible || n.show(o.tags.startup.fadeInDuration))
  18307. }
  18308. ,
  18309. t.exports = n
  18310. }
  18311. , {
  18312. "../enum/RenderLayers": 41,
  18313. "../enum/RenderOrder": 42,
  18314. "../settings": 166,
  18315. "../shaders": 167,
  18316. "../util/lerp": 188,
  18317. "../util/texture": 194,
  18318. "../util/transitions": 195,
  18319. three: 217
  18320. }],
  18321. 150: [function(e, t, i) {
  18322. "use strict";
  18323. function n(e, t) {
  18324. this.chunks = [],
  18325. this.floorId = e,
  18326. this.roomId = t,
  18327. this.position = new l.Vector3
  18328. }
  18329. var l = e("three");
  18330. n.prototype.addChunk = function(e) {
  18331. this.chunks.push(e)
  18332. }
  18333. ,
  18334. n.prototype.calcBoundaries = function() {
  18335. 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++) {
  18336. var a = this.chunks[o].geometry.attributes.position;
  18337. if (a)
  18338. for (var s = 0; s < a.array.length; s += 3)
  18339. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18340. t.add(e),
  18341. 0 === s ? (i.copy(e),
  18342. n.copy(e)) : (i.max(e),
  18343. n.min(e)),
  18344. r++
  18345. }
  18346. 0 < r ? (t.multiplyScalar(1 / r),
  18347. this.average = t) : this.average = null,
  18348. this.boundsMax = i,
  18349. this.boundsMin = n,
  18350. this.center = new l.Vector3,
  18351. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18352. }
  18353. ,
  18354. t.exports = n
  18355. }
  18356. , {
  18357. three: 217
  18358. }],
  18359. 151: [function(o, v, e) {
  18360. (function(e) {
  18361. "use strict";
  18362. function t(e, t, i) {
  18363. this.obj3d = null,
  18364. this.nodes = [],
  18365. this.colorHull = [],
  18366. this.shortPaths = {},
  18367. this.floorHull = null,
  18368. this.cameraHull = null,
  18369. this.floorPathDistance = 0,
  18370. this.floorCurvePoints = null,
  18371. this.floorCurveColors = null,
  18372. this.camCurvePoints = null,
  18373. this.warpDestHeroLoc = null,
  18374. this.warpDestPano = null,
  18375. this.warpPathPoints = null,
  18376. this.warpPathLengths = [0],
  18377. this.warpLength = 0,
  18378. this.closeWarpDistance = 4,
  18379. this.UP = U.UP.clone(),
  18380. this.longestStep = 0,
  18381. this.upcomingTransType = null,
  18382. this.burnsDir = 1,
  18383. this.prevNextDist = 0,
  18384. this.nextI = 0,
  18385. this.activeTransType = null,
  18386. this.lastTransType = null,
  18387. this.bunnyObj = null,
  18388. this.director = e,
  18389. this.player = t,
  18390. this.playerControls = i,
  18391. this.modelManager = t.modelManager,
  18392. this.updateModel(),
  18393. this.updateDefaultsFromModelData(),
  18394. this.bindEvents(),
  18395. this.warping = !1,
  18396. this.waitingToWarp = !1,
  18397. this.warpInterrupted = !1,
  18398. this.warpInterruptionBlackoutStyle = null,
  18399. this.warpInterruptionTravelTime = null
  18400. }
  18401. 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"),
  18402. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  18403. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  18404. 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"),
  18405. pathEnd: n.load("images/End.png"),
  18406. 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==")
  18407. };
  18408. t.prototype.setScene = function(e) {
  18409. this.createCpm(e),
  18410. this.createBunnyObj(e)
  18411. }
  18412. ,
  18413. t.prototype.updateModel = function() {
  18414. this.model = this.modelManager.getActiveModel()
  18415. }
  18416. ,
  18417. t.prototype.bindEvents = function() {
  18418. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18419. }
  18420. ,
  18421. t.prototype.updateDefaultsFromModelData = function() {
  18422. this.model.data
  18423. }
  18424. ,
  18425. t.prototype.pointPathDistance = function(e) {
  18426. for (var t = 0, i = 1; i < e.length; i += 1)
  18427. t += e[i - 1].distanceTo(e[i]);
  18428. return t
  18429. }
  18430. ,
  18431. t.prototype.pointPathLengths = function(e) {
  18432. for (var t = [0], i = 1; i < e.length; i += 1)
  18433. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18434. return t
  18435. }
  18436. ,
  18437. t.prototype.interpAlongPath = function(e, t, i) {
  18438. var n, r = new P.Vector3, o = t[t.length - 1];
  18439. if (i < 1) {
  18440. n = i * o;
  18441. for (var a = 1; a < t.length; a += 1)
  18442. if (t[a] > n) {
  18443. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  18444. return r.copy(e[a]),
  18445. r.sub(e[a - 1]),
  18446. r.multiplyScalar(s),
  18447. r.add(e[a - 1]),
  18448. r
  18449. }
  18450. } else
  18451. r.copy(e[e.length - 1]);
  18452. return r
  18453. }
  18454. ,
  18455. t.prototype.pathHeight = function() {
  18456. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18457. }
  18458. ,
  18459. t.prototype.createBunnyObj = function(e) {
  18460. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  18461. this.bunnyObj.visible = D.warp.showBunny),
  18462. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18463. e.add(this.bunnyObj)
  18464. }
  18465. ,
  18466. t.prototype.createCpm = function(e) {
  18467. if (!this.currentPanoMarker) {
  18468. var t = this.makeWaypointObj(I.pathEnd, "Current");
  18469. t.material.uniforms.opacity.value = 0,
  18470. this.currentPanoMarker = {
  18471. mesh: t,
  18472. placed: !1
  18473. }
  18474. }
  18475. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18476. this.placeCpm(),
  18477. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18478. }
  18479. ,
  18480. t.prototype.placeCpm = function() {
  18481. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18482. var e = this.player.currentPano.floor;
  18483. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18484. e.add(this.currentPanoMarker.mesh)),
  18485. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18486. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18487. this.currentPanoMarker.placed = !0
  18488. } else
  18489. this.popOutCpm()
  18490. }
  18491. ,
  18492. t.prototype.fadeInCpm = function(e) {
  18493. 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)
  18494. }
  18495. ,
  18496. t.prototype.fadeOutCpm = function(e) {
  18497. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18498. }
  18499. ,
  18500. t.prototype.popInCpm = function() {
  18501. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18502. }
  18503. ,
  18504. t.prototype.popOutCpm = function() {
  18505. this.fadeOutCpm(2)
  18506. }
  18507. ,
  18508. t.prototype.brushPrefs = {
  18509. linewidth: 7,
  18510. strokeWidth: 15,
  18511. cvSegments: 48,
  18512. paveStep: .1,
  18513. paveWidth: .2,
  18514. lookBlendDist: 3,
  18515. maxTurn: P.Math.degToRad(2)
  18516. },
  18517. t.prototype.panoPathDistance = function(e) {
  18518. var t = this.model.panos;
  18519. if (!e || e.length < 2)
  18520. return 0;
  18521. for (var i = [], n = 0; n < e.length; n += 1)
  18522. i.push(t.get(e[n]).floorPosition);
  18523. return this.pointPathDistance(i)
  18524. }
  18525. ,
  18526. t.prototype.loadTileTexture = function(t) {
  18527. var e = n.load(t, function(e) {
  18528. e.wrapS = P.RepeatWrapping,
  18529. e.wrapT = P.RepeatWrapping,
  18530. e.needsUpdate = !0,
  18531. H.debug('path texture "' + t + '" is ready')
  18532. }, function() {
  18533. H.error('path texture "' + t + '" failed')
  18534. });
  18535. return e.mapping = P.UVMapping,
  18536. e
  18537. }
  18538. ,
  18539. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18540. return new l({
  18541. cameraMode: n,
  18542. position: e,
  18543. quaternion: t,
  18544. panoId: i,
  18545. orthoZoom: o,
  18546. floorVisibility: r,
  18547. thumbUrl: null,
  18548. name: null
  18549. })
  18550. }
  18551. ,
  18552. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18553. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18554. }
  18555. ,
  18556. t.prototype.setWarpDestination = function(e) {
  18557. this.warpDestHeroLoc = e
  18558. }
  18559. ,
  18560. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  18561. var t = this.getHeroDescriptorByHeroIndex(e);
  18562. return null !== t && (this.setWarpDestination(t),
  18563. !0)
  18564. }
  18565. ,
  18566. t.prototype.setWarpDestinationByPano = function(e, t) {
  18567. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  18568. }
  18569. ,
  18570. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  18571. var i = this.model.panos.get(e);
  18572. if (i) {
  18573. t = t || new P.Quaternion;
  18574. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  18575. return this.setWarpDestination(n),
  18576. !0
  18577. }
  18578. return !1
  18579. }
  18580. ,
  18581. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  18582. var t = this.model.heroCount();
  18583. if (null !== this.warpDestHeroLoc && t < 2)
  18584. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  18585. this.model.getHeroDescriptorByIndex(0);
  18586. var i = this.model.getHeroDescriptorByIndex(e);
  18587. if (i) {
  18588. var n = i.isPano() ? i.panoId : i.cameraMode;
  18589. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  18590. }
  18591. return i
  18592. }
  18593. ,
  18594. t.prototype.getHeroDescriptorByPano = function(e) {
  18595. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  18596. }
  18597. ,
  18598. t.prototype.getHeroDescriptorByPanoId = function(e) {
  18599. var t = this.getHeroIndexFromPanoId(e);
  18600. return this.getHeroDescriptorByHeroIndex(t)
  18601. }
  18602. ,
  18603. t.prototype.getHeroIndexFromPanoId = function(e) {
  18604. for (var t = 0; t < this.model.heroLocations.length; t++) {
  18605. var i = this.model.heroLocations[t]
  18606. , n = this.getHeroId(i);
  18607. if (n && n === e)
  18608. return t
  18609. }
  18610. return -1
  18611. }
  18612. ,
  18613. t.prototype.getHeroPano = function(e) {
  18614. if (null === e)
  18615. return H.warn("getHeroPano(): no destination"),
  18616. null;
  18617. var t = this.getHeroId(e)
  18618. , i = this.model.panos.get(t);
  18619. return void 0 === i && (i = null,
  18620. "" !== t && H.debug('unable to find pano "' + t + '"')),
  18621. i
  18622. }
  18623. ,
  18624. t.prototype.getHeroId = function(e) {
  18625. return e.panoId
  18626. }
  18627. ,
  18628. t.prototype.setWarpDestPano = function() {
  18629. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  18630. this.warpDestPano
  18631. }
  18632. ,
  18633. t.prototype.brushToWarpPano = function(e, t) {
  18634. if (this.discardPathObject(),
  18635. !this.setWarpDestPano())
  18636. return !1;
  18637. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  18638. !this.warpDestPano)
  18639. return H.info("No brush"),
  18640. !1;
  18641. if (!this.player.currentPano)
  18642. return H.debug("No current pano, visibility undefined"),
  18643. !1;
  18644. if (!this.warpDestPano)
  18645. return H.info("No wPano, visibility undefined"),
  18646. !1;
  18647. if (!this.warpDestPano.isAligned())
  18648. return H.debug("Cannot brush to unaligned pano"),
  18649. !1;
  18650. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  18651. , n = !0;
  18652. if (this.player.currentPano.id === this.warpDestPano.id)
  18653. H.debug("Already at destination pano");
  18654. else {
  18655. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18656. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  18657. this.obj3d = new P.Object3D,
  18658. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  18659. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  18660. e = t) : (this.setPathHulls(this.nodes),
  18661. this.setFloorCurves(),
  18662. 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)))),
  18663. this.player.currentPano.floor.add(this.obj3d);
  18664. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  18665. , o = e === L.STD;
  18666. if (!n && (i || o)) {
  18667. if (r) {
  18668. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  18669. this.obj3d.add(a)
  18670. }
  18671. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  18672. this.obj3d.add(s)
  18673. }
  18674. this.appearSlow()
  18675. }
  18676. return this.upcomingTransType = e,
  18677. !n
  18678. }
  18679. ,
  18680. t.prototype.findShortestPath = function(e, t) {
  18681. if (!e || !t)
  18682. return null;
  18683. var i = D.warp.walkExtraPanosDistance
  18684. , n = e.id + ":" + t.id + ":" + i;
  18685. if (this.shortPaths.hasOwnProperty(n))
  18686. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  18687. var r = t.id + ":" + e.id + ":" + i;
  18688. if (this.shortPaths.hasOwnProperty(r))
  18689. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  18690. var o = this.model.panos.aStarSearch(e, t);
  18691. return this.model.panos.includeNodesNearPath(o, i),
  18692. this.shortPaths[n] = o ? o.slice() : null,
  18693. o
  18694. }
  18695. ,
  18696. t.prototype.makePathHulls = function(e) {
  18697. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  18698. r = (t = h.get(e[0])).floor.floorIndex;
  18699. for (var u = 0; u < e.length; u += 1)
  18700. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  18701. s.push(i),
  18702. l.push(t.position.clone()),
  18703. n = t.floor.floorIndex,
  18704. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  18705. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  18706. return a > this.longestStep && (this.longestStep = a,
  18707. H.debug("path contains " + a + " meter segment")),
  18708. {
  18709. floor: s,
  18710. camera: l,
  18711. color: c
  18712. }
  18713. }
  18714. ,
  18715. t.prototype.makeFloorCurves = function(e, t, i) {
  18716. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18717. , r = this.pointPathDistance(e) - 2 * n
  18718. , o = e.slice(0)
  18719. , a = o[1].clone().sub(o[0]);
  18720. a.y = 0,
  18721. a.normalize().multiplyScalar(n),
  18722. o[0] = (new P.Vector3).copy(o[0]).add(a),
  18723. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  18724. a.normalize().multiplyScalar(n),
  18725. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  18726. var s = new P.CatmullRomCurve3(o)
  18727. , l = Math.floor(r / i);
  18728. l = 4 * Math.floor(l / 4),
  18729. l = Math.max(4, l);
  18730. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  18731. h = 0,
  18732. c = u[f].distanceTo(e[0]);
  18733. for (var g = 1; g < e.length; g += 1)
  18734. p.copy(u[f]).sub(e[g]),
  18735. p.y *= 4,
  18736. p.length() < c && (h = g);
  18737. d.push(t[h])
  18738. }
  18739. return {
  18740. distance: r,
  18741. points: u,
  18742. colors: d
  18743. }
  18744. }
  18745. ,
  18746. t.prototype.makeCameraCurvePoints = function(e, t) {
  18747. var i = this.pointPathDistance(e);
  18748. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  18749. }
  18750. ,
  18751. t.prototype.makeCameraCurveTangents = function(e, t) {
  18752. var i = this.pointPathDistance(e)
  18753. , n = new P.CatmullRomCurve3(e)
  18754. , r = Math.max(2, Math.floor(i / t));
  18755. r = r || 5;
  18756. for (var o = [], a = 0; a <= r; a++)
  18757. o.push(n.getTangentAt(a / r));
  18758. return o
  18759. }
  18760. ,
  18761. t.prototype.setPathHulls = function(e) {
  18762. var t = this.makePathHulls(e);
  18763. this.floorHull = t.floor,
  18764. this.cameraHull = t.camera,
  18765. this.colorHull = t.color
  18766. }
  18767. ,
  18768. t.prototype.setFloorCurves = function() {
  18769. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  18770. this.floorPathDistance = e.distance,
  18771. this.floorCurvePoints = e.points,
  18772. this.floorCurveColors = e.colors
  18773. }
  18774. ,
  18775. t.prototype.setCameraCurvePoints = function() {
  18776. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  18777. }
  18778. ,
  18779. t.prototype.chooseWarpPath = function(e) {
  18780. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  18781. if (this.player.currentPano === this.warpDestPano || !e)
  18782. return this.warpPathPoints = null,
  18783. this.warpLength = 0,
  18784. !1;
  18785. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18786. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  18787. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  18788. t.multiplyScalar(.15).add(r.position),
  18789. i.multiplyScalar(.15).add(this.warpDestPano.position),
  18790. t.y = r.position.y,
  18791. i.y = this.warpDestPano.position.y,
  18792. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  18793. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  18794. this.setCameraCurvePoints(),
  18795. this.warpPathPoints = this.camCurvePoints.slice(0)),
  18796. this.warpLength = 0,
  18797. this.warpPathLengths = [0];
  18798. 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) {
  18799. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  18800. var h = o.length();
  18801. o.y *= D.warp.climbEffort;
  18802. var u = o.length() / h;
  18803. if (1 < c) {
  18804. o.setY(0).normalize(),
  18805. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  18806. var d = Math.min(1, o.dot(a))
  18807. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  18808. u = Math.max(p, u)
  18809. }
  18810. this.warpLength += h * u,
  18811. this.warpPathLengths[c] = this.warpLength
  18812. }
  18813. return !0
  18814. }
  18815. ,
  18816. t.prototype.drawPathRibbon = function(e, t) {
  18817. this.bunnyObj.visible = D.warp.showBunny;
  18818. 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) {
  18819. a.copy(e[s]),
  18820. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  18821. a.normalize(),
  18822. n.crossVectors(a, U.UP),
  18823. n.multiplyScalar(i);
  18824. var l = (new P.Vector3).copy(e[s]).add(r);
  18825. l.sub(n),
  18826. o.vertices.push(l),
  18827. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  18828. o.vertices.push(l)
  18829. }
  18830. var c, h, u, d = 0;
  18831. for (s = 0; s < e.length - 1; s += 1) {
  18832. var p = 2 * s
  18833. , f = d
  18834. , g = d += e[s + 1].distanceTo(e[s])
  18835. , m = t[s]
  18836. , v = t[s + 1];
  18837. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  18838. o.faces.push(c),
  18839. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  18840. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  18841. o.faces.push(c),
  18842. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  18843. }
  18844. o.computeFaceNormals(),
  18845. o.computeVertexNormals(),
  18846. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  18847. u.opacity.value = 0,
  18848. u.color.value.set(D.path.color),
  18849. new P.RawShaderMaterial({
  18850. side: P.DoubleSide,
  18851. depthWrite: !1,
  18852. transparent: !0,
  18853. vertexShader: C.ribbon.vertexShader,
  18854. fragmentShader: C.ribbon.fragmentShader,
  18855. uniforms: u,
  18856. name: "ribbonT",
  18857. opacity: 0
  18858. })) : new P.MeshBasicMaterial({
  18859. color: 16777215,
  18860. side: P.DoubleSide,
  18861. name: "ribbonOut",
  18862. vertexColors: P.VertexColors
  18863. });
  18864. var y = new P.Mesh(o,h);
  18865. return y.name = "ribbon",
  18866. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  18867. y
  18868. }
  18869. ,
  18870. t.prototype.drawPathPavement = function(e) {
  18871. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  18872. r.copy(e[o]),
  18873. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  18874. r.normalize(),
  18875. i.crossVectors(r, U.UP),
  18876. i.multiplyScalar(this.brushPrefs.paveWidth),
  18877. (t = (new P.Vector3).copy(e[o])).sub(i),
  18878. n.vertices.push(t),
  18879. n.vertices.push((new P.Vector3).copy(e[o])),
  18880. (t = (new P.Vector3).copy(e[o])).add(i),
  18881. n.vertices.push(t);
  18882. var a, s, l;
  18883. for (o = 0; o < e.length - 1; o += 1)
  18884. a = 3 * o + 1,
  18885. l = .25 + (s = .25 * o),
  18886. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  18887. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  18888. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  18889. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  18890. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  18891. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  18892. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  18893. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  18894. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  18895. color: D.path.color,
  18896. side: P.DoubleSide,
  18897. transparent: !0,
  18898. depthWrite: !1,
  18899. opacity: 0,
  18900. name: "paveT",
  18901. map: I.path
  18902. }) : new P.MeshBasicMaterial({
  18903. color: D.path.color,
  18904. side: P.DoubleSide,
  18905. transparent: !0,
  18906. depthWrite: !1,
  18907. opacity: 1,
  18908. name: "paveO",
  18909. map: I.path
  18910. });
  18911. return new P.Mesh(n,c)
  18912. }
  18913. ,
  18914. t.prototype.hintPrefs = {
  18915. rad: .18,
  18916. width: .0125,
  18917. depth: .0625,
  18918. setBack: -.04,
  18919. markRad: .25,
  18920. markInnerRad: .16
  18921. },
  18922. t.prototype.makeWaypointObj = function(e, t) {
  18923. var i = new P.Geometry
  18924. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18925. , r = this.pathHeight();
  18926. 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)),
  18927. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  18928. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  18929. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  18930. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  18931. o.map.value = e,
  18932. o.opacity.value = 0,
  18933. o.color.value.set(D.path.color);
  18934. var a = {
  18935. side: P.DoubleSide,
  18936. depthWrite: !1,
  18937. transparent: !0,
  18938. vertexShader: C.waypoint.vertexShader,
  18939. fragmentShader: C.waypoint.fragmentShader,
  18940. uniforms: o,
  18941. name: "waypoint",
  18942. opacity: 0
  18943. };
  18944. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  18945. a.name = "wayPtOut");
  18946. var s = new P.RawShaderMaterial(a)
  18947. , l = new P.Mesh(i,s);
  18948. return l.name = t,
  18949. l
  18950. }
  18951. ,
  18952. t.prototype.makeStartMarker = function(e, t) {
  18953. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  18954. i.y = 0,
  18955. i.normalize();
  18956. var n = Math.acos(i.x)
  18957. , r = this.makeWaypointObj(I.pathStart, "Start");
  18958. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  18959. r.position.copy(e),
  18960. r
  18961. }
  18962. ,
  18963. t.prototype.makeEndMarker = function(e) {
  18964. var t = this.makeWaypointObj(I.pathEnd, "End")
  18965. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  18966. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  18967. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  18968. t.position.copy(e),
  18969. t
  18970. }
  18971. ,
  18972. t.prototype.pathClean = function(e) {
  18973. if (e) {
  18974. for (var t in e.children)
  18975. this.pathClean(e.children[t]);
  18976. e.geometry && e.geometry.dispose(),
  18977. e.material && e.material.dispose()
  18978. }
  18979. }
  18980. ,
  18981. t.prototype.discardPathObject = function() {
  18982. if (this.obj3d) {
  18983. var e = this.obj3d.parent;
  18984. e && e.remove(this.obj3d),
  18985. this.pathClean(this.obj3d)
  18986. }
  18987. this.obj3d = null,
  18988. this.popInCpm()
  18989. }
  18990. ,
  18991. t.prototype.discardSlow = function() {
  18992. if (this.obj3d) {
  18993. if (this.player.mode !== O.PANORAMA)
  18994. return void this.discardPathObject();
  18995. for (var e, t = 0, i = function() {
  18996. this.discardPathObject()
  18997. }
  18998. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  18999. 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]),
  19000. t += 1,
  19001. i = null);
  19002. 0 === t && this.discardPathObject(),
  19003. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19004. }
  19005. }
  19006. ,
  19007. t.prototype.appearSlow = function() {
  19008. var e;
  19009. this.fadeOutCpm(D.path.fadeInTime);
  19010. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19011. 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]))
  19012. }
  19013. ,
  19014. t.prototype.update = function() {
  19015. this.obj3d && this.obj3d.updateMatrixWorld()
  19016. }
  19017. ,
  19018. t.prototype.calcBurnsAmount = function(e) {
  19019. var n = P.Math.degToRad(D.warp.burnsAngle);
  19020. if (this.player.mode !== O.PANORAMA)
  19021. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19022. var t = this.burnsDir * n;
  19023. if (this.upcomingTransType === L.BLACK)
  19024. return t;
  19025. var i = e;
  19026. if (null === i)
  19027. return H.warn("Transition request for non-highlight"),
  19028. t;
  19029. var r = this.getHeroDescriptorByHeroIndex(i);
  19030. if (null === r)
  19031. return t;
  19032. if (!r.isPano())
  19033. return t;
  19034. function o(e) {
  19035. var t = Math.acos(Math.min(1, e.dot(l)))
  19036. , i = (new P.Vector3).crossVectors(l, e);
  19037. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19038. }
  19039. var a = this.getHeroPano(r)
  19040. , s = this.playerControls.cameras[O.PANORAMA]
  19041. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19042. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19043. if (a === this.player.currentPano)
  19044. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19045. var h = this.findShortestPath(this.player.currentPano, a);
  19046. if (null == h || h.length < 1)
  19047. return H.debug("Empty path ahead..."),
  19048. t;
  19049. var u = this.makePathHulls(h)
  19050. , d = new P.CatmullRomCurve3(u.camera)
  19051. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19052. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19053. }
  19054. ,
  19055. t.prototype.waitNextStep = function(e, t, i) {
  19056. var o = null == i ? D.warp.tourStepDelay : i;
  19057. o = o || (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19058. var a = new P.Euler
  19059. , s = new P.Vector3;
  19060. H.debug("Starting wait: " + (void 0 !== t));
  19061. var l = this.calcBurnsAmount(e)
  19062. , c = function() {
  19063. this.endWarpState(),
  19064. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19065. t && t()
  19066. }
  19067. .bind(this)
  19068. , n = function(e, t) {
  19069. if (this.warpInterrupted)
  19070. return c(),
  19071. !0;
  19072. var i = t || 1e3 / 60;
  19073. if (D.warp.doBurns)
  19074. if (this.player.mode === O.PANORAMA) {
  19075. var n = this.playerControls.cameras[O.PANORAMA];
  19076. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19077. var r = i * l / o;
  19078. a.y += r,
  19079. s.set(0, 0, -1),
  19080. s.applyEuler(a),
  19081. s.add(n.position),
  19082. n.controls.lookAt(s),
  19083. n.controls.lookVector.copy(s),
  19084. n.lookAt(s)
  19085. } else
  19086. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19087. }
  19088. .bind(this);
  19089. this.startWarpState(),
  19090. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19091. /* var r = player.model.heroLocations[app.director.currentItem];
  19092. this.player.zoomEnabled = !0;
  19093. var h = function(e, t) {
  19094. //console.log(e),
  19095. this.player.zoomTo(e * r.zoom.toFixed(2), !0)
  19096. }
  19097. .bind(this);
  19098. V.start(h, 2e3, null, 0, B.easeOutQuad, "zoom") */
  19099. }
  19100. ,
  19101. t.prototype.warpToNonPano = function(e) {
  19102. if (this.discardPathObject(),
  19103. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19104. var t = function() {
  19105. e && e()
  19106. }
  19107. .bind(this);
  19108. this.player.flyToNewMode({
  19109. mode: this.warpDestHeroLoc.cameraMode,
  19110. duration: D.warp.outsideTime,
  19111. warpDest: this.warpDestHeroLoc,
  19112. callback: t,
  19113. force: !0
  19114. })
  19115. } else
  19116. H.warn("no warp destination!!!"),
  19117. e && e()
  19118. }
  19119. ,
  19120. t.prototype._resetWarpShaderParams = function(e) {
  19121. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19122. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19123. }
  19124. ,
  19125. t.prototype._clearWarpShading = function() {
  19126. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19127. this._resetWarpShaderParams(e[t]),
  19128. e[t].visible = !0;
  19129. this._resetWarpShaderParams(this.model.skybox)
  19130. }
  19131. ,
  19132. t.prototype._warpStopFlying = function() {
  19133. this.activeTransType = null,
  19134. this.placeCpm()
  19135. }
  19136. ,
  19137. t.prototype._wrapupTravelOnlyBits = function() {
  19138. this._warpStopFlying(),
  19139. this.warpPathPoints && (this.player.currentPano.exit(),
  19140. this.warpDestPano.enter(),
  19141. this.player.currentPano = this.warpDestPano),
  19142. this.player.spider.draw(),
  19143. this.placeCpm()
  19144. }
  19145. ,
  19146. t.prototype._wrapupTravel = function(e) {
  19147. this._wrapupTravelOnlyBits(),
  19148. this.warpCameraAim(e)
  19149. }
  19150. ,
  19151. t.prototype._wrapupWarpShading = function(e) {
  19152. this._clearWarpShading(),
  19153. this._wrapupTravel(e)
  19154. }
  19155. ,
  19156. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19157. t !== z.END && this._clearWarpShading(),
  19158. this._wrapupTravelOnlyBits(),
  19159. this.upcomingTransType = null,
  19160. e && e()
  19161. }
  19162. ,
  19163. t.prototype._warpCameraAim = function(e, t) {
  19164. var i = this.warpDestHeroLoc.quaternion
  19165. , n = this.playerControls.cameras[O.PANORAMA]
  19166. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19167. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19168. , a = P.Math.radToDeg(Math.acos(o))
  19169. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19170. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19171. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19172. c.y = N.constrainedTurn(c.y),
  19173. this.burnsDir = Math.sign(c.y);
  19174. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19175. , u = new P.Vector3
  19176. , d = function(e, t) {
  19177. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19178. h.y = l.y + e * c.y,
  19179. h.z = l.z + e * c.z,
  19180. u.set(0, 0, -1),
  19181. u.applyEuler(h),
  19182. u.add(n.position),
  19183. n.controls.lookAt(u),
  19184. n.controls.lookVector.copy(u),
  19185. void n.lookAt(u))
  19186. }
  19187. .bind(this);
  19188. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing]) : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19189. void (t && t()))
  19190. }
  19191. ,
  19192. t.prototype._warpBendAim = function(e, t, i, n) {
  19193. var r = n || 0
  19194. , o = this.playerControls.cameras[O.PANORAMA]
  19195. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19196. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19197. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19198. l.y = N.constrainedTurn(l.y);
  19199. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19200. l.x = c * Math.sign(l.x),
  19201. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19202. this.burnsDir = Math.sign(l.y),
  19203. c *= Math.sign(l.y),
  19204. l.y = c;
  19205. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19206. , u = new P.Vector3
  19207. , d = function(e, t) {
  19208. if (e < .5)
  19209. h.x = s.x + e * l.x,
  19210. h.y = s.y + e * l.y,
  19211. h.z = s.z + e * l.z;
  19212. else {
  19213. var i = (1 - e) * D.warp.softBendEnd;
  19214. h.x = a.x - i * l.x,
  19215. h.y = a.y - i * l.y,
  19216. h.z = a.z - i * l.z
  19217. }
  19218. u.set(0, 0, -1),
  19219. u.applyEuler(h),
  19220. u.add(o.position),
  19221. o.controls.lookAt(u),
  19222. o.controls.lookVector.copy(u),
  19223. o.lookAt(u)
  19224. }
  19225. .bind(this);
  19226. return V.start(d, t, i, r, B[D.warp.movementEasing])
  19227. }
  19228. ,
  19229. t.prototype._warpStepCameraAim = function(e, t, i) {
  19230. var n = this.playerControls.cameras[O.PANORAMA]
  19231. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19232. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19233. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19234. a.y = N.constrainedTurn(a.y),
  19235. this.burnsDir = Math.sign(a.y);
  19236. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19237. , l = new P.Vector3
  19238. , c = function(e, t) {
  19239. e < .5 ? s.copy(o) : s.copy(r),
  19240. l.set(0, 0, -1),
  19241. l.applyEuler(s),
  19242. l.add(n.position),
  19243. n.controls.lookAt(l),
  19244. n.controls.lookVector.copy(l),
  19245. n.lookAt(l)
  19246. }
  19247. .bind(this);
  19248. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19249. }
  19250. ,
  19251. t.prototype.setBurnsDir = function() {
  19252. var e = this.playerControls.cameras[O.PANORAMA]
  19253. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19254. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19255. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19256. n.y = N.constrainedTurn(n.y),
  19257. this.burnsDir = Math.sign(n.y)
  19258. }
  19259. ,
  19260. t.prototype.stepWarpPath = function(e, t) {
  19261. var i = this.playerControls.cameras[O.PANORAMA];
  19262. if (!this.warpPathPoints)
  19263. return i.position.copy(this.warpDestPano.position),
  19264. !0;
  19265. var n = this.warpPathPoints[0]
  19266. , r = this.warpDestPano.position;
  19267. if (null !== this.nodes && 1 < this.cameraHull.length) {
  19268. var o = new P.Vector3;
  19269. 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),
  19270. i.position.copy(o)
  19271. } else
  19272. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19273. }
  19274. ,
  19275. t.prototype.interruptAndFastForward = function(e, t) {
  19276. this.warping && (this.warpInterrupted = !0,
  19277. this.warpInterruptionBlackoutStyle = e,
  19278. this.warpInterruptionTravelTime = t,
  19279. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19280. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19281. }
  19282. ,
  19283. t.prototype.warpCameraAim = function(e) {
  19284. var t = D.warp.minWarpTime;
  19285. if (this.upcomingTransType === L.BLACK)
  19286. t = D.warp.teleportTime;
  19287. else {
  19288. var i = this.playerControls.cameras[O.PANORAMA]
  19289. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19290. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19291. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19292. o.y = N.constrainedTurn(o.y);
  19293. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19294. t = Math.max(t, a)
  19295. }
  19296. var s = function() {
  19297. this._warpStopFlying(),
  19298. this.discardSlow(),
  19299. e && e()
  19300. }
  19301. .bind(this);
  19302. this._warpCameraAim(t, s)
  19303. }
  19304. ,
  19305. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19306. this.model.skybox.material.uniforms.blackout.value = n;
  19307. var r = F.uniform(this.model.skybox, "progress", 1)
  19308. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19309. , a = !1
  19310. , s = function() {
  19311. if (this.warpInterrupted)
  19312. return a = !0
  19313. }
  19314. .bind(this)
  19315. , l = function(e, t) {
  19316. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19317. }
  19318. .bind(this)
  19319. , c = function(e, t) {
  19320. return i && a ? (o(0),
  19321. !0) : void o(e, t)
  19322. }
  19323. .bind(this);
  19324. V.start(s, e, null, t, null, "safeHaltWatch"),
  19325. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19326. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19327. }
  19328. ,
  19329. t.prototype.warpTravel_STD = function(e) {
  19330. 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),
  19331. 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;
  19332. t += this.warpLength * D.warp.timePerMeter,
  19333. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19334. function n(e) {
  19335. var t = i;
  19336. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19337. }
  19338. var y = !1
  19339. , r = this.warpDestHeroLoc.quaternion
  19340. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19341. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19342. , a = A.dot(o)
  19343. , C = P.Math.radToDeg(Math.acos(a))
  19344. , s = function() {
  19345. return m.lookAt(g, l, U.UP),
  19346. u.setFromRotationMatrix(m, D.warp.eOrder),
  19347. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19348. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19349. N.constrainedTurn(v.y)
  19350. }
  19351. .bind(this)
  19352. , I = function(e, t) {
  19353. if (this.warpInterrupted)
  19354. return y = !0
  19355. }
  19356. .bind(this)
  19357. , E = function(e, t) {
  19358. return y || !this.warpPathPoints ? (k.blur(0),
  19359. !0) : void k.blur(e)
  19360. }
  19361. .bind(this)
  19362. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19363. , b = function(e, t) {
  19364. return y || !this.warpPathPoints ? (_(0),
  19365. !0) : void _(e, t)
  19366. }
  19367. .bind(this)
  19368. , w = function(e, t) {
  19369. if (!this.warpPathPoints)
  19370. return h.position.copy(this.warpDestPano.position),
  19371. !0;
  19372. if (y)
  19373. return !0;
  19374. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19375. h.position.copy(i),
  19376. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19377. }
  19378. .bind(this)
  19379. , T = function(e, t) {
  19380. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19381. !0)
  19382. }
  19383. .bind(this)
  19384. , x = function(e, t) {
  19385. if (y)
  19386. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19387. !0;
  19388. if (!this.warpPathPoints)
  19389. return !0;
  19390. var i = this.warpLength * e
  19391. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19392. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19393. D.warp.matchCam && (n *= 1 - r),
  19394. m.lookAt(g, l, U.UP),
  19395. u.setFromRotationMatrix(m, D.warp.eOrder),
  19396. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19397. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19398. v.y = N.constrainedTurn(v.y),
  19399. u.x = p.x + n * v.x,
  19400. u.y = p.y + n * v.y,
  19401. u.z = p.z + n * v.z,
  19402. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19403. v.y = N.constrainedTurn(v.y);
  19404. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  19405. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  19406. f.x = f.x + v.x * D.warp.turnFriction,
  19407. f.y = f.y + v.y * D.warp.turnFriction,
  19408. f.z = f.z + v.z * D.warp.turnFriction,
  19409. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  19410. var a = l.clone().sub(g).normalize();
  19411. if (C < D.warp.maxAimRotation && 0 < r) {
  19412. var s = 1 - r;
  19413. a.x = a.x * s + r * A.x,
  19414. a.y = a.y * s + r * A.y,
  19415. a.z = a.z * s + r * A.z,
  19416. a.normalize()
  19417. }
  19418. this.bunnyObj.position.copy(h.position).add(a),
  19419. d.set(0, 0, -1).applyEuler(f).normalize(),
  19420. d.multiplyScalar(8),
  19421. d.add(h.position),
  19422. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  19423. h.controls.lookVector.copy(d),
  19424. h.lookAt(d))
  19425. }
  19426. .bind(this)
  19427. , S = function() {
  19428. y ? (this.discardSlow(),
  19429. this.upcomingTransType = L.BLACK,
  19430. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19431. }
  19432. .bind(this);
  19433. T(0);
  19434. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  19435. , R = M / (t += M);
  19436. this.warpCommonParameters(t, R, !0, z.NONE),
  19437. V.start(I, t, null, 0, null, "_haltWatcher"),
  19438. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  19439. V.start(E, t, null, R, n, "blurring")),
  19440. V.start(b, t, null, R, n, "modelAlpha"),
  19441. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  19442. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  19443. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  19444. }
  19445. ,
  19446. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19447. var r = e || 0;
  19448. null != t || (t = D.warp.teleportTime),
  19449. this.warpCommonParameters(t, r, !1, i),
  19450. this.model.chunks.forEach(function(e) {
  19451. e.material.uniforms.blackout.value = i
  19452. }),
  19453. this._warpBendAim(null, t, null, r);
  19454. var o = function() {
  19455. this.wrapupWarpShadingOnly(n, i)
  19456. }
  19457. .bind(this);
  19458. V.start(this.stepWarpPath.bind(this), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19459. }
  19460. ,
  19461. t.prototype.flightStepWalk = (a = new P.Vector3,
  19462. s = new P.Vector3,
  19463. function(e, t, i) {
  19464. if (this.warpInterrupted)
  19465. i && i();
  19466. else if (this.activeTransType !== L.WALK)
  19467. this._clearWarpShading(),
  19468. this._warpStopFlying(),
  19469. this.player.spider.draw(),
  19470. this.placeCpm(),
  19471. i && i();
  19472. else if (this.player.currentPano !== e) {
  19473. var n = {
  19474. pano: e,
  19475. lookAtPoint: t,
  19476. duration: null,
  19477. maxDistanceOverride: D.warp.walkMaxDist,
  19478. skipWarpingCheck: !1,
  19479. constantMoveSpeed: !0
  19480. };
  19481. n.duration = function(e, t) {
  19482. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  19483. s.copy(U.FORWARD),
  19484. this.player.getDirection(s),
  19485. a.copy(t).sub(e.position).normalize();
  19486. var n = a.dot(s)
  19487. , r = Math.acos(n)
  19488. , o = r / i;
  19489. return .001 < o && (i *= o / .001,
  19490. r < 1 && (i *= 1.2)),
  19491. i
  19492. }
  19493. .call(this, e, t),
  19494. this.player.nonInterruptingFlyToPano(n, i)
  19495. } else
  19496. i && i()
  19497. }
  19498. ),
  19499. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  19500. return this.flightStepWalk.bind(this, e, t, i)
  19501. }
  19502. ,
  19503. t.prototype.warpTravel_WALK = (f = [],
  19504. function(e) {
  19505. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  19506. var o = this.nodes[r]
  19507. , a = t.get(o);
  19508. this.nodes.length,
  19509. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  19510. i && n || (f.push(o),
  19511. i = a)
  19512. }
  19513. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  19514. var s = f.length
  19515. , l = t.get(f[s - 1])
  19516. , c = new Array(s + 1);
  19517. c[c.length - 1] = function() {
  19518. e && e()
  19519. }
  19520. .bind(this);
  19521. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19522. var d = f[h];
  19523. l = t.get(d);
  19524. var p = new P.Vector3;
  19525. this.getLookAtForWalkingTourNode(f, h, p),
  19526. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  19527. h--
  19528. }
  19529. c[0]()
  19530. }
  19531. ),
  19532. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  19533. h = new P.Vector3,
  19534. u = new P.Vector3,
  19535. d = new P.Vector3,
  19536. p = new P.Vector3,
  19537. function(e, t, i) {
  19538. var n = e.length;
  19539. if (n <= t)
  19540. return !1;
  19541. var r = 1
  19542. , o = 1;
  19543. h.set(0, 0, 0),
  19544. p.set(0, 0, 0);
  19545. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19546. if (a = this.player.model.panos.get(e[s]),
  19547. this.getOrientationForWalkingTourNode(e, s, u),
  19548. s === t && c.copy(u),
  19549. d.copy(u),
  19550. t < s) {
  19551. var l = d.dot(c) < .65;
  19552. r *= l ? .2 : .75,
  19553. o *= l ? .2 : .4
  19554. }
  19555. u.multiplyScalar(r),
  19556. h.add(u),
  19557. p.lerp(a.position, o)
  19558. }
  19559. return h.normalize(),
  19560. i.copy(p),
  19561. i.add(h),
  19562. !0
  19563. }
  19564. ),
  19565. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  19566. var n = e.length;
  19567. if (n <= t)
  19568. return !1;
  19569. if (t === n - 1)
  19570. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  19571. else {
  19572. var r = this.player.model.panos.get(e[t])
  19573. , o = this.player.model.panos.get(e[t + 1]);
  19574. i.copy(o.position).sub(r.position)
  19575. }
  19576. return i.normalize(),
  19577. !0
  19578. }
  19579. ,
  19580. t.prototype.warpCameraTravel = function(e, t, i, n) {
  19581. if (this.activeTransType = this.upcomingTransType,
  19582. this.lastTransType = this.activeTransType,
  19583. this.upcomingTransType = null,
  19584. e)
  19585. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  19586. this._clearWarpShading(),
  19587. this._warpStopFlying(),
  19588. this.player.spider.draw(),
  19589. this.placeCpm(),
  19590. n && n()
  19591. }
  19592. .bind(this)) : this.warpTravel_STD(n);
  19593. else {
  19594. var r = function() {
  19595. this._wrapupTravel(n)
  19596. }
  19597. .bind(this)
  19598. , o = {
  19599. pano: this.warpDestPano,
  19600. lookAtPoint: null,
  19601. duration: null,
  19602. maxDistanceOverride: null,
  19603. skipWarpingCheck: !1
  19604. };
  19605. this.player.flyToPano(o, r)
  19606. }
  19607. }
  19608. ,
  19609. t.prototype.startWarpState = function() {
  19610. this.warping = !0,
  19611. this.warpInterrupted = !1,
  19612. this.warpInterruptionBlackoutStyle = null,
  19613. this.warpInterruptionTravelTime = null
  19614. }
  19615. ,
  19616. t.prototype.endWarpState = function() {
  19617. this.warping = !1
  19618. }
  19619. ,
  19620. t.prototype.warpToPano = function(e, t, i, n) {
  19621. if (this.warping)
  19622. H.warn("Cannot warp when already warping");
  19623. else {
  19624. if (this.upcomingTransType = e,
  19625. this.activeTransType = null,
  19626. !this.setWarpDestPano())
  19627. return this.upcomingTransType = null,
  19628. void this.warpToNonPano(n);
  19629. if (this.player.mode !== O.PANORAMA)
  19630. return this.upcomingTransType = null,
  19631. this.discardSlow(),
  19632. void this.player.flyToNewMode({
  19633. mode: O.PANORAMA,
  19634. pano: this.warpDestPano,
  19635. duration: D.warp.outsideTime,
  19636. warpDest: this.warpDestHeroLoc,
  19637. callback: n,
  19638. force: !0
  19639. });
  19640. if (!this.warpDestPano)
  19641. return H.warn("no warp destination, callback dropped"),
  19642. void (this.upcomingTransType = null);
  19643. 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)
  19644. , o = this.chooseWarpPath(r);
  19645. if (o && this.upcomingTransType !== L.WALK) {
  19646. var a = function() {
  19647. this.waitingToWarp = !1,
  19648. this.warpToPano(e, t, i, n)
  19649. }
  19650. .bind(this);
  19651. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  19652. return void (this.waitingToWarp = !0)
  19653. }
  19654. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  19655. this.player.currentPano = this.warpDestPano,
  19656. this.placeCpm(),
  19657. this.fadeOutCpm(D.path.fadeOutTime),
  19658. this.player.spider.draw()),
  19659. H.debug("Warping to pano ", this.warpDestPano.position),
  19660. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  19661. this.startWarpState();
  19662. var s = function() {
  19663. this.endWarpState(),
  19664. n && n()
  19665. }
  19666. .bind(this);
  19667. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  19668. }
  19669. }
  19670. ,
  19671. v.exports = t
  19672. }
  19673. ).call(this, "/js/objects/ShowPath.js")
  19674. }
  19675. , {
  19676. "../constants": 8,
  19677. "../effects": 16,
  19678. "../enum/BlackoutStyle": 18,
  19679. "../enum/ModelManagerEvents": 33,
  19680. "../enum/PlayerEvents": 40,
  19681. "../enum/RenderOrder": 42,
  19682. "../enum/Vectors": 50,
  19683. "../enum/Viewmode": 51,
  19684. "../enum/WarpStyle": 52,
  19685. "../gui/gui": 65,
  19686. "../model/ModelManager": 140,
  19687. "../objects/Snapshot": 153,
  19688. "../settings": 166,
  19689. "../shaders": 167,
  19690. "../util/easing": 186,
  19691. "../util/lerp": 188,
  19692. "../util/logger": 189,
  19693. "../util/math": 190,
  19694. "../util/texture": 194,
  19695. "../util/transitions": 195,
  19696. three: 217
  19697. }],
  19698. 152: [function(e, t, i) {
  19699. "use strict";
  19700. function n() {
  19701. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  19702. , t = new r.RawShaderMaterial({
  19703. fragmentShader: o.skysphere.fragmentShader,
  19704. vertexShader: o.skysphere.vertexShader,
  19705. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  19706. side: r.BackSide,
  19707. name: "skysphere"
  19708. });
  19709. t.uniforms.radius.value = e.parameters.radius,
  19710. r.Mesh.call(this, e, t)
  19711. }
  19712. var r = e("three")
  19713. , o = e("../shaders")
  19714. , a = e("../settings");
  19715. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  19716. t.exports = n
  19717. }
  19718. , {
  19719. "../settings": 166,
  19720. "../shaders": 167,
  19721. three: 217
  19722. }],
  19723. 153: [function(r, o, e) {
  19724. (function(e) {
  19725. "use strict";
  19726. function t(e) {
  19727. n.call(this, e),
  19728. this.sid = e.sid,
  19729. this.panoId = e.panoId,
  19730. this.orthoZoom = e.orthoZoom,
  19731. this.floorVisibility = e.floorVisibility,
  19732. this.thumbUrl = e.thumbUrl,
  19733. this.name = e.name,
  19734. this.zoom = e.zoom
  19735. }
  19736. var i = (r("three"),
  19737. r("../util/logger"))
  19738. , n = (r("../settings"),
  19739. r("../enum/Viewmode"),
  19740. r("../util/common"),
  19741. r("../util/transitions"),
  19742. r("../util/lerp"),
  19743. r("../util/ajax"),
  19744. r("../util/texture"),
  19745. r("./View"));
  19746. r("events").EventEmitter,
  19747. new i(e),
  19748. (t.prototype = Object.create(n.prototype)).isPano = function() {
  19749. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  19750. }
  19751. ,
  19752. o.exports = t
  19753. }
  19754. ).call(this, "/js/objects/Snapshot.js")
  19755. }
  19756. , {
  19757. "../enum/Viewmode": 51,
  19758. "../settings": 166,
  19759. "../util/ajax": 181,
  19760. "../util/common": 185,
  19761. "../util/lerp": 188,
  19762. "../util/logger": 189,
  19763. "../util/texture": 194,
  19764. "../util/transitions": 195,
  19765. "./View": 154,
  19766. events: 202,
  19767. three: 217
  19768. }],
  19769. 154: [function(o, a, e) {
  19770. (function(e) {
  19771. "use strict";
  19772. function t(e) {
  19773. e = e || {},
  19774. this.position = new i.Vector3,
  19775. this.quaternion = new i.Quaternion,
  19776. this.update(e)
  19777. }
  19778. var i = o("three")
  19779. , n = o("../util/logger")
  19780. , r = (o("../settings"),
  19781. o("../enum/Viewmode"),
  19782. o("../util/common"),
  19783. o("../util/transitions"),
  19784. o("../util/lerp"),
  19785. o("../util/ajax"),
  19786. o("../util/texture"),
  19787. o("events").EventEmitter);
  19788. new n(e),
  19789. (t.prototype = Object.create(r.prototype)).isValid = function() {
  19790. return !!this.cameraMode
  19791. }
  19792. ,
  19793. t.prototype.update = function(e) {
  19794. return this.cameraMode = e.cameraMode || this.cameraMode,
  19795. this.pano = e.pano || this.pano,
  19796. e.position && this.position.copy(e.position),
  19797. e.quaternion && this.quaternion.copy(e.quaternion),
  19798. this
  19799. }
  19800. ,
  19801. a.exports = t
  19802. }
  19803. ).call(this, "/js/objects/View.js")
  19804. }
  19805. , {
  19806. "../enum/Viewmode": 51,
  19807. "../settings": 166,
  19808. "../util/ajax": 181,
  19809. "../util/common": 185,
  19810. "../util/lerp": 188,
  19811. "../util/logger": 189,
  19812. "../util/texture": 194,
  19813. "../util/transitions": 195,
  19814. events: 202,
  19815. three: 217
  19816. }],
  19817. 155: [function(J, ee, e) {
  19818. (function(e) {
  19819. "use strict";
  19820. function t(e) {
  19821. this.currentPano = null,
  19822. this.nextPano = null,
  19823. this.camera = null,
  19824. this.paused = !1,
  19825. this.flying = !1,
  19826. this.sceneIntersectionPlane = null,
  19827. this.target = new B.Vector3,
  19828. this.mouse = new B.Vector3(1.1,1.1,.5),
  19829. this.mouseAtMouseDown = new B.Vector2,
  19830. this.mouseCouldBeClickToMove = !1,
  19831. this.mouseLastMoveTime = Date.now(),
  19832. this.mouseDown = !1,
  19833. this.mouseDownTimer = null,
  19834. this.couldBeLongTap = !1,
  19835. this.containsMouse = !0,
  19836. this.isTouchEvent = !1,
  19837. this.isPanoHover = !1,
  19838. this.reticule = new n(this),
  19839. this.panoMarkers = [],
  19840. this.spider = new s(this),
  19841. this.quaternion = new B.Quaternion,
  19842. this.position = new B.Vector3(15,10,15),
  19843. this.previousState = null,
  19844. this.lastInsideView = new o,
  19845. this.last360View = new o,
  19846. this.raycaster = new B.Raycaster,
  19847. this.intersect = null,
  19848. this.lastChangeTime = Date.now(),
  19849. this.history = new h,
  19850. this.cameraControls = null,
  19851. this.path = null,
  19852. this.model = null,
  19853. this.domElement = null,
  19854. this.cachedPanoCandidates = null,
  19855. this.basePanoSize = 0,
  19856. this.standardPanoSize = 0,
  19857. this.highPanoSize = 0,
  19858. this.ultraHighPanoSize = 0,
  19859. this.zoomLevel = 1,
  19860. this.zooming = 0,
  19861. this.zoomSpeed = .5,
  19862. this.scrollZoomSpeed = .06,
  19863. this.zoomSpeedAdjust = .05,
  19864. this.defaultZoomIncrement = .2,
  19865. this.baseFov = k.insideFOV,
  19866. this.zoomFov = this.baseFov,
  19867. this.zoomEnabled = !0,
  19868. this.preRenderingEnabled = !1,
  19869. this.setupCustomProperties(e),
  19870. this.zoomStats = new v,
  19871. this.modeTran = ''
  19872. this.currentCursor = '';
  19873. }
  19874. var B = J("three")
  19875. , i = J("./util/logger")
  19876. , n = J("./objects/Reticule")
  19877. , a = J("./objects/Panorama")
  19878. , r = J("./objects/ShowPath")
  19879. , o = J("./objects/View")
  19880. , s = (J("./objects/Snapshot"),
  19881. J("./objects/NSpider"))
  19882. , V = J("./enum/Viewmode")
  19883. , T = (J("./enum/TagStates"),
  19884. J("./enum/Vectors"))
  19885. , l = J("./enum/Keys")
  19886. , k = (J("./enum/AlignmentType"),
  19887. J("./settings"))
  19888. , x = J("./util/common")
  19889. , U = (J("./util/browser"),
  19890. J("./util/math"))
  19891. , H = J("./util/lerp")
  19892. , z = J("./util/easing")
  19893. , G = J("./util/transitions")
  19894. , c = J("events").EventEmitter
  19895. , h = (J("./shaders"),
  19896. J("./util/history"))
  19897. , S = (J("./util/camera"),
  19898. J("./model/ModelManager"),
  19899. J("./enum/PathDiscardMode"))
  19900. , M = J("./enum/PathDisplayMode")
  19901. , W = J("./enum/PlayerEvents")
  19902. , u = J("./enum/ControlEvents")
  19903. , d = J("./enum/ModelManagerEvents")
  19904. , R = J("./enum/WarpStyle")
  19905. , P = J("./enum/BlackoutStyle")
  19906. , p = J("./exception/BasicException")
  19907. , f = J("./enum/PanoSizeClass")
  19908. , g = (J("./tile/TileDownloader"),
  19909. J("./tile/TilePrioritizer"))
  19910. , m = (J("./enum/PanoramaEvents"),
  19911. J("./enum/ZoomEvents"))
  19912. , v = J("./util/ZoomStats")
  19913. , y = J("./constants")
  19914. , j = J("./util/common")
  19915. , A = J("./util/cameraLight")
  19916. , C = J("hot")
  19917. , Y = new i(e)
  19918. , q = Object.freeze({
  19919. FlyToPano: G.getUniqueId(),
  19920. FlyToNewMode: G.getUniqueId(),
  19921. FlyToSameMode: G.getUniqueId(),
  19922. FlyToViewFloor: G.getUniqueId(),
  19923. LookTransition: G.getUniqueId(),
  19924. ZoomTransition: G.getUniqueId()
  19925. });
  19926. function I(e) {
  19927. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  19928. o[r] = n.charCodeAt(r);
  19929. return new Blob([o],{
  19930. type: i
  19931. })
  19932. }
  19933. (t.prototype = Object.create(c.prototype)).init = function(e) {
  19934. (window.player = this).modelManager = e.modelManager,
  19935. this.tileDownloader = e.tileDownloader,
  19936. this.panoRenderer = e.panoRenderer,
  19937. this.qualityManager = e.qualityManager,
  19938. this.domElement = e.container,
  19939. this.camera = e.camera,
  19940. this.tagManager = e.tagManager,
  19941. this.cameraControls = e.controls,
  19942. this.path = new r(e.director,this,e.controls),
  19943. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  19944. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  19945. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  19946. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  19947. this.tileDownloader.processPriorityQueue = !1,
  19948. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  19949. this.bindEvents(e.container),
  19950. this.updateModel()
  19951. }
  19952. ,
  19953. t.prototype.screenShot = function(i) {
  19954. if (!this.flying && !this.flyingToTag) {
  19955. var n = this.sceneRenderer;
  19956. for (var e in n.updateScreenSize(i),
  19957. this.model.panos.index)
  19958. this.model.panos.index[e].marker && (this.model.panos.index[e].marker.forceHide = this.model.panos.index[e].marker.visible,
  19959. this.model.panos.index[e].marker.visible = !1);
  19960. for (var e in this.model.hots)
  19961. this.model.hots[e].mesh.visible = !1;
  19962. this.reticule.visible = !1,
  19963. this.reticule.forceUnvisible = !0,
  19964. this.path.currentPanoMarker.mesh.visible = !1,
  19965. setTimeout(function() {
  19966. n.renderer.clear(!0, !0, !0),
  19967. n.renderer.render(n.scene, n.camera);
  19968. var e = n.renderer.domElement.toDataURL(i.type, .9);
  19969. for (var t in i.f && i.f(e),
  19970. n.updateScreenSize({
  19971. resize: !0
  19972. }),
  19973. this.reticule.visible = !0,
  19974. this.model.hots)
  19975. this.model.hots[t].mesh.visible = !0;
  19976. for (var t in this.model.panos.index)
  19977. this.model.panos.index[t].marker.visible = this.model.panos.index[t].marker.forceHide;
  19978. this.path.currentPanoMarker.mesh.visible = !0,
  19979. n.renderer.render(n.scene, n.camera)
  19980. }
  19981. .bind(this), 30)
  19982. }
  19983. }
  19984. ;
  19985. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  19986. t.prototype.getWrapShot = function() {
  19987. var i = this.getSnapAngleInfo()
  19988. , n = ",{\r\t" + i
  19989. , r = arguments[0];
  19990. this.screenShot({
  19991. width: 4 * g_snapShotWidth,
  19992. height: 4 * g_snapShotHeight,
  19993. type: "image/jpeg",
  19994. f: function(e) {
  19995. if (r && r.__callback)
  19996. return r.__callback(e, i);
  19997. var t = new Image;
  19998. t.src = e,
  19999. t.onload = function() {
  20000. var e = function(r, i) {
  20001. function n(e, t) {
  20002. var i = o || r
  20003. , n = document.createElement("canvas");
  20004. n.width = i.width,
  20005. n.height = i.height,
  20006. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20007. o = Q(e, n, t)
  20008. }
  20009. function e() {
  20010. var e = o || r
  20011. , t = I(e.src);
  20012. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20013. t = I(e.src)),
  20014. (o = o || new Image).base64Src = e.src,
  20015. o.src = window.URL.createObjectURL(t)
  20016. }
  20017. var o, t = Math.max(r.width, r.height);
  20018. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20019. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20020. e())),
  20021. o || r
  20022. }(this, {
  20023. maxSize: g_snapShotWidth,
  20024. oldType: "jpeg"
  20025. });
  20026. e.src.replace(function(e) {
  20027. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20028. }("image/jpeg"), "image/octet-stream");
  20029. var t = "snap" + (new Date).getTime();
  20030. !function(e, t) {
  20031. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20032. i.href = e,
  20033. i.download = t;
  20034. var n = document.createEvent("MouseEvents");
  20035. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20036. i.dispatchEvent(n)
  20037. }(e.src, t + ".jpg"),
  20038. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20039. n += '\r\t"sid":"' + t + '",',
  20040. n += '\r\t"name":"' + t + '"\r}',
  20041. logData(n)
  20042. }
  20043. }
  20044. })
  20045. }
  20046. /* ,
  20047. t.prototype.getSnapAngleInfo = function() {
  20048. var e = {}
  20049. , t = '"metadata":{'
  20050. , i = this.camera.quaternion.clone();
  20051. switch (this.mode) {
  20052. case "panorama":
  20053. e.scan_id = this.currentPano.id,
  20054. t += '"scan_id":"' + this.currentPano.id + '",';
  20055. break;
  20056. case "floorplan":
  20057. e.camera_mode = 1,
  20058. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20059. t += '"camera_mode":1,',
  20060. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20061. break;
  20062. case "dollhouse":
  20063. e.camera_mode = 2,
  20064. t += '"camera_mode":2,'
  20065. }
  20066. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20067. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20068. n.x *= -1,
  20069. n.w *= -1,
  20070. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20071. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20072. e.zoom = this.zoomLevel,
  20073. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20074. }
  20075. , */
  20076. t.prototype.getSnapAngleInfo = function(){
  20077. var info = {};
  20078. var str = '"metadata":{';
  20079. var q = this.camera.quaternion.clone();
  20080. switch (this.mode) {
  20081. case "panorama":
  20082. info.scan_id = this.currentPano.id;
  20083. str += ('"scan_id":"'+this.currentPano.id+'",');
  20084. break;
  20085. case "floorplan":
  20086. info.camera_mode = 1;
  20087. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20088. q.multiply(this.camera.quaternion);
  20089. str += ('"camera_mode":1,');
  20090. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20091. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20092. break;
  20093. case "dollhouse":
  20094. info.camera_mode = 2;
  20095. str += ('"camera_mode":2,');
  20096. break;
  20097. }
  20098. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20099. //console.log(info.camera_position)
  20100. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20101. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20102. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20103. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20104. out.x *= -1;
  20105. out.w *= -1;
  20106. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20107. }else{
  20108. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20109. } */
  20110. info.zoom = this.zoomLevel;
  20111. //console.log(info.camera_quaternion)
  20112. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20113. // fyz 扩展编辑页面, 加上导览点缩放值
  20114. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20115. console.log(str)
  20116. return str;
  20117. }
  20118. //------end
  20119. t.prototype.closePopup = function() {
  20120. if (g_currentHot) {
  20121. g_currentHot = null,
  20122. document.getElementById("popup").style.display = "none",
  20123. document.querySelector(".popup-content").removeChild(document.getElementById("id1")),
  20124. $("#popup iframe:last").remove();
  20125. document.getElementById("bgaudio");
  20126. if(g_bgAudio && g_bgAudio.pauseByHot){
  20127. manage.switchBgmState(true)
  20128. }
  20129. return false
  20130. }
  20131. }
  20132. ,
  20133. t.prototype.setupCustomProperties = function(e) {
  20134. var i = e || V.PANORAMA;
  20135. Object.defineProperty(this, "mode", {
  20136. get: function() {
  20137. return i
  20138. },
  20139. set: function(e) {
  20140. var t = i;
  20141. i = e,
  20142. this.onModeUpdated(t, i)
  20143. }
  20144. })
  20145. }
  20146. ,
  20147. t.prototype.isInMode = function() {
  20148. for (var e = 0; e < arguments.length; e++)
  20149. if (this.mode === arguments[e])
  20150. return !0;
  20151. return !1
  20152. }
  20153. ,
  20154. t.prototype.isOutsideMode = function(e) {
  20155. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20156. }
  20157. ,
  20158. t.prototype.is360View = function(e, t) {
  20159. return e === V.PANORAMA && t && !t.isAligned()
  20160. }
  20161. ,
  20162. t.prototype.setScene = function(e) {
  20163. this.sceneIntersectionPlane = e.plane,
  20164. this.path.setScene(e),
  20165. this.moveReticuleToScene(e)
  20166. }
  20167. ,
  20168. t.prototype.moveReticuleToScene = function(e) {
  20169. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20170. e.add(this.reticule)
  20171. }
  20172. ,
  20173. t.prototype.updateModel = function() {
  20174. function n(e) {
  20175. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20176. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20177. , n = t.position.y + (e - i.target.y)
  20178. , r = k.showFloorDuration + k.showFloorDelay;
  20179. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20180. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20181. }
  20182. this.model = this.modelManager.getActiveModel(),
  20183. this.model.on("floor.changed", function(e, t, i) {
  20184. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20185. }
  20186. .bind(this)),
  20187. this.model.on("allfloors.toggled", function(e, t) {
  20188. if (this.mode === V.DOLLHOUSE) {
  20189. var i = e ? this.model.center.y : i = t.center.y;
  20190. n.call(this, i)
  20191. }
  20192. }
  20193. .bind(this)),
  20194. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20195. var t = this;
  20196. this.model.panos.list.forEach(function(e) {
  20197. e.vrMarker.addEventListener("click", function() {
  20198. t.flyToPano({
  20199. pano: e
  20200. })
  20201. })
  20202. })
  20203. }
  20204. ,
  20205. t.prototype.updateModelDependentData = function() {
  20206. this.cameraControls.setModelForControls(this.model),
  20207. this.getPanoMarkersFromModel(this.model)
  20208. }
  20209. ,
  20210. t.prototype.onModelChanged = function() {
  20211. this.updateModel(),
  20212. this.updateModelDependentData()
  20213. }
  20214. ,
  20215. t.prototype.getPanoMarkersFromModel = function(e) {
  20216. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20217. return t.marker ? e.concat(t.marker) : e
  20218. }, [])
  20219. }
  20220. ,
  20221. t.prototype.handleControlMove = function(e) {
  20222. this.emit(W.Move, e)
  20223. }
  20224. ,
  20225. t.prototype.handleControlInputStart = function(e) {
  20226. this.emit(W.InputStart, e)
  20227. }
  20228. ,
  20229. t.prototype.onModeUpdated = function(e, t) {
  20230. this.cameraControls.activateControls(t),
  20231. this.emit(W.ModeChanged, e, t)
  20232. }
  20233. ,
  20234. t.prototype.isWarping = function() {
  20235. return this.path.warping
  20236. }
  20237. ,
  20238. t.prototype.isWaitingToWarp = function() {
  20239. return this.path.waitingToWarp
  20240. }
  20241. ,
  20242. t.prototype.getLabelScaleFactor = function() {
  20243. if (this.isOutsideMode()) {
  20244. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20245. }
  20246. return .5
  20247. }
  20248. ,
  20249. t.prototype.changeMusic = function() {
  20250. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  20251. }
  20252. ,
  20253. t.prototype.bindEvents = function(e) {
  20254. e !== document && e.setAttribute("tabindex", -1),
  20255. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20256. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20257. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20258. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20259. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20260. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20261. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20262. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20263. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20264. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20265. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20266. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20267. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20268. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20269. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20270. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20271. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20272. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20273. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20274. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20275. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20276. window.getSeft && getSeft(this),
  20277. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? $("#closepop").on("touchstart", this.closePopup.bind(this)) : $("#closepop").on("click", this.closePopup.bind(this))
  20278. }
  20279. ,
  20280. t.prototype.onMouseDown = function(e) {
  20281. e.currentTarget !== document && e.currentTarget.focus(),
  20282. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20283. this.updateIntersect())
  20284. }
  20285. ,
  20286. t.prototype.onMouseMove = function(e) {
  20287. this.isTouchEvent = !1,
  20288. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20289. }
  20290. ,
  20291. t.prototype.onMouseOver = function(e) {
  20292. this.containsMouse = !0,
  20293. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20294. }
  20295. ,
  20296. t.prototype.onMouseOut = function(e) {
  20297. this.containsMouse = !1
  20298. }
  20299. ,
  20300. t.prototype.onMouseUp = function(e) {
  20301. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20302. }
  20303. ,
  20304. t.prototype.onTouchStart = function(e) {
  20305. if (e.currentTarget !== document && e.currentTarget.focus(),
  20306. !this.mouseDown) {
  20307. this.couldBeLongTap = !0;
  20308. var t = x.average(e.changedTouches, "clientX")
  20309. , i = x.average(e.changedTouches, "clientY");
  20310. this.handleInputStart.call(this, t, i, !0),
  20311. this.mouseDownTimer = setTimeout(function() {
  20312. this.updateIntersect(),
  20313. this.handleInputEnd.call(this, t, i, !0)
  20314. }
  20315. .bind(this), k.input.longTapThreshold)
  20316. }
  20317. }
  20318. ,
  20319. t.prototype.onTouchMove = function(e) {
  20320. var t = x.average(e.changedTouches, "clientX")
  20321. , i = x.average(e.changedTouches, "clientY");
  20322. this.handleInputMove.call(this, t, i, !0)
  20323. }
  20324. ,
  20325. t.prototype.onTouchEnd = function(e) {
  20326. if (clearTimeout(this.mouseDownTimer),
  20327. this.mouseDown) {
  20328. this.couldBeLongTap = !1,
  20329. this.updateIntersect();
  20330. var t = x.average(e.changedTouches, "clientX")
  20331. , i = x.average(e.changedTouches, "clientY");
  20332. this.handleInputEnd.call(this, t, i, !0)
  20333. }
  20334. }
  20335. ,
  20336. t.prototype.onPointerDown = function(e) {
  20337. return e.currentTarget !== document && e.currentTarget.focus(),
  20338. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20339. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20340. void (this.mouseDownTimer = setTimeout(function() {
  20341. this.updateIntersect(),
  20342. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20343. }
  20344. .bind(this), k.input.longTapThreshold)))
  20345. }
  20346. ,
  20347. t.prototype.onPointerMove = function(e) {
  20348. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20349. }
  20350. ,
  20351. t.prototype.onPointerUp = function(e) {
  20352. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20353. this.couldBeLongTap = !1,
  20354. this.updateIntersect(),
  20355. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20356. }
  20357. ,
  20358. t.prototype.onPointerOut = function(e) {
  20359. this.mouseDown = !1
  20360. }
  20361. ,
  20362. t.prototype.onPointerCancel = function(e) {
  20363. this.mouseDown = !1
  20364. }
  20365. ,
  20366. t.prototype.onKeyDown = function(e) {
  20367. var t = function() {
  20368. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20369. }
  20370. .bind(this)
  20371. , i = e.which;
  20372. switch (i) {
  20373. case l.F:
  20374. t(),
  20375. this.changeFloor(-1);
  20376. break;
  20377. case l.R:
  20378. t(),
  20379. this.changeFloor(1)
  20380. }
  20381. if (this.mode === V.PANORAMA)
  20382. switch (i) {
  20383. case l.UPARROW:
  20384. case l.W:
  20385. this.flyLocalDirection(T.FORWARD.clone());
  20386. break;
  20387. case l.DOWNARROW:
  20388. case l.S:
  20389. this.flyLocalDirection(T.BACK.clone());
  20390. break;
  20391. case l.A:
  20392. this.flyLocalDirection(T.LEFT.clone());
  20393. break;
  20394. case l.D:
  20395. this.flyLocalDirection(T.RIGHT.clone())
  20396. }
  20397. }
  20398. ,
  20399. t.prototype.handleScrollPinchZoom = function(e) {
  20400. var t = e
  20401. , i = this.zoomLevel;
  20402. this.zoomBy(t),
  20403. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20404. }
  20405. ,
  20406. t.prototype.handleControlPinch = function(e) {
  20407. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  20408. }
  20409. ,
  20410. t.prototype.handleControlScroll = function(e) {
  20411. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20412. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  20413. }
  20414. ,
  20415. t.prototype.handleInputStart = function(e, t, i) {
  20416. var n = this.handelPadding(e, t);
  20417. e = n.x,
  20418. t = n.y,
  20419. this.isTouchEvent = i,
  20420. U.convertScreenPositionToNDC(e, t, this.mouse),
  20421. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20422. this.mouseCouldBeClickToMove = !0,
  20423. this.mouseDown = !0,
  20424. this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20425. window.transformControls && transformControls.onPointerDown()
  20426. if(!this.overlayInitedPlay && this.overlayGroup.children.length){
  20427. try{
  20428. this.overlayGroup.children.forEach((overlay)=>{overlay.plane.material.map.image.play()})
  20429. }catch(e){}
  20430. this.overlayInitedPlay = true
  20431. }
  20432. }
  20433. ,
  20434. t.prototype.handelPadding = function(e, t) {
  20435. return this.pad || (this.pad = {
  20436. x: dom.getOffset("left", $("#player")[0]),
  20437. y: dom.getOffset("top", $("#player")[0])
  20438. }),
  20439. {
  20440. x: e - this.pad.x,
  20441. y: t - this.pad.y
  20442. }
  20443. }
  20444. ,
  20445. t.prototype.handleInputMove = function(e, t, i) {
  20446. var n = this.handelPadding(e, t);
  20447. e = n.x,
  20448. t = n.y,
  20449. this.isTouchEvent = i,
  20450. U.convertScreenPositionToNDC(e, t, this.mouse);
  20451. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  20452. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20453. this.couldBeLongTap = !1,
  20454. clearTimeout(this.mouseDownTimer)),
  20455. this.mouseLastMoveTime = Date.now(),
  20456. this.reticule.move(e, t, i)
  20457. window.transformControls && transformControls.onPointerMove()
  20458. }
  20459. ,
  20460. t.prototype.handleInputEnd = function(e, t, i) {
  20461. if (this.isTouchEvent = i,
  20462. this.mouseDown = !1,
  20463. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  20464. !i && this.couldBeLongTap)
  20465. return !0;
  20466. if (this.handleLongTap())
  20467. return !0;
  20468. window.transformControls && transformControls.onPointerUp()
  20469. if (this.mouseCouldBeClickToMove) {
  20470. if (this.flying)
  20471. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20472. !0;
  20473. //add----
  20474. if (window.panoVisiSet && panoVisiSet.setPanoVisible) {//正在设置漫游可行
  20475. this.intersect && this.intersect.object.visible && panoVisiSet.dealPanoVisible(this.intersect.object.name);
  20476. return;
  20477. }
  20478. if(this.hoveringPlane){
  20479. this.clickOverlay(this.hoveringPlane)
  20480. return;
  20481. }
  20482. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  20483. return EditOverlay.addPlane({intersect:this.intersect});
  20484. }
  20485. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20486. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20487. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20488. } */
  20489. //----------
  20490. if (this.checkHotClick())
  20491. return !0;
  20492. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  20493. this.history.invalidate(),
  20494. this.intersect)
  20495. return this.flyToPanoClosestToMouse();
  20496. if (this.mode === V.PANORAMA) {
  20497. var n = this.closestPanoInDirection(this.getMouseDirection());
  20498. return n ? this.flyToPano({
  20499. pano: n
  20500. }) : this.bump(this.getMouseDirection())
  20501. }
  20502. }
  20503. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20504. }
  20505. ,
  20506. t.prototype.handleLongTap = function() {
  20507. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  20508. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  20509. !0
  20510. }
  20511. ,
  20512. t.prototype.checktagClick = function() {
  20513. if (this.tagManager.intersectTag) {
  20514. var e = this.isTouchEvent
  20515. , t = this.tagManager.clickedOnTag(e, this);
  20516. return e || t || G.cancelById(q.LookTransition),
  20517. !0
  20518. }
  20519. if (this.tagManager.activeTag)
  20520. return this.tagManager.dismissActiveTag(),
  20521. !1
  20522. }
  20523. ,
  20524. t.prototype.rankedtagInDirection = function(e, t) {
  20525. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20526. }
  20527. ,
  20528. t.prototype.start = function(e) {
  20529. $(".toolLeft").removeClass("unable");
  20530. $(".toolTop").removeClass("unable");
  20531. //-------------------
  20532. window.initTransformCtl(B)
  20533. window.initOverlay(B)
  20534. this.model.loadOverlays()
  20535. window.EditOverlay && window.EditOverlay.init(B);
  20536. window.panoVisiSet && panoVisiSet.init()
  20537. //-------------------
  20538. var t = e.mode
  20539. , i = e.pano
  20540. , n = e.position
  20541. , r = e.quaternion
  20542. , o = e.tag
  20543. , a = e.quickstart
  20544. , s = $.Deferred();
  20545. this.updateModelDependentData(),
  20546. this.updateFromControls(),
  20547. this.findDefaultViews();
  20548. var l = this.is360View(t, i);
  20549. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20550. s.done(function(e) {
  20551. this.emit(W.Ready, l, e, o)
  20552. }
  20553. .bind(this)),
  20554. s.promise()
  20555. }
  20556. ,
  20557. t.prototype.startOutside = function(e, t) {
  20558. var i = e.mode
  20559. , n = e.pano
  20560. , r = e.position
  20561. , o = e.quaternion
  20562. , a = e.zoom
  20563. , s = e.floorVisibility
  20564. , l = e.tag;
  20565. this.emit(W.StartOutside, k[i].transitionTime),
  20566. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20567. G.cancelById(q.FlyToViewFloor),
  20568. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20569. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20570. }
  20571. ,
  20572. t.prototype.startInside = function(e, t, i, n, r) {
  20573. r = r || $.Deferred();
  20574. var o = (this.currentPano = e) && !e.isAligned();
  20575. if (t = o ? e.position : t || e.position,
  20576. i = i || e.quaternion,
  20577. e) {
  20578. var a = this.startInside.bind(this, e, t, i, n, r);
  20579. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20580. return
  20581. }
  20582. return this.mode = V.PANORAMA,
  20583. e.floor.enter(this.mode),
  20584. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20585. this.switchCameraMode(this.mode, i),
  20586. this.emit(W.StartInside, o),
  20587. r.resolve(!0),
  20588. r
  20589. }
  20590. ,
  20591. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  20592. if (r = r || $.Deferred(),
  20593. this.dollhouseMode(),
  20594. !i)
  20595. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20596. r.resolve(!1),
  20597. r;
  20598. e = e || i.position;
  20599. var o = n || this.cameraControls.activeControl.camera.quaternion
  20600. , a = i.position;
  20601. return this.fitDollhouse(a, e, o),
  20602. setTimeout(function(e) {
  20603. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  20604. var t = {
  20605. mode: V.PANORAMA,
  20606. pano: i,
  20607. quaternion: n,
  20608. callback: function() {
  20609. this.emit(W.FlyinFinished),
  20610. r.resolve(!0)
  20611. }
  20612. .bind(this)
  20613. };
  20614. this.flyToNewMode(t)
  20615. }
  20616. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  20617. r
  20618. }
  20619. ,
  20620. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  20621. K = {},
  20622. function(t, e, i, n, r, o, a, s, l, c) {
  20623. if (function() {
  20624. for (var e in Z)
  20625. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  20626. return !0;
  20627. return !1
  20628. }())
  20629. return !0;
  20630. var h = function(e, t, i) {
  20631. j.delayOneFrame(function() {
  20632. Z[e] = !1,
  20633. r && r(t, i)
  20634. }
  20635. .bind(this))
  20636. }
  20637. .bind(this, t.id)
  20638. , u = function(e, t) {
  20639. j.delayOneFrame(function() {
  20640. Z[e] = !1,
  20641. o && o(t)
  20642. }
  20643. .bind(this))
  20644. }
  20645. .bind(this, t.id);
  20646. try {
  20647. return null != s || (s = !0),
  20648. 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),
  20649. Z[t.id] && (K[t.id] = performance.now()),
  20650. Z[t.id]
  20651. } catch (e) {
  20652. throw Z[t.id] = !1,
  20653. K[t.id] = performance.now() - 5e3,
  20654. e
  20655. }
  20656. }
  20657. ),
  20658. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  20659. if (!e)
  20660. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  20661. return r && this.model.waitForLoad(e, function() {
  20662. return e.isLoaded(i)
  20663. }),
  20664. !e.isLoaded(t) && (e.loadCube(t).done(n),
  20665. !0)
  20666. }
  20667. ,
  20668. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  20669. function(e, t, i, n, r, o, a, s) {
  20670. if (!e)
  20671. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  20672. return X.copy(T.FORWARD),
  20673. this.getDirection(X),
  20674. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  20675. return e.isLoaded(t)
  20676. }),
  20677. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  20678. i && i(e, t)
  20679. }
  20680. .bind(this)).fail(function(e) {
  20681. n && n(e)
  20682. }
  20683. .bind(this)).progress(function(e, t, i) {
  20684. r && r(e, t, i)
  20685. }
  20686. .bind(this)),
  20687. !0)
  20688. }
  20689. ),
  20690. t.prototype.switchCameraMode = function(e, t) {
  20691. var i = this.cameraControls.controls[e]
  20692. , n = i.camera;
  20693. switch (e) {
  20694. case V.PANORAMA:
  20695. n.position.copy(this.currentPano.position);
  20696. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  20697. i.lookAt(r.add(n.position));
  20698. break;
  20699. case V.DOLLHOUSE:
  20700. var o = this.position.clone();
  20701. 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),
  20702. n.position.copy(o),
  20703. i.target.copy(this.target.clone().setY(this.model.center.y));
  20704. break;
  20705. case V.FLOORPLAN:
  20706. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  20707. i.target.copy(this.model.center).setY(0),
  20708. i.zoomToContain(this.model.size),
  20709. i.rotateToView(this.model.size, this.getDirection())
  20710. }
  20711. i.update(0)
  20712. }
  20713. ,
  20714. t.prototype.update = (new B.Vector3,
  20715. N = {},
  20716. F = [],
  20717. function(e) {
  20718. this.updatePersistentZooming(e),
  20719. this.updateFromControls(e),
  20720. this.getCurrentNodePanos(F)
  20721. if(this.hasChanged(N)){
  20722. this.lastChangeTime = Date.now(),
  20723. !this.mouseDown && this.containsMouse && this.updateIntersect()
  20724. this.emit(W.ViewChanged)
  20725. //add:
  20726. if (window.panoVisiSet && panoVisiSet.setPanoVisible) panoVisiSet.updateFootIconSize();
  20727. }
  20728. this.model.supportsTiles && (this.updateTileDownloader(F),
  20729. this.updatePanoRenderer(F)),
  20730. this.updatePreRendering(F),
  20731. this.reticule.update(),
  20732. this.path.update(),
  20733. this.spider.update(),
  20734. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  20735. this.updateControlLocks(),
  20736. this.model.supportsTiles && this.updateZoomPano()
  20737. }
  20738. ),
  20739. t.prototype.updatePersistentZooming = function(e) {
  20740. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  20741. }
  20742. ,
  20743. t.prototype.updateControlLocks = function() {
  20744. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  20745. }
  20746. ,
  20747. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  20748. function(e) {
  20749. var t = this.nextPano || this.currentPano;
  20750. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  20751. this.getDirection(D),
  20752. this.panoRenderer.updateDirection(D))
  20753. }
  20754. ),
  20755. t.prototype.cleanupInactivePanos = (O = [],
  20756. L = [],
  20757. function() {
  20758. O.length = 0,
  20759. O.push(this.currentPano),
  20760. this.nextPano && O.push(this.nextPano);
  20761. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  20762. L.push(this.panoRenderer.activePanos[e]);
  20763. for (var t = 0; t < L.length; t++) {
  20764. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  20765. i.id === O[r].id && (n = !1);
  20766. n && i.exit()
  20767. }
  20768. }
  20769. ),
  20770. t.prototype.updatePreRendering = (w = {},
  20771. function(e) {
  20772. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  20773. var t = this.nextPano || this.currentPano;
  20774. if (t && e && 1 < e.length) {
  20775. var i = e.findIndex(function(e) {
  20776. if (e.id === t.id)
  20777. return !0
  20778. });
  20779. if (0 <= i && i + 1 < e.length) {
  20780. var n = e[i + 1];
  20781. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  20782. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  20783. window.setTimeout(function(e) {
  20784. w[e.id] = !1
  20785. }
  20786. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  20787. }
  20788. .bind(this, n), k.tiling.panoPreRenderDelay),
  20789. w[n.id] = !0)
  20790. }
  20791. }
  20792. }
  20793. }
  20794. ),
  20795. t.prototype.enablePreRendering = function() {
  20796. this.preRenderingEnabled = !0
  20797. }
  20798. ,
  20799. t.prototype.disablePreRendering = function() {
  20800. this.preRenderingEnabled = !1,
  20801. this.cleanupInactivePanos()
  20802. }
  20803. ,
  20804. t.prototype.updateTileDownloader = (b = new B.Vector3,
  20805. function(e) {
  20806. var t = this.nextPano || this.currentPano;
  20807. t && (b.copy(T.FORWARD),
  20808. this.getDirection(b),
  20809. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  20810. this.tileDownloader.processPriorityQueue = !0)
  20811. }
  20812. ),
  20813. t.prototype.updateFromControls = function(e) {
  20814. null != e || (e = 0),
  20815. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  20816. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  20817. this.position.copy(this.cameraControls.activeControl.camera.position),
  20818. this.target.copy(this.cameraControls.activeControl.target),
  20819. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  20820. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  20821. this.camera.position.copy(this.position),
  20822. this.camera.quaternion.copy(this.quaternion),
  20823. this.camera.updateMatrix(),
  20824. this.camera.updateMatrixWorld()
  20825. }
  20826. ,
  20827. t.prototype.hasChanged = function(e) {
  20828. if (!this.previousState)
  20829. return this.previousState = {
  20830. allFloorsVisible: this.model.allFloorsVisible,
  20831. position: this.position.clone(),
  20832. quaternion: this.quaternion.clone(),
  20833. mouse: this.mouse.clone(),
  20834. labelScaleFactor: this.getLabelScaleFactor(),
  20835. currentFloor: this.model.currentFloor,
  20836. projectionMatrix: this.camera.projectionMatrix.clone(),
  20837. worldMatrix: this.camera.matrixWorld.clone(),
  20838. mode: this.mode,
  20839. modelPosition: this.model.position.clone(),
  20840. modelCenter: this.model.center.clone(),
  20841. zoomLevel: this.zoomLevel
  20842. },
  20843. !0;
  20844. 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;
  20845. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  20846. e.moved = !this.position.equals(this.previousState.position),
  20847. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  20848. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  20849. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  20850. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  20851. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  20852. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  20853. e.modeChanged = this.mode !== this.previousState.mode,
  20854. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  20855. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  20856. e.nextPanoActive = null !== this.nextPano,
  20857. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  20858. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  20859. this.previousState.position.copy(this.position),
  20860. this.previousState.quaternion.copy(this.quaternion),
  20861. this.previousState.mouse.copy(this.mouse),
  20862. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  20863. this.previousState.currentFloor = this.model.currentFloor,
  20864. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  20865. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  20866. this.previousState.mode = this.mode,
  20867. this.previousState.modelPosition.copy(this.model.position),
  20868. this.previousState.modelCenter.copy(this.model.center),
  20869. this.previousState.zoomLevel = this.zoomLevel,
  20870. !t
  20871. }
  20872. ,
  20873. t.prototype.updateIntersect = function() {
  20874. var e = this.flying || this.isWarping()
  20875. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  20876. , i = G.getById(q.LookTransition);
  20877. e || t || this.isTouchEvent || i.length && i[0].running;
  20878. if (window.panoVisiSet && panoVisiSet.setPanoVisible) {
  20879. this.intersect = this.getMouseIntersect(null, panoVisiSet.footIcons);
  20880. if (this.intersect && this.intersect.object.visible )
  20881. $("#player").css("cursor", "pointer");
  20882. else
  20883. $("#player").css("cursor", "")
  20884. return;
  20885. }
  20886. this.intersect = this.getMouseIntersect(),
  20887. this.intersect && this.updateClosestPano(this.intersect),
  20888. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  20889. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  20890. }
  20891. ,
  20892. t.prototype.checkHotClick = function() {
  20893. if (this.intersectHot)
  20894. return this.intersectHot.examine(this),
  20895. !0
  20896. }
  20897. ,
  20898. t.prototype.getMouseDirection = function(e) {
  20899. e = e || this.mouse;
  20900. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  20901. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  20902. }
  20903. ,
  20904. t.prototype.hoverOverlay = function(mesh){
  20905. if(!mesh){
  20906. this.hoveringPlane = null;
  20907. $("#player").css("cursor",this.currentCursor || "" );
  20908. }else{
  20909. var overlay = mesh.parent;
  20910. $("#player").css("cursor","pointer");
  20911. this.hoveringPlane = overlay;
  20912. return true;
  20913. }
  20914. },
  20915. t.prototype.clickOverlay = function(overlay){
  20916. if(this.openOverlay && !overlay)return;
  20917. var plane = overlay.plane;
  20918. if(overlay.overlayType == "video"){
  20919. if(plane.material.map.image.paused)plane.material.map.image.play()
  20920. else plane.material.map.image.pause();
  20921. }
  20922. if(window.EditOverlay &&EditOverlay.editing){
  20923. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  20924. $('#overlayProp').removeClass('atRight').removeClass('hide')
  20925. EditOverlay.endAddPlane();
  20926. EditOverlay.updateOverlayPanel(overlay)
  20927. transformControls.attach(overlay)
  20928. return;
  20929. }
  20930. },
  20931. t.prototype.getMouseIntersect = function(e, t) {
  20932. e = e || this.mouse.clone(),
  20933. t = t || this.model.floors.reduce(function(e, t) {
  20934. return t.hidden ? e : e.concat(t.collider.children)
  20935. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  20936. t = t.slice(0)
  20937. for (var i in this.model.hots) t.push(this.model.hots[i].mesh);
  20938. this.overlayGroup && (t = t.concat(this.overlayGroup.children));
  20939. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  20940. this.raycaster.set(i, this.getMouseDirection(e));
  20941. var n = this.raycaster.intersectObjects(t, true);//add true
  20942. if ("add" == g_HotStatus) {
  20943. var r = this.raycaster.intersectObjects(window.player.model.chunks);
  20944. //console.log(r[0]),
  20945. 1 <= r.length ? ($("#player").css("cursor", "cell"),
  20946. window.hotIntersect = r[0]) : ($("#player").css("cursor", "not-allowed"),
  20947. window.hotIntersect = !1)
  20948. return;
  20949. }
  20950. if (0 === n.length)
  20951. return this.intersectHot = null,
  20952. "add" != g_HotStatus && $("#player").css("cursor", ""),
  20953. null;
  20954. var o = n[0];
  20955. if ("hotSprite" == o.object.type){
  20956. return this.intersectHot = o.object.belongHot, $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active"),
  20957. void $("#player").css("cursor", "pointer");
  20958. }
  20959. $(".toolRight .spotList ul li").removeClass("active")
  20960. this.intersectHot = null;
  20961. /* if(window.EditOverlay && n && n.length){
  20962. if(n[0].object.parent.parent == this.overlayGroup){
  20963. this.hoverOverlay(n[0].object);
  20964. }else()
  20965. } */
  20966. var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
  20967. intersect || "add" != g_HotStatus && $("#player").css("cursor", this.currentCursor),
  20968. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  20969. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  20970. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  20971. o.horizontal = .8 < o.normal.y);
  20972. return o
  20973. }
  20974. ,
  20975. t.prototype.updateClosestPano = function(e) {
  20976. var t = [a.filters.isPanoAligned()];
  20977. if (this.mode === V.PANORAMA) {
  20978. if (!this.currentPano)
  20979. return;
  20980. t.push(a.filters.not(this.currentPano)),
  20981. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  20982. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  20983. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  20984. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  20985. } else{
  20986. t.push((pano)=>{ // add
  20987. return this.checkHasNeighbor(pano)
  20988. })
  20989. t.push(a.filters.isOnVisibleFloor()),
  20990. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  20991. }
  20992. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  20993. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  20994. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  20995. this.closestPano = i) : this.isPanoHover = !1
  20996. }
  20997. ,
  20998. t.prototype.dollhouseMode = function(e, t) {
  20999. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21000. this.mode = V.DOLLHOUSE,
  21001. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21002. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21003. , n = new B.Vector3(15,10,15);
  21004. if (e && t) {
  21005. var r = T.FORWARD.clone().applyQuaternion(t)
  21006. , o = this.model.center.clone().sub(e).dot(r);
  21007. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21008. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21009. }
  21010. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21011. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21012. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21013. this.updateFromControls(),
  21014. this.model.alpha = 1,
  21015. this.model.skybox.material.uniforms.opacity.value = 0
  21016. }
  21017. ,
  21018. t.prototype.insideMode = function(e, t) {
  21019. var i = $.Deferred()
  21020. , n = t || null;
  21021. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21022. var r = [a.filters.isPanoAligned()];
  21023. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21024. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21025. this.flyToNewMode({
  21026. mode: V.PANORAMA,
  21027. pano: e,
  21028. callback: n
  21029. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21030. } else {
  21031. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21032. i.reject(o)
  21033. }
  21034. return i.promise()
  21035. }
  21036. ,
  21037. t.prototype.fitDollhouse = function(e, t, i) {
  21038. var n = T.FORWARD.clone().applyQuaternion(i);
  21039. i = n.clone().add(e);
  21040. this.cameraControls.activeControl.target.copy(i),
  21041. this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(e).add(n.multiplyScalar(-10))
  21042. }
  21043. ,
  21044. t.prototype.floorplanMode = function(e, t, i) {
  21045. this.mode = V.FLOORPLAN;
  21046. var n = this.cameraControls.controls[V.FLOORPLAN];
  21047. n.reset();
  21048. var r = e || this.model.center;
  21049. if (n.target.copy(r).setY(0),
  21050. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21051. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21052. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21053. t) {
  21054. var o = T.LEFT.clone().applyQuaternion(t);
  21055. n.rotateLeft(-Math.atan2(o.x, o.z))
  21056. } else
  21057. n.rotateToView(this.model.size, this.getDirection());
  21058. n.update(0)
  21059. }
  21060. ,
  21061. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21062. return e.skipWarpingCheck = !0,
  21063. this.flyToPano(e, t)
  21064. }
  21065. ,
  21066. t.prototype.updateMarkerVisi = function() {//加
  21067. if(this.mode != "panorama")return;
  21068. this.model.panos.list.forEach((pano)=>{
  21069. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21070. })
  21071. }
  21072. ,
  21073. t.prototype.flyToPano = function(e, t) {
  21074. var i, n = e.pano, r = e.lookAtPoint, o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride, l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null;
  21075. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21076. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21077. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21078. t && t(),
  21079. !1;
  21080. if (this.updateLastView(),
  21081. this.mode !== V.PANORAMA)
  21082. return r && (i = (new B.Quaternion).setFromUnitVectors(T.FORWARD, r.sub(n.position).normalize())),
  21083. void this.flyToNewMode({
  21084. mode: V.PANORAMA,
  21085. pano: n,
  21086. duration: o,
  21087. quaternion: i,
  21088. callback: t
  21089. });
  21090. if (!n || (h = x.deepExtend(e),
  21091. u = function() {
  21092. j.delayOneFrame(function() {
  21093. this.flyToPano(h, t)
  21094. }
  21095. .bind(this))
  21096. }
  21097. .bind(this),
  21098. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21099. var d = function(e) {
  21100. t && t(e)
  21101. }
  21102. .bind(this);
  21103. this.currentPano || (this.currentPano = n,
  21104. this.path.placeCpm(),
  21105. this.path.fadeOutCpm(k.path.fadeOutTime),
  21106. this.spider.draw());
  21107. var p = o;
  21108. if ("number" != typeof o) {
  21109. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21110. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21111. }
  21112. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21113. 1 !== this.zoomLevel)
  21114. switch (k.zoom.transitionStyle) {
  21115. case 1:
  21116. this.smoothZoomToDefault(p / 2);
  21117. break;
  21118. case 2:
  21119. return h = x.deepExtend(e),
  21120. u = this.flyToPano.bind(this, h, t),
  21121. void this.smoothZoomToDefault(k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21122. }
  21123. if (r) {
  21124. G.cancelById(q.LookTransition),
  21125. p *= k.transition.aimSlowFactor;
  21126. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21127. , m = (new B.Matrix4).lookAt(n.position, r, T.UP)
  21128. , v = (new B.Quaternion).setFromRotationMatrix(m)
  21129. , y = g.clone()
  21130. , A = new B.Vector3;
  21131. if (n === this.currentPano) {
  21132. var C = T.FORWARD.clone().applyQuaternion(g)
  21133. , I = T.FORWARD.clone().applyQuaternion(v)
  21134. , E = C.angleTo(I);
  21135. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21136. void G.start(function(e) {
  21137. y.copy(g),
  21138. H.quaternion(y, v)(e),
  21139. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21140. this.cameraControls.activeControl.lookAt(A)
  21141. }
  21142. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21143. }
  21144. }
  21145. if (n === this.currentPano || this.flying)
  21146. return void d();
  21147. this.flying = !0;
  21148. var _ = this.position.clone()
  21149. , b = this.currentPano;
  21150. Y.debug("Flying to pano ", n.position),
  21151. this.emit(W.PanoChosen, this.currentPano, n),
  21152. this.emit(W.FlyingStarted, n.position, _, n, b),
  21153. r && G.start(function(e) {
  21154. y.copy(g),
  21155. H.quaternion(y, v)(e),
  21156. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21157. this.cameraControls.activeControl.lookAt(A)
  21158. }
  21159. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21160. var w = c ? null : z[k.transition.movementEasing];
  21161. this.nextPano = n,
  21162. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21163. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21164. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21165. this.flying = !1,
  21166. this.currentPano !== n && this.currentPano.exit(),
  21167. n.enter(),
  21168. this.currentPano = n,
  21169. this.nextPano = null,
  21170. this.path.placeCpm(),
  21171. this.path.fadeOutCpm(k.path.fadeOutTime),
  21172. this.spider.draw(),
  21173. this.emit(W.FlyingEnded, n.position, _, n, b),
  21174. this.updateMarkerVisi();//add
  21175. d(e)
  21176. }
  21177. .bind(this), 0, w, "camFly", q.FlyToPano)
  21178. }
  21179. }
  21180. ,
  21181. t.prototype.fastForwardActivePanoFlight = function(e) {
  21182. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21183. G.adjustSpeed(q.FlyToPano, e),
  21184. G.adjustSpeed(q.LookTransition, e)
  21185. }
  21186. ,
  21187. t.prototype.flyToPanoClosestToMouse = function() {
  21188. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21189. this.intersect && this.updateClosestPano(this.intersect)),
  21190. this.closestPano)
  21191. return this.flyToPano({
  21192. pano: this.closestPano
  21193. });
  21194. var e = this.getMouseDirection();
  21195. this.flyDirection(e) || this.flyToPano({
  21196. pano: this.currentPano
  21197. })
  21198. }
  21199. ,
  21200. t.prototype.flyLocalDirection = function(e) {
  21201. var t = this.getDirection(e)
  21202. , i = 1 === e.z ? .4 : .75
  21203. , n = 1 === Math.abs(e.x);
  21204. return this.flyDirection(t, i, n)
  21205. }
  21206. ,
  21207. t.prototype.flyDirection = function(e, t, i) {
  21208. this.closePopup();
  21209. var n = $.Deferred();
  21210. this.history.invalidate();
  21211. var r = this.closestPanoInDirection(e, t, i);
  21212. return r ? this.flyToPano({
  21213. pano: r
  21214. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21215. n.resolve(!1)),
  21216. n.promise()
  21217. }
  21218. ,
  21219. t.prototype.closestPanoInDirection = function(e, t, i) {
  21220. return this.rankedPanoInDirection(0, e, t, i)
  21221. }
  21222. ,
  21223. t.prototype.rankedPanoInDirection = (_ = {
  21224. pano: null,
  21225. candidates: []
  21226. },
  21227. function(e, t, i, n) {
  21228. e = e || 0,
  21229. i = void 0 !== i ? i : .75;
  21230. var r = n ? "angle" : "direction";
  21231. 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)], _),
  21232. this.cachedPanoCandidates = _.candidates,
  21233. _.pano
  21234. }
  21235. ),
  21236. t.prototype.bump = function(e) {
  21237. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21238. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  21239. if (.5 < Math.abs(a))
  21240. t = function() {
  21241. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  21242. }
  21243. .bind(this),
  21244. i = function() {
  21245. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  21246. }
  21247. .bind(this);
  21248. else {
  21249. var s = this.camera.position.clone()
  21250. , l = e.clone();
  21251. this.raycaster.set(s, l);
  21252. var c = this.model.floors.reduce(function(e, t) {
  21253. return e.concat(t.collider.children)
  21254. }, [])
  21255. , h = this.raycaster.intersectObjects(c)
  21256. , u = 0 < h.length ? h[0].distance / 25 : .04
  21257. , d = s.clone().add(l.multiplyScalar(u));
  21258. t = function() {
  21259. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  21260. }
  21261. .bind(this),
  21262. i = function() {
  21263. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  21264. }
  21265. .bind(this)
  21266. }
  21267. n = function() {
  21268. this.flying = !1
  21269. }
  21270. .bind(this),
  21271. this.flying = !0,
  21272. t()
  21273. }
  21274. }
  21275. ,
  21276. t.prototype.changeFloor = function(e) {
  21277. if (!this.is360View(this.mode, this.currentPano))
  21278. if (this.mode === V.PANORAMA) {
  21279. var t = this.history.reversePano(e);
  21280. t && t.isAligned() ? this.flyToPano({
  21281. pano: t
  21282. }) : this.changeFloorByScore(e)
  21283. } else
  21284. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21285. }
  21286. ,
  21287. t.prototype.changeFloorByScore = (E = {
  21288. pano: null,
  21289. candidates: []
  21290. },
  21291. function(e) {
  21292. var t = this.model.nextFloor(e);
  21293. 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),
  21294. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  21295. this.history.push(e, this.currentPano),
  21296. this.flyToPano({
  21297. pano: E.pano
  21298. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  21299. }
  21300. ),
  21301. t.prototype.gotoFloor = function(e) {
  21302. var t = e - this.model.currentFloor.floorIndex;
  21303. this.changeFloor(t)
  21304. }
  21305. ,
  21306. t.prototype.getDirection = function(e) {
  21307. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21308. }
  21309. ,
  21310. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  21311. if (r = r || $.Deferred(),
  21312. this.mode === V.TRANSITIONING)
  21313. return Y.warn("should not be transitioning here"),
  21314. n && n(!1),
  21315. r.reject().promise();
  21316. var o = i || !1
  21317. , a = i ? i.position : this.position
  21318. , s = this.position.clone()
  21319. , l = this.currentPano;
  21320. if (Y.debug("New pose in mode " + this.mode),
  21321. !e || (retryCallback = function() {
  21322. j.delayOneFrame(function() {
  21323. this.flyToSameMode(e, t, i, n, r)
  21324. }
  21325. .bind(this))
  21326. }
  21327. .bind(this),
  21328. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21329. var c = function() {
  21330. this.emit(W.FlyingEnded, a, s, e, l),
  21331. n && n(!0)
  21332. }
  21333. .bind(this)
  21334. , h = k[this.mode]
  21335. , u = void 0 !== t ? t : h.transitionTime
  21336. , d = new B.Vector3
  21337. , p = new B.Vector3;
  21338. if (this.emit(W.FlyingStarted, a, s, e, l),
  21339. this.mode === V.PANORAMA)
  21340. Y.warn("we should not be here for panorama views");
  21341. else if (this.mode === V.DOLLHOUSE)
  21342. if (o) {
  21343. var f = new B.Vector3(0,1,0);
  21344. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21345. this.model.warpDestFloors(i.floorVisibility),
  21346. p.copy(i.position);
  21347. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21348. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  21349. , v = 3;
  21350. m.length ? (d.copy(m[0].point),
  21351. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  21352. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21353. var y = (new B.Matrix4).lookAt(p, d, f)
  21354. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  21355. , C = d.distanceTo(p)
  21356. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  21357. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  21358. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  21359. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  21360. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  21361. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  21362. this.path.burnsDir = Math.sign(b.y);
  21363. var w = new B.Euler(0,0,0,k.warp.eOrder)
  21364. , T = new B.Vector3;
  21365. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21366. G.start(function(e, t) {
  21367. w.x = E.x + e * b.x,
  21368. w.y = E.y + e * b.y,
  21369. w.z = E.z + e * b.z;
  21370. var i = _ + e * (C - _);
  21371. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  21372. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  21373. }
  21374. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21375. G.start(function(e, t) {
  21376. this.cameraControls.controls[V.DOLLHOUSE].update(),
  21377. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  21378. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  21379. }
  21380. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21381. } else
  21382. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21383. else if (this.path.placeCpm(),
  21384. this.path.fadeInCpm(k.path.fadeInTime),
  21385. i) {
  21386. this.model.warpDestFloors(i.floorVisibility);
  21387. var x = this.cameraControls.cameras[V.FLOORPLAN]
  21388. , S = this.cameraControls.controls[V.FLOORPLAN]
  21389. , M = S.target.clone()
  21390. , R = i.position.clone().sub(M)
  21391. , P = x.position.clone().sub(S.target).length()
  21392. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21393. , L = Math.atan2(S.offset.x, S.offset.z)
  21394. , D = Math.atan2(O.x, O.z)
  21395. , N = S.absoluteScale
  21396. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  21397. G.start(function(e, t) {
  21398. S.target.copy(R).multiplyScalar(e).add(M);
  21399. var i = L + (D - L) * e;
  21400. S.offset.x = P * Math.sin(i),
  21401. S.offset.z = P * Math.cos(i),
  21402. x.position.copy(S.target).add(S.offset),
  21403. S.absoluteScale = N + e * (F - N),
  21404. S.update(),
  21405. this.quaternion.copy(x.quaternion),
  21406. this.position.copy(x.position),
  21407. this.target.copy(S.target),
  21408. this.camera.projectionMatrix.copy(x.projectionMatrix)
  21409. }
  21410. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21411. } else
  21412. Y.info("flyToSameMode() funny floorplan view? skipping");
  21413. return G.setTimeout(function(e) {
  21414. this.mode = e,
  21415. c(),
  21416. r.resolve(!0)
  21417. }
  21418. .bind(this, this.mode), u, q.FlyToSameMode),
  21419. this.mode = V.TRANSITIONING,
  21420. r.promise()
  21421. }
  21422. }
  21423. ,
  21424. t.prototype.flyToNewMode = function(e, t) {
  21425. var i = (e = e || {}).mode
  21426. , n = e.pano
  21427. , r = e.duration
  21428. , o = e.warpDest
  21429. , a = e.callback
  21430. , s = e.force
  21431. , l = e.quaternion;
  21432. if (t = t || $.Deferred(),
  21433. this.isWarping())
  21434. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21435. a && a(!1),
  21436. t.reject("Cannot change mode during tour transition").promise();
  21437. if (this.mode === V.TRANSITIONING)
  21438. return a && a(!1),
  21439. t.reject("Cannot change mode during mode transition").promise();
  21440. if (i === this.mode)
  21441. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21442. t.promise()) : (a && a(!1),
  21443. t.reject("Already in " + i + " mode").promise());
  21444. var c = o || !1;
  21445. Y.debug("Switching mode to " + i);
  21446. var h = function() {
  21447. j.delayOneFrame(function() {
  21448. this.flyToNewMode(e, t)
  21449. }
  21450. .bind(this))
  21451. }
  21452. .bind(this);
  21453. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  21454. return t.promise();
  21455. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  21456. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21457. this.model.waitForLoad(this.model, function() {
  21458. return this.model.meshTexturesLoaded
  21459. }
  21460. .bind(this)),
  21461. this.model.loadMeshTextures().done(h),
  21462. t.promise();
  21463. this.history.invalidate(),
  21464. this.updateLastView();
  21465. var u = this.mode
  21466. , d = this.cameraControls.cameras[i];
  21467. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  21468. var p = void 0 !== r ? r : e.transitionTime;
  21469. this.emit(W.ModeChanging, u, i, n),
  21470. n && (this.currentPano = n),
  21471. this.switchCameraMode(i, l),
  21472. G.cancelById(q.LookTransition);
  21473. var f = (new B.Vector3).copy(this.position);
  21474. this.modeTran = this.mode + "-" + i;
  21475. if(this.mode == "floorplan" && window.panoVisiSet && panoVisiSet.setPanoVisible){
  21476. panoVisiSet.finishSetPanoVisible()
  21477. }
  21478. if(editTool.atPanel == "screen"){
  21479. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  21480. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  21481. }
  21482. if (i === V.PANORAMA)
  21483. this.emit(W.PanoChosen, n, n),
  21484. setTimeout(function() {
  21485. n.floor.enter(i)
  21486. }
  21487. .bind(this), p / 2),
  21488. this.path.fadeOutCpm(k.path.fadeOutTime);
  21489. else if (i === V.DOLLHOUSE) {
  21490. if (c && (this.model.stayPut = !0),
  21491. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21492. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  21493. this.path.placeCpm(),
  21494. this.path.fadeInCpm(k.path.fadeInTime),
  21495. c) {
  21496. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  21497. f.set(15, 10, 15);
  21498. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  21499. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  21500. v.length ? (g.copy(v[0].point),
  21501. f.copy(o.position),
  21502. 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),
  21503. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  21504. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  21505. f.add(this.model.position),
  21506. d.position.copy(f),
  21507. this.cameraControls.controls[V.DOLLHOUSE].update()
  21508. }
  21509. } else if (this.path.placeCpm(),
  21510. this.path.fadeInCpm(k.path.fadeInTime),
  21511. o) {
  21512. this.model.warpDestFloors(o.floorVisibility);
  21513. var y = this.cameraControls.cameras[V.FLOORPLAN]
  21514. , A = this.cameraControls.controls[V.FLOORPLAN]
  21515. , C = y.position.clone().sub(A.target)
  21516. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  21517. , E = Math.atan2(I.x, I.z);
  21518. A.target.copy(o.position);
  21519. var _ = C.length();
  21520. A.offset.x = _ * Math.sin(E),
  21521. A.offset.y = 0,
  21522. A.offset.z = _ * Math.cos(E),
  21523. y.position.copy(A.target).add(A.offset),
  21524. A.target.clone().sub(d.position),
  21525. d.quaternion.copy(o.quaternion),
  21526. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  21527. A.absoluteScale = A.currentScale,
  21528. A.update()
  21529. } else
  21530. this.model.currentFloor.enter(i);
  21531. var b = this.currentPano
  21532. , w = this.position.clone();
  21533. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  21534. this.flying = !0,
  21535. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  21536. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21537. d.controls.update()),
  21538. e.blackoutStyle = P.FADEIN,
  21539. p = k.show360Views.transitionTime,
  21540. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  21541. this.mode = i,
  21542. this.path && this.path.popOutCpm(),
  21543. e.blackoutStyle = P.END,
  21544. p = k.show360Views.transitionTime,
  21545. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  21546. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  21547. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  21548. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  21549. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  21550. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  21551. G.setTimeout(function() {
  21552. this.flying = !1,
  21553. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  21554. this.currentPano.enter(),
  21555. this.path.placeCpm(),
  21556. this.path.fadeOutCpm(k.path.fadeOutTime),
  21557. this.spider.draw()),
  21558. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  21559. this.mode = i,
  21560. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  21561. if (this.afterCModeFuc) {
  21562. //手动加的函数
  21563. var cf = this.afterCModeFuc;
  21564. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  21565. cf();
  21566. }
  21567. this.updateMarkerVisi();//add
  21568. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  21569. t.resolve())
  21570. }
  21571. .bind(this), p, q.FlyToNewMode),
  21572. this.mode = V.TRANSITIONING,
  21573. t.promise()
  21574. }
  21575. ,
  21576. t.prototype.fade360View = function(e, t, i) {
  21577. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  21578. $(this.domElement).fadeOut(.5 * e, function() {
  21579. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  21580. this.model.alpha = i.modelAlpha,
  21581. this.position.copy(t.position),
  21582. this.quaternion.copy(t.quaternion),
  21583. this.camera.projectionMatrix.copy(t.projectionMatrix),
  21584. $(this.domElement).fadeIn(.5 * e)
  21585. }
  21586. .bind(this))
  21587. }
  21588. ,
  21589. t.prototype.findDefaultViews = function() {
  21590. this.findDefaultView(this.lastInsideView, !0),
  21591. this.findDefaultView(this.last360View, !1)
  21592. }
  21593. ,
  21594. t.prototype.findDefaultView = function(e, i) {
  21595. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  21596. if (e.cameraMode !== V.PANORAMA)
  21597. return !1;
  21598. var t = r.get(e.panoId);
  21599. return t && t.isAligned() === i
  21600. });
  21601. 0 <= o ? (t = r.get(n[o].panoId),
  21602. e.update({
  21603. cameraMode: V.PANORAMA,
  21604. pano: t,
  21605. position: n[o].position,
  21606. quaternion: n[o].quaternion
  21607. })) : 0 <= (o = r.list.findIndex(function(e) {
  21608. return e.isAligned() === i
  21609. })) ? (t = r.list[o],
  21610. e.update({
  21611. cameraMode: V.PANORAMA,
  21612. pano: t,
  21613. position: t.position
  21614. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  21615. }
  21616. ,
  21617. t.prototype.updateLastView = function() {
  21618. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  21619. pano: this.currentPano,
  21620. position: this.position,
  21621. quaternion: this.quaternion
  21622. })
  21623. }
  21624. ,
  21625. t.prototype.goToLastView = function(e, t) {
  21626. var i = $.Deferred()
  21627. , n = i.resolve.bind(i)
  21628. , r = i.reject.bind(i)
  21629. , o = e ? this.lastInsideView : this.last360View;
  21630. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  21631. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  21632. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  21633. mode: o.cameraMode,
  21634. pano: o.pano,
  21635. quaternion: o.quaternion,
  21636. callback: t
  21637. }).done(n).fail(r),
  21638. i.promise()
  21639. }
  21640. ,
  21641. t.prototype.fadeToView = function(e, t, i, n) {
  21642. var r = $.Deferred()
  21643. , o = r.resolve.bind(r)
  21644. , a = r.reject.bind(r);
  21645. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  21646. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  21647. a("Cannot go to illegal view"),
  21648. r.promise();
  21649. var s = (k[t.cameraMode],
  21650. function() {
  21651. $(this.domElement).fadeIn(.5 * i),
  21652. n && n(),
  21653. o()
  21654. }
  21655. .bind(this))
  21656. , l = e ? P.FADEIN : P.END;
  21657. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  21658. $(this.domElement).fadeOut(.5 * i, function() {
  21659. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  21660. t.cameraMode === V.PANORAMA ? this.flyToPano({
  21661. pano: t.pano,
  21662. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  21663. duration: 0
  21664. }, s) : this.flyToNewMode({
  21665. mode: t.cameraMode,
  21666. quaternion: t.quaternion,
  21667. duration: 0,
  21668. callback: s
  21669. })
  21670. }
  21671. .bind(this)),
  21672. r.promise()
  21673. }
  21674. ,
  21675. t.prototype.startWarp = function(e, t, i, n, r, o) {
  21676. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  21677. this.flying)
  21678. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  21679. o && o(),
  21680. !1;
  21681. null != e || (e = M.Show),
  21682. this.history.invalidate(),
  21683. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  21684. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  21685. return this.emit(W.WarpStarted, a, i, n, r),
  21686. n = n || P.MIDDLE,
  21687. this.path.warpToPano(i, n, r, function() {
  21688. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  21689. this.emit(W.WarpEnded, i),
  21690. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  21691. o && o()
  21692. }
  21693. .bind(this)),
  21694. e === M.Hide && this.path.discardPathObject(),
  21695. !0
  21696. }
  21697. ,
  21698. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  21699. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  21700. s && s(),
  21701. !1)
  21702. }
  21703. ,
  21704. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  21705. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  21706. a && a(),
  21707. !1)
  21708. }
  21709. ,
  21710. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  21711. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  21712. }
  21713. ,
  21714. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  21715. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  21716. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  21717. t && t(),
  21718. !1)
  21719. }
  21720. ,
  21721. t.prototype.aimTourCamera = function(e, t, i, n) {
  21722. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  21723. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  21724. }
  21725. ,
  21726. t.prototype.showPathToHeroLocation = function(e) {
  21727. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  21728. }
  21729. ,
  21730. t.prototype.tourInterlude = function(e, t) {
  21731. this.history.invalidate(),
  21732. this.path.discardSlow();
  21733. var i = g_data2.tourAudio && g_data2.tourAudio[this.model.heroLocations[this.director.currentItem].sid]
  21734. , n = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  21735. , r = i && i.music ? i.time - n : 2e3;
  21736. this.path.waitNextStep(e, function() {
  21737. t && t()
  21738. }
  21739. .bind(this), r)
  21740. }
  21741. ,
  21742. t.prototype.stopInterlude = function() {
  21743. this.interruptAndFastForward(null, 0)
  21744. }
  21745. ,
  21746. t.prototype.interruptAndFastForward = function(e, t) {
  21747. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  21748. this.flying && this.emit(W.FlyingInterrupted),
  21749. this.path.interruptAndFastForward(e, t)
  21750. }
  21751. ,
  21752. t.prototype.setSize = function(e, t) {
  21753. var i = e / t;
  21754. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  21755. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  21756. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  21757. this.cameraControls.cameras) {
  21758. var o = this.cameraControls.cameras[r];
  21759. o.fov = this.baseFov * (1 / this.zoomLevel),
  21760. o.updateAspect(i)
  21761. }
  21762. }
  21763. ,
  21764. t.prototype.toJSON = function() {
  21765. var e = {};
  21766. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  21767. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  21768. return e.hidden ? 0 : 1
  21769. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  21770. e
  21771. }
  21772. ,
  21773. t.prototype.getCurrentNodePanos = function(e) {
  21774. if (this.model.panos.map,
  21775. e.length = 0,
  21776. this.path.nodes)
  21777. for (var t = 0; t < this.path.nodes.length; t++) {
  21778. var i = this.path.nodes[t];
  21779. e.push(this.model.panos.get(i))
  21780. }
  21781. }
  21782. ,
  21783. t.prototype.zoomIncrementally = function(e) {
  21784. var t = this.zoomLevel;
  21785. this.zoomTo(this.zoomLevel + e),
  21786. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  21787. }
  21788. ,
  21789. t.prototype.zoomInIncrementally = function(e) {
  21790. e = e || this.defaultZoomIncrement,
  21791. this.zoomIncrementally(e)
  21792. }
  21793. ,
  21794. t.prototype.zoomOutIncrementally = function(e) {
  21795. e = e || -this.defaultZoomIncrement,
  21796. this.zoomIncrementally(e)
  21797. }
  21798. ,
  21799. t.prototype.zoomBy = function(e) {
  21800. this.zoomTo(this.zoomLevel * e)
  21801. }
  21802. ,
  21803. t.prototype.zoomIn = function() {
  21804. this.zoomBy(1 + this.zoomSpeed)
  21805. }
  21806. ,
  21807. t.prototype.zoomOut = function() {
  21808. this.zoomBy(1 - this.zoomSpeed)
  21809. }
  21810. ,
  21811. t.prototype.zoomTo = function(e, t) {
  21812. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  21813. e > k.zoom.max && (e = k.zoom.max),
  21814. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  21815. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  21816. e === k.zoom.min && this.emit(m.ZoomMin)),
  21817. this.cameraControls.activeControl)) {
  21818. var i = this.cameraControls.activeControl.camera;
  21819. this.zoomLevel = e,
  21820. i.fov = this.baseFov * (1 / this.zoomLevel),
  21821. i.updateProjectionMatrix(),
  21822. this.zoomFov = i.fov
  21823. }
  21824. }
  21825. ,
  21826. t.prototype.increaseZoomSpeed = function() {
  21827. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  21828. }
  21829. ,
  21830. t.prototype.decreaseZoomSpeed = function() {
  21831. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  21832. }
  21833. ,
  21834. t.prototype.clampZoomSpeed = function(e) {
  21835. return e < 0 ? 0 : e
  21836. }
  21837. ,
  21838. t.prototype.activatePersistentZooming = function(e) {
  21839. this.zooming = e ? 1 : -1
  21840. }
  21841. ,
  21842. t.prototype.deactivatePersistentZooming = function() {
  21843. this.zooming = 0
  21844. }
  21845. ,
  21846. t.prototype.zoomDefault = function() {
  21847. this.zoomTo(1, !0)
  21848. }
  21849. ,
  21850. t.prototype.smoothZoomToDefault = function(e, t) {
  21851. var i, n = this.zoomLevel, r = function(e) {
  21852. 1 < e && (e = 1),
  21853. i = n * (1 - e) + e,
  21854. this.zoomTo(i, !0)
  21855. }
  21856. .bind(this), o = function() {
  21857. this.zoomDefault(),
  21858. t && window.setTimeout(t, 50)
  21859. }
  21860. .bind(this);
  21861. G.start(r, e, o, null, 0, z[k.transition.blendEasing])
  21862. }
  21863. ,
  21864. t.prototype.updateZoomPano = function() {
  21865. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  21866. var e = this.currentPano;
  21867. if (e) {
  21868. var t = this.zoomLevel > k.zoom.activationThreshold
  21869. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  21870. t);
  21871. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  21872. this.panoRenderer.setZoomingActive(i, e, !0);
  21873. var n = function(e, t) {
  21874. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  21875. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  21876. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  21877. e.setZoomed(t)
  21878. }
  21879. .bind(this);
  21880. i && !e.zoomed ? (n(e, !0),
  21881. this.panoRenderer.enableUltraHighQualityMode(function() {
  21882. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  21883. i && n(e, !0)
  21884. }
  21885. .bind(this))) : !t && e.zoomed && n(e, !1)
  21886. }
  21887. }
  21888. },
  21889. //--------
  21890. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  21891. var f2;
  21892. if (this.mode == mode) {
  21893. f1 && f1()
  21894. } else {
  21895. f2 = f1;
  21896. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  21897. this.afterCModeFuc = function() {
  21898. this.afterCModeFuc = f2
  21899. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  21900. }.bind(this)
  21901. } else {
  21902. this.afterCModeFuc = f2;//飞入后执行
  21903. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  21904. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  21905. }catch(e){}
  21906. }
  21907. }
  21908. }
  21909. ,
  21910. t.prototype.checkHasNeighbor = function(pano){//add
  21911. for(var i in pano.neighbourPanos ){
  21912. if(i == pano.id)continue;
  21913. if(pano.neighbourPanos[i]){
  21914. return true;
  21915. }
  21916. }
  21917. }
  21918. ,
  21919. ee.exports = t
  21920. }
  21921. ).call(this, "/js/player.js")
  21922. }
  21923. , {
  21924. "./constants": 8,
  21925. "./enum/AlignmentType": 17,
  21926. "./enum/BlackoutStyle": 18,
  21927. "./enum/ControlEvents": 21,
  21928. "./enum/Keys": 30,
  21929. "./enum/ModelManagerEvents": 33,
  21930. "./enum/PanoSizeClass": 36,
  21931. "./enum/PanoramaEvents": 37,
  21932. "./enum/PathDiscardMode": 38,
  21933. "./enum/PathDisplayMode": 39,
  21934. "./enum/PlayerEvents": 40,
  21935. "./enum/TagStates": 44,
  21936. "./enum/Vectors": 50,
  21937. "./enum/Viewmode": 51,
  21938. "./enum/WarpStyle": 52,
  21939. "./enum/ZoomEvents": 53,
  21940. "./exception/BasicException": 55,
  21941. "./model/ModelManager": 140,
  21942. "./objects/NSpider": 147,
  21943. "./objects/Panorama": 148,
  21944. "./objects/Reticule": 149,
  21945. "./objects/ShowPath": 151,
  21946. "./objects/Snapshot": 153,
  21947. "./objects/View": 154,
  21948. "./settings": 166,
  21949. "./shaders": 167,
  21950. "./tile/TileDownloader": 171,
  21951. "./tile/TilePrioritizer": 172,
  21952. "./util/ZoomStats": 179,
  21953. "./util/browser": 182,
  21954. "./util/camera": 183,
  21955. "./util/cameraLight": 184,
  21956. "./util/common": 185,
  21957. "./util/easing": 186,
  21958. "./util/history": 187,
  21959. "./util/lerp": 188,
  21960. "./util/logger": 189,
  21961. "./util/math": 190,
  21962. "./util/transitions": 195,
  21963. hot: "hot",
  21964. scaleImg: "scaleImg",
  21965. events: 202,
  21966. three: 217
  21967. }],
  21968. scaleImg: [function(e, t) {
  21969. var i = t;
  21970. (function() {
  21971. function e(e, t, i, n) {
  21972. function r() {
  21973. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  21974. U.height = p,
  21975. H = U.getContext("2d")
  21976. }
  21977. function o(e) {
  21978. if (e) {
  21979. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  21980. for (t = 0; t < ie; t += 4)
  21981. n[t] = e[t] * ne | 0,
  21982. n[t + 1] = e[t + 1] * ne | 0,
  21983. n[t + 2] = e[t + 2] * ne | 0,
  21984. n[t + 3] = e[t + 3] * ne | 0;
  21985. return delete e,
  21986. i
  21987. }
  21988. return H.getImageData(0, 0, d, p)
  21989. }
  21990. function a(e, t, i, n, r) {
  21991. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  21992. }
  21993. var s, l;
  21994. if (t || (t = e.input,
  21995. i = e.output,
  21996. n = e.inputRemovable,
  21997. e.scale && (e = e.scale)),
  21998. t.src)
  21999. if (s = document.createElement("canvas"),
  22000. null != t.naturalWidth)
  22001. s.width = t.naturalWidth,
  22002. s.height = t.naturalHeight;
  22003. else if (null != t.runtimeStyle) {
  22004. var c = t.runtimeStyle
  22005. , h = c.width
  22006. , u = c.height;
  22007. c.width = "auto",
  22008. c.height = "auto",
  22009. s.width = t.width,
  22010. s.height = t.height,
  22011. c.width = h,
  22012. c.height = u
  22013. } else {
  22014. h = t.width,
  22015. u = t.height;
  22016. t.removeAttribute && (t.removeAttribute("width"),
  22017. t.removeAttribute("height")),
  22018. s.width = t.width,
  22019. s.height = t.height,
  22020. t.width = h,
  22021. t.height = u
  22022. }
  22023. else
  22024. s = t;
  22025. l = s.getContext("2d"),
  22026. t.src && l.drawImage(t, 0, 0);
  22027. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22028. if (!f || !g)
  22029. return !1;
  22030. (t.src || n) && s.clearRect(0, 0, f, g),
  22031. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22032. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22033. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22034. e * g + .5 | 0);
  22035. 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;
  22036. if (1 < re || 1 < oe)
  22037. for (r(),
  22038. G = (z = o()).data,
  22039. C = 0; C < p; C++)
  22040. for (V = (y = C / oe) - (w = 0 | y),
  22041. j = w * $,
  22042. W = w < 1 ? j : j - $,
  22043. w < g - 2 ? (Y = j + $,
  22044. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22045. A = 0; A < d; A++,
  22046. te += 4)
  22047. Z = (b = 0 | (v = A / re)) << 2,
  22048. b < f - 2 ? (K = Z + 4,
  22049. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22050. 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,
  22051. ++Z,
  22052. ++K,
  22053. ++Q,
  22054. 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,
  22055. ++Z,
  22056. ++K,
  22057. ++Q,
  22058. 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,
  22059. ++Z,
  22060. ++K,
  22061. ++Q,
  22062. 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,
  22063. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22064. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22065. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22066. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22067. else {
  22068. if (le.Float32Array)
  22069. L = new Float32Array(ie);
  22070. else
  22071. for (L = [],
  22072. te = 0; te < ie; ++te)
  22073. L[te] = 0;
  22074. for (y = 0; y < g; y++)
  22075. for (I = (_ = 0 | (C = y * oe)) * J,
  22076. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22077. R = C + oe - _ - 1),
  22078. v = 0; v < f; v++,
  22079. ee += 4)
  22080. switch (A = v * re,
  22081. E = 0 | A,
  22082. te = I + (E << 2),
  22083. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22084. P && (x = 1 + E - A,
  22085. S = A + re - E - 1),
  22086. D = m[ee],
  22087. F = m[ee + 1],
  22088. B = m[ee + 2],
  22089. N = m[ee + 3],
  22090. P + O) {
  22091. case 0:
  22092. L[te] += D * ae,
  22093. L[te + 1] += F * ae,
  22094. L[te + 2] += B * ae,
  22095. L[te + 3] += N * ae;
  22096. break;
  22097. case 1:
  22098. T = x * oe,
  22099. L[te] += D * T,
  22100. L[te + 1] += F * T,
  22101. L[te + 2] += B * T,
  22102. L[te + 3] += N * T,
  22103. T = S * oe,
  22104. L[te + 4] += D * T,
  22105. L[te + 5] += F * T,
  22106. L[te + 6] += B * T,
  22107. L[te + 7] += N * T;
  22108. break;
  22109. case 2:
  22110. T = re * M,
  22111. L[te] += D * T,
  22112. L[te + 1] += F * T,
  22113. L[te + 2] += B * T,
  22114. L[te + 3] += N * T,
  22115. T = re * R,
  22116. L[te += J] += D * T,
  22117. L[te + 1] += F * T,
  22118. L[te + 2] += B * T,
  22119. L[te + 3] += N * T;
  22120. break;
  22121. default:
  22122. T = x * M,
  22123. L[te] += D * T,
  22124. L[te + 1] += F * T,
  22125. L[te + 2] += B * T,
  22126. L[te + 3] += N * T,
  22127. T = S * M,
  22128. L[te + 4] += D * T,
  22129. L[te + 5] += F * T,
  22130. L[te + 6] += B * T,
  22131. L[te + 7] += N * T,
  22132. T = x * R,
  22133. L[te += J] += D * T,
  22134. L[te + 1] += F * T,
  22135. L[te + 2] += B * T,
  22136. L[te + 3] += N * T,
  22137. T = S * R,
  22138. L[te + 4] += D * T,
  22139. L[te + 5] += F * T,
  22140. L[te + 6] += B * T,
  22141. L[te + 7] += N * T
  22142. }
  22143. delete m,
  22144. r(),
  22145. z = o(L)
  22146. }
  22147. if (H.putImageData(z, 0, 0),
  22148. "string" == typeof i) {
  22149. var se;
  22150. if ("png" === i || "jpeg" === i)
  22151. return (se = n && t.src ? t : new Image).width = d,
  22152. se.height = p,
  22153. se.src = U.toDataURL("image/" + i, .85),
  22154. se;
  22155. if ("png-src" === i || "jpeg-src" === i)
  22156. return U.toDataURL("image/" + i.split("-")[0], .85)
  22157. }
  22158. return U
  22159. }
  22160. var le = this;
  22161. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22162. exports.scale = e) : c = e
  22163. }
  22164. ).call(this),
  22165. i.exports = c
  22166. }
  22167. , {}],
  22168. 156: [function(i, n, e) {
  22169. (function(e) {
  22170. "use strict";
  22171. function t(e, t) {
  22172. this.model = e,
  22173. this.panos = e.panos,
  22174. this.player = t,
  22175. this.imagePanos = this.listImagePanos(),
  22176. this.retryMinimumTime = 1e4
  22177. }
  22178. var r = (i("three"),
  22179. i("./enum/Viewmode"))
  22180. , o = (i("./settings"),
  22181. i("./objects/Panorama"))
  22182. , a = new (i("./util/logger"))(e);
  22183. t.prototype.start = function() {
  22184. this.loadNextPano(function(e) {
  22185. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  22186. setTimeout(function() {
  22187. this.start()
  22188. }
  22189. .bind(this), 1e3))
  22190. }
  22191. .bind(this))
  22192. }
  22193. ,
  22194. t.prototype.validLoadTarget = function(e) {
  22195. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22196. }
  22197. ,
  22198. t.prototype.listImagePanos = function() {
  22199. var i = []
  22200. , n = this;
  22201. return this.model.images.forEach(function(e) {
  22202. if (e.metadata && e.metadata.scan_id) {
  22203. var t = n.model.panos.get(e.metadata.scan_id);
  22204. t && !t.isLoaded("high") && i.push(t)
  22205. }
  22206. }),
  22207. i
  22208. }
  22209. ,
  22210. t.prototype.nextNotLoadedImage = function() {
  22211. for (; 0 < this.imagePanos.length; ) {
  22212. var e = this.imagePanos[0];
  22213. if (!e.isLoaded("high"))
  22214. return e;
  22215. this.imagePanos.shift()
  22216. }
  22217. return null
  22218. }
  22219. ,
  22220. t.prototype.loadNextPano = function(e) {
  22221. var t, i, n = this.model.waitQueue.filter(function(e) {
  22222. return e.object instanceof o
  22223. });
  22224. 0 < n.length ? (t = n[0].object,
  22225. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22226. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22227. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22228. t = this.imagePanos[0],
  22229. 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),
  22230. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22231. a.debug("Preloading " + i + "-res pano " + t.id),
  22232. t.loadCube(i).done(e).fail(function() {
  22233. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22234. e()
  22235. })) : e && e(null)
  22236. }
  22237. ,
  22238. n.exports = t
  22239. }
  22240. ).call(this, "/js/preloaders.js")
  22241. }
  22242. , {
  22243. "./enum/Viewmode": 51,
  22244. "./objects/Panorama": 148,
  22245. "./settings": 166,
  22246. "./util/logger": 189,
  22247. three: 217
  22248. }],
  22249. 157: [function(a, s, e) {
  22250. (function(e) {
  22251. "use strict";
  22252. function t(e, t, i, n, r) {
  22253. this.qualityManager = e,
  22254. this.scene = t,
  22255. this.camera = i,
  22256. this.container = r,
  22257. this.controls = n,
  22258. this.controls.enabled = !0,
  22259. this.controls.locked = !0,
  22260. this.quickstartCamera = n.camera,
  22261. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  22262. this.skybox = null
  22263. }
  22264. var i = a("three")
  22265. , n = a("../util/logger")
  22266. , o = a("../constants")
  22267. , h = (a("../util/transitions"),
  22268. a("../util/lerp"),
  22269. a("../util/easing"),
  22270. a("../enum/Vectors"))
  22271. , u = a("../enum/PanoSizeClass")
  22272. , r = (a("../materials/ModelTextureMaterial"),
  22273. a("../materials/CubemapMaterial"))
  22274. , d = (a("../cameras/PanoramaCamera"),
  22275. a("../controls/PanoramaControls"),
  22276. a("../tile/TileUtils"),
  22277. a("../util/camera"),
  22278. a("../util/cameraLight"))
  22279. , p = (a("../util/browser"),
  22280. a("../settings"),
  22281. a("../gui/helpManager"),
  22282. new n(e));
  22283. t.prototype.load = function(e) {
  22284. e.pano.shouldRedrawOnBaseLoaded = !0;
  22285. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22286. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22287. var a = this.qualityManager.getPanoSize(u.BASE)
  22288. , s = this.qualityManager.getPanoSize(u.STANDARD);
  22289. if (e.pano.tiled) {
  22290. p.warn("Loading startPano, TILED", e.pano.id);
  22291. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22292. , c = this.quickstartCamera.fov;
  22293. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  22294. t = e.pano.loadTiledPano(s, r, {
  22295. hFov: l,
  22296. vFov: c
  22297. }, !1, !1, !0),
  22298. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22299. } else
  22300. p.warn("Loading startPano", e.pano.id),
  22301. t = e.pano.loadCube("high");
  22302. return $.when(t).then(function() {
  22303. n.init(e.pano, e.quaternion),
  22304. e.pano.tiled ? i.done(function() {
  22305. e.pano.lockUntilRenderingComplete = !1,
  22306. this.controls.locked = !1
  22307. }
  22308. .bind(this)) : this.controls.locked = !1
  22309. }
  22310. .bind(this))
  22311. }
  22312. ,
  22313. t.prototype.init = function(e, t) {
  22314. p.info("Quickstart done loading, adding scene objects"),
  22315. e.lockUntilRenderingComplete = !0,
  22316. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  22317. side: i.BackSide
  22318. })),
  22319. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22320. this.skybox.quaternion.copy(e.quaternion),
  22321. this.scene.add(this.skybox),
  22322. $(this.container).show()
  22323. }
  22324. ,
  22325. t.prototype.update = function(e) {
  22326. this.controls.update(e),
  22327. this.camera.copy(this.quickstartCamera)
  22328. }
  22329. ,
  22330. t.prototype.setSize = function(e, t) {
  22331. this.quickstartCamera.updateAspect(e / t)
  22332. }
  22333. ,
  22334. t.prototype.destroy = function() {
  22335. this.scene.remove(this.skybox)
  22336. }
  22337. ,
  22338. s.exports = t
  22339. }
  22340. ).call(this, "/js/scene/QuickstartManager.js")
  22341. }
  22342. , {
  22343. "../cameras/PanoramaCamera": 7,
  22344. "../constants": 8,
  22345. "../controls/PanoramaControls": 13,
  22346. "../enum/PanoSizeClass": 36,
  22347. "../enum/Vectors": 50,
  22348. "../gui/helpManager": 68,
  22349. "../materials/CubemapMaterial": 117,
  22350. "../materials/ModelTextureMaterial": 118,
  22351. "../settings": 166,
  22352. "../tile/TileUtils": 174,
  22353. "../util/browser": 182,
  22354. "../util/camera": 183,
  22355. "../util/cameraLight": 184,
  22356. "../util/easing": 186,
  22357. "../util/lerp": 188,
  22358. "../util/logger": 189,
  22359. "../util/transitions": 195,
  22360. three: 217
  22361. }],
  22362. 158: [function(e, t, i) {
  22363. "use strict";
  22364. function h(e, t, i) {
  22365. this.scene = e,
  22366. this.camera = t,
  22367. this.renderer = null,
  22368. this.effects = i,
  22369. this.animateCallback = null,
  22370. this.composer = null,
  22371. this.qualityManager = null,
  22372. e.renderWidth = 0,
  22373. e.renderHeight = 0,
  22374. this.updateClock = new M.Clock,
  22375. this.components = [],
  22376. this.updateListeners = [],
  22377. this.resizeListeners = [],
  22378. this.forceUpdateSize = !1,
  22379. this.started = !1,
  22380. this.textures = {},
  22381. this.suspendedObjects = []
  22382. }
  22383. 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;
  22384. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22385. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  22386. this.components.push(e),
  22387. e.update && this.updateListeners.push(e),
  22388. e.setSize && (this.resizeListeners.push(e),
  22389. this.forceUpdateSize = !0)
  22390. }
  22391. ,
  22392. h.prototype.removeComponent = function(t) {
  22393. function e(e) {
  22394. return e !== t
  22395. }
  22396. this.components = this.components.filter(e),
  22397. this.updateListeners = this.updateListeners.filter(e),
  22398. this.resizeListeners = this.resizeListeners.filter(e)
  22399. }
  22400. ,
  22401. h.prototype.start = function(e) {
  22402. if (this.started)
  22403. throw new l("Can't start SceneRenderer, already started");
  22404. this.createContext(e),
  22405. this.boluoVrInit(),
  22406. this.initComposer(),
  22407. this.started = !0,
  22408. (b = b.bind(this))()
  22409. }
  22410. ,
  22411. h.prototype.createContext = function(e) {
  22412. try {
  22413. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  22414. this.renderer.autoClear = !0,
  22415. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22416. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  22417. this.emit(r.ContextCreated)
  22418. } catch (e) {
  22419. throw new c("Unable to create a WebGL rendering context")
  22420. }
  22421. d.profiling.enabled && this.overrideTextures(),
  22422. e.appendChild(this.renderer.domElement)
  22423. }
  22424. ,
  22425. h.prototype.overrideTextures = function() {
  22426. var d = this.renderer.context
  22427. , t = 0
  22428. , i = d.createTexture;
  22429. d.createTexture = function() {
  22430. var e = i.call(d);
  22431. return e.id = t++,
  22432. this.textures[e.id] = e
  22433. }
  22434. .bind(this);
  22435. var p = d.texImage2D;
  22436. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  22437. var c, h = this.getTextureTypeFromTarget(d, e);
  22438. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  22439. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  22440. s = r,
  22441. n = (l = o).naturalWidth,
  22442. r = l.naturalHeight,
  22443. p.call(d, e, t, i, a, s, l));
  22444. var u = this.textures[c.id];
  22445. u.width = h === f.TextureCube ? 6 * n : n,
  22446. u.height = r
  22447. }
  22448. .bind(this);
  22449. var n = d.deleteTexture;
  22450. d.deleteTexture = function(e) {
  22451. delete this.textures[e.id],
  22452. n.call(d, e)
  22453. }
  22454. .bind(this)
  22455. }
  22456. ,
  22457. h.prototype.updateTextureMemory = (n = null,
  22458. function() {
  22459. var e = 0;
  22460. for (var t in this.textures) {
  22461. var i = this.textures[t];
  22462. i.width && i.height && (e += i.width * i.height * 4)
  22463. }
  22464. e !== n && this.emit(r.MemoryUsageUpdated, e),
  22465. n = e
  22466. }
  22467. ),
  22468. h.prototype.getTextureTypeFromTarget = function(e, t) {
  22469. switch (t) {
  22470. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22471. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22472. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22473. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22474. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22475. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22476. return f.TextureCube;
  22477. case e.TEXTURE_2D:
  22478. return f.Texture2D;
  22479. default:
  22480. return null
  22481. }
  22482. }
  22483. ,
  22484. h.prototype.initComposer = function() {
  22485. this.composer = new M.EffectComposer(this.renderer),
  22486. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  22487. this.composer.addPass(this.effects.hblurPass),
  22488. this.composer.addPass(this.effects.vblurPass)
  22489. }
  22490. ,
  22491. h.prototype.setSize = function(e, t, i) {
  22492. this.renderWidth = e,
  22493. this.renderHeight = t,
  22494. this.effects.aspect = e / t,
  22495. this.renderer.setSize(e, t, !1, i),
  22496. this.composer.setSize(e, t);
  22497. for (var n = 0; n < this.resizeListeners.length; n++)
  22498. this.resizeListeners[n].setSize(e, t)
  22499. }
  22500. ,
  22501. h.prototype.render = function() {
  22502. 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22503. }
  22504. ,
  22505. h.prototype.boluoVrInit = function() {
  22506. console.log("boluoVrInit"),
  22507. this.isHuawei5X = u.detectHUAWEI5X(),
  22508. this.oldRenderer = this.renderer,
  22509. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  22510. window.panoCamera = this.camera;
  22511. var i = this;
  22512. window._vrEnabled = !1,
  22513. Object.defineProperty(window, "vrEnabled", {
  22514. get: function() {
  22515. return window._vrEnabled
  22516. },
  22517. set: function(e) {
  22518. (e = !!e) ? (i.renderer = i.newRenderer,
  22519. window.vrMarkers.forEach(function(e) {
  22520. e.visible = !0
  22521. })) : (i.renderer = i.oldRenderer,
  22522. window.vrMarkers.forEach(function(e) {
  22523. e.visible = !1
  22524. })),
  22525. i.cursor.visible = e,
  22526. i.setSize(window.innerWidth, window.innerHeight),
  22527. window._vrEnabled = e,
  22528. setTimeout(function() {
  22529. console.log(player.cameraControls.activeControl.camera.fov)
  22530. }, 500)
  22531. }
  22532. }),
  22533. this.createCursor(.5, !1, 1, 16777215, 0);
  22534. var e = {
  22535. setSize: function(e, t) {
  22536. i.camera.aspect = e / t
  22537. }
  22538. };
  22539. this.resizeListeners.push(e),
  22540. this.vrLoadingInit()
  22541. }
  22542. ,
  22543. h.prototype.vrLoadingInit = function() {
  22544. var e = new (e = function() {
  22545. var t = this
  22546. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  22547. , i = new M.MeshBasicMaterial({
  22548. color: 4967932,
  22549. side: M.DoubleSide
  22550. })
  22551. , n = new M.Mesh(e,i);
  22552. (this.mesh = n).position.z = -2,
  22553. n.scale.set(.08, .08, .08),
  22554. n.visible = !1,
  22555. window.player.camera.add(n),
  22556. t.enabled = !1,
  22557. this.update = function(e) {
  22558. 1 == t.enabled && (n.rotation.z += 15 * e)
  22559. }
  22560. }
  22561. )(this.camera);
  22562. window.Loading = e,
  22563. this.updateListeners.push(e)
  22564. }
  22565. ,
  22566. h.prototype.createCursor = function(e, t, i, n, r) {
  22567. var o, a = new M.SpriteMaterial({
  22568. opacity: i,
  22569. color: n,
  22570. transparent: t,
  22571. map: this.boluoGetTexture("images/cursor.png"),
  22572. needsUpdate: !0,
  22573. side: M.DoubleSide
  22574. });
  22575. a.map.offset = new M.Vector2(1 / 17 * r,0),
  22576. a.map.repeat = new M.Vector2(1 / 17,1),
  22577. a.depthTest = !1,
  22578. a.blending = M.AdditiveBlending,
  22579. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  22580. o.position.z = -2,
  22581. o.visible = !1,
  22582. o.name = "cursor",
  22583. this.camera.add(o),
  22584. this.scene.add(this.camera),
  22585. this.cursor = o;
  22586. var s = new this.CursorAnimation(this.scene,o,this.camera);
  22587. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  22588. this.updateListeners.push(s)
  22589. }
  22590. ,
  22591. h.prototype.CursorAnimation = function(e, t, o) {
  22592. this.cursor = t,
  22593. this.raycaster = new M.Raycaster,
  22594. this.targetEventObj = {},
  22595. this.type = 1,
  22596. this.tweenFlag = !0;
  22597. var s = this;
  22598. this.target = o,
  22599. console.log(o.uuid),
  22600. this.euler = new M.Euler,
  22601. this.q0 = new M.Quaternion,
  22602. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  22603. this.zee = new M.Vector3(0,0,1),
  22604. this.alpha = -1e3,
  22605. this.beta = -1e3,
  22606. this.gamma = -1e3,
  22607. this.orient = M.Math.degToRad(window.orientation || 0),
  22608. window.addEventListener("orientationchange", function() {
  22609. s.orient = M.Math.degToRad(window.orientation || 0)
  22610. }),
  22611. window.addEventListener("deviceorientation", function(e) {
  22612. var t = M.Math.degToRad(e.alpha)
  22613. , i = M.Math.degToRad(e.beta)
  22614. , n = M.Math.degToRad(e.gamma);
  22615. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  22616. -1e3 === s.beta && (s.beta = i),
  22617. -1e3 === s.gamma && (s.gamma = n),
  22618. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  22619. .006 < Math.abs(i - s.beta) && (s.beta = i),
  22620. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  22621. s.beta = i,
  22622. s.gamma = n),
  22623. h.vrDebug) {
  22624. $("#info-device-orientation").css("display", "block");
  22625. var r = "";
  22626. r += "alpha=(" + s.alpha + ")<BR/>",
  22627. r += "beta=(" + s.beta + ")<BR/>",
  22628. r += "gamma=" + s.gamma + "<BR/>",
  22629. document.getElementById("info-device-orientation").innerHTML = r
  22630. }
  22631. }),
  22632. this.setObjectQuaternion = function(e, t, i, n, r) {
  22633. s.euler.set(i, t, -n, "YXZ"),
  22634. e.setFromEuler(s.euler),
  22635. e.multiply(s.q1),
  22636. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  22637. o.updateMatrixWorld()
  22638. }
  22639. ,
  22640. parent !== window && window.addEventListener("message", function(e) {
  22641. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  22642. o && o.alpha && o.beta && o.gamma && (t = a,
  22643. i = M.Math.degToRad(o.alpha),
  22644. n = M.Math.degToRad(o.beta),
  22645. r = M.Math.degToRad(o.gamma),
  22646. t ? (-1e3 === s.alpha && (s.alpha = i),
  22647. -1e3 === s.beta && (s.beta = n),
  22648. -1e3 === s.gamma && (s.gamma = r),
  22649. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  22650. .006 < Math.abs(n - s.beta) && (s.beta = n),
  22651. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  22652. s.beta = n,
  22653. s.gamma = r))
  22654. }),
  22655. this.update = function(e) {
  22656. TWEEN.update(),
  22657. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  22658. this.triggerTargetEvent())
  22659. }
  22660. ,
  22661. this.triggerTargetEvent = function() {
  22662. var e = this.choseObj()
  22663. , t = e ? e.object : void 0;
  22664. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  22665. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  22666. t && t.enabled && this.startAnimate(function() {
  22667. this.clickCallback(t)
  22668. }
  22669. .bind(this))) : this.type,
  22670. this.targetEventObj.lastObj = t)
  22671. }
  22672. ,
  22673. this.choseObj = function() {
  22674. this.raycaster.setFromCamera({
  22675. x: 0,
  22676. y: 0
  22677. }, o);
  22678. var e = (this.raycaster.ray,
  22679. window.vrMarkers)
  22680. , t = this.raycaster.intersectObjects(e);
  22681. if (0 < t.length)
  22682. return t[0]
  22683. }
  22684. ,
  22685. this.clickCallback = function(e) {
  22686. this.runTHREEAction(e, "onclick")
  22687. }
  22688. ,
  22689. this.runTHREEAction = function(e, t) {
  22690. switch (t) {
  22691. case "onclick":
  22692. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  22693. e()
  22694. });
  22695. break;
  22696. case "onhover":
  22697. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  22698. e()
  22699. });
  22700. break;
  22701. case "onout":
  22702. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  22703. e()
  22704. })
  22705. }
  22706. }
  22707. ,
  22708. this.startAnimate = function(e) {
  22709. this.tweenFlag && this.initAnimation(e)
  22710. }
  22711. ,
  22712. this.initAnimation = function(e) {
  22713. var t = this
  22714. , i = this.cursor.material.map.offset;
  22715. t.tweenFlag = !1,
  22716. this.cursorAnimate = new TWEEN.Tween(i).to({
  22717. x: 1
  22718. }, 1e3).onStart(function() {
  22719. t.tweenFlag = !1
  22720. }).onStop(function() {
  22721. t.tweenFlag = !0,
  22722. this.x = 0,
  22723. i.x = 0
  22724. }).onUpdate(function() {}).onComplete(function() {
  22725. e(),
  22726. i.x = 0,
  22727. setTimeout(function() {
  22728. t.tweenFlag = !0
  22729. }, 1500)
  22730. }),
  22731. this.cursorAnimate.easing(function(e) {
  22732. return Math.floor(17 * e) / 17
  22733. }),
  22734. this.cursorAnimate.start()
  22735. }
  22736. ,
  22737. this.autoCursorPosition = function(e) {
  22738. this.cursor.scale.set(.3, .3, .3)
  22739. }
  22740. }
  22741. ,
  22742. h.prototype.vrRenderer = function(a, i, e) {
  22743. var s = new i.vrCamera(e);
  22744. s.bananaAspect = .8,
  22745. this.width,
  22746. this.height;
  22747. i = this;
  22748. this.setSize = function(e, t) {
  22749. a.setSize.call(this, e, t),
  22750. i.width = e,
  22751. i.height = t
  22752. }
  22753. ,
  22754. this.render = function(e, t, i, n) {
  22755. var r, o;
  22756. if (window.cameraQua = t.quaternion.clone(),
  22757. t.__RESS__SKIP__STEREO__)
  22758. return a.render(e, t, i, n);
  22759. if ("PerspectiveCamera" === t.type)
  22760. r = s.cameraL,
  22761. o = s.cameraR,
  22762. e.updateMatrixWorld(),
  22763. null === t.parent && t.updateMatrixWorld(),
  22764. s.vrCameraUpdate(t);
  22765. else {
  22766. if ("OrthographicCamera" !== t.type)
  22767. return DEBUG && console.error("Unsupported renderer: ", t.type);
  22768. r = o = t
  22769. }
  22770. a.setScissorTest(!0),
  22771. a.setScissor(0, 0, this.width / 2, this.height),
  22772. a.setViewport(0, 0, this.width / 2, this.height),
  22773. a.render.call(this, e, r, i, n),
  22774. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  22775. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  22776. a.render.call(this, e, o, i, n),
  22777. a.setScissorTest(!1)
  22778. }
  22779. ,
  22780. this.__proto__ = {
  22781. __proto__: a
  22782. }
  22783. }
  22784. ,
  22785. h.prototype.vrCamera = function(e) {
  22786. this.type = "StereoCamera",
  22787. this._aspect = 1,
  22788. this._overlap = .064,
  22789. this.cameraL = new M.PerspectiveCamera,
  22790. this.cameraL.layers.enable(1),
  22791. this.cameraL.matrixAutoUpdate = !1,
  22792. this.cameraR = new M.PerspectiveCamera,
  22793. this.cameraR.layers.enable(2),
  22794. this.cameraR.matrixAutoUpdate = !1,
  22795. this.eyeRight = new M.Matrix4,
  22796. this.eyeLeft = new M.Matrix4,
  22797. this.vrCameraNeedsUpdate = !0,
  22798. window.vrCameraL = this.cameraL,
  22799. Object.defineProperty(this, "bananaAspect", {
  22800. get: function() {
  22801. return this._aspect
  22802. },
  22803. set: function(e) {
  22804. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  22805. this._aspect = e
  22806. }
  22807. }),
  22808. Object.defineProperty(this, "overlap", {
  22809. get: function() {
  22810. return this._overlap
  22811. },
  22812. set: function(e) {
  22813. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  22814. this._overlap = e
  22815. }
  22816. }),
  22817. this.vrCameraUpdate = function(e) {
  22818. if (this.vrCameraNeedsUpdate = !0,
  22819. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  22820. this.vrCameraNeedsUpdate) {
  22821. this.vrCameraNeedsUpdate = !1,
  22822. console.debug("vrCameraUpdate"),
  22823. this.bananaFocus = e.focus,
  22824. this.bananaFov = e.fov,
  22825. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  22826. this.bananaNear = e.near,
  22827. this.bananaFar = e.far,
  22828. console.debug(e.aspect),
  22829. this.bananaFocus = 10;
  22830. 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);
  22831. this.eyeLeft.elements[12] = -r,
  22832. this.eyeRight.elements[12] = r,
  22833. t = -a * this.bananaReal_aspect + o,
  22834. i = a * this.bananaReal_aspect + o,
  22835. n.elements[0] = 2 * this.bananaNear / (i - t),
  22836. n.elements[8] = (i + t) / (i - t),
  22837. this.cameraL.projectionMatrix.copy(n),
  22838. t = -a * this.bananaReal_aspect - o,
  22839. i = a * this.bananaReal_aspect - o,
  22840. n.elements[0] = 2 * this.bananaNear / (i - t),
  22841. n.elements[8] = (i + t) / (i - t),
  22842. this.cameraR.projectionMatrix.copy(n)
  22843. }
  22844. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  22845. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  22846. }
  22847. }
  22848. ,
  22849. h.prototype.boluoGetTexture = function(e) {
  22850. var t = new M.TextureLoader;
  22851. return t.crossOrigin = "anonymous",
  22852. t.load(e)
  22853. }
  22854. ,
  22855. h.prototype.updateScreenSize = function(e) {
  22856. var t, i, n, r = !1;
  22857. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  22858. n = e.height,
  22859. r = !0,
  22860. t = 1) : (i = $("#player").width(),
  22861. n = $("#player").height(),
  22862. e && e.resize && (o = this.renderWidth,
  22863. a = this.renderHeight),
  22864. i === o && n === a && !this.forceUpdateSize || (o = i,
  22865. a = n,
  22866. r = !0,
  22867. t = window.devicePixelRatio)),
  22868. r && (this.setSize(i, n, t),
  22869. this.forceUpdateSize = !1)
  22870. }
  22871. ,
  22872. h.prototype.updateComponents = function() {
  22873. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  22874. this.updateListeners[t].update(e)
  22875. }
  22876. ,
  22877. h.prototype.suspend = function() {
  22878. this.started = !1,
  22879. this.suspendedObjects = this.scene.children.map(function(e) {
  22880. return this.scene.remove(e),
  22881. e
  22882. }
  22883. .bind(this)),
  22884. this.render()
  22885. }
  22886. ,
  22887. h.prototype.resume = function() {
  22888. this.suspendedObjects.forEach(function(e) {
  22889. this.scene.add(e)
  22890. }
  22891. .bind(this)),
  22892. this.suspendedObjects = [],
  22893. this.started = !0,
  22894. b()
  22895. }
  22896. ;
  22897. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  22898. this.started && (window.requestAnimationFrame(b),
  22899. this.updateScreenSize(),
  22900. this.updateComponents(),
  22901. this.updateTextureMemory(),
  22902. this.render(),
  22903. this.emit(r.AfterRender))
  22904. };
  22905. h.prototype.getImageData = (E = document.createElement("canvas"),
  22906. _ = E.getContext("2d"),
  22907. function(e, t, i) {
  22908. return E.width === t && E.height === i || (E.width = t,
  22909. E.height = i),
  22910. _.drawImage(e, 0, 0, t, i),
  22911. _.getImageData(0, 0, t, i)
  22912. }
  22913. ),
  22914. h.prototype.initSizedTexture2D = function(e, t, i) {
  22915. var n = this.renderer
  22916. , r = n.context
  22917. , o = n.state
  22918. , a = new M.Texture(null);
  22919. !(a.flipY = !1) !== i && (i = !1),
  22920. a.generateMipmaps = i;
  22921. var s = n.paramThreeToGL(a.format)
  22922. , l = n.paramThreeToGL(a.type)
  22923. , c = n.properties.get(a)
  22924. , h = r.createTexture();
  22925. o.bindTexture(r.TEXTURE_2D, h),
  22926. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  22927. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  22928. a.wrapS = t,
  22929. a.wrapT = t;
  22930. var u = n.paramThreeToGL(t);
  22931. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  22932. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  22933. i ? (a.magFilter = M.LinearFilter,
  22934. a.minFilter = M.LinearMipMapLinearFilter,
  22935. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  22936. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  22937. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  22938. a.minFilter = M.LinearFilter,
  22939. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  22940. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  22941. o.bindTexture(r.TEXTURE_2D, null),
  22942. c.__webglTexture = h,
  22943. a
  22944. }
  22945. ,
  22946. h.prototype.initSizedCubeMap = function(e, t) {
  22947. var i = this.renderer
  22948. , n = i.context
  22949. , r = i.state
  22950. , o = new M.CubeTexture([null, null, null, null, null, null]);
  22951. o.flipY = !1,
  22952. o.generateMipmaps = t;
  22953. var a = i.paramThreeToGL(o.format)
  22954. , s = i.paramThreeToGL(o.type)
  22955. , l = i.properties.get(o)
  22956. , c = n.createTexture();
  22957. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  22958. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  22959. for (var h = 0; h < 6; h++)
  22960. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  22961. return t ? (o.magFilter = M.LinearFilter,
  22962. o.minFilter = M.LinearMipMapLinearFilter,
  22963. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  22964. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  22965. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  22966. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  22967. o.minFilter = M.LinearFilter,
  22968. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  22969. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  22970. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  22971. l.__image__webglTextureCube = c,
  22972. o
  22973. }
  22974. ,
  22975. h.prototype.deallocateCubeTexture = function(e) {
  22976. var t = this.renderer
  22977. , i = t.context
  22978. , n = t.properties.get(e);
  22979. i.deleteTexture(n.__image__webglTextureCube)
  22980. }
  22981. ,
  22982. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  22983. var a = this.renderer
  22984. , s = a.context
  22985. , l = a.state
  22986. , c = a.properties.get(t);
  22987. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  22988. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  22989. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  22990. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  22991. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  22992. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  22993. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  22994. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  22995. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  22996. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  22997. l.bindTexture(s.TEXTURE_2D, null)
  22998. }
  22999. ,
  23000. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23001. var s = this.renderer
  23002. , l = s.context
  23003. , c = s.state
  23004. , h = s.properties.get(t);
  23005. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23006. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23007. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23008. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23009. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23010. }
  23011. ,
  23012. h.prototype.rebuildMipMaps2D = function(e) {
  23013. var t = this.renderer
  23014. , i = t.context
  23015. , n = t.state;
  23016. t.properties.get(e),
  23017. i.generateMipmap(i.TEXTURE_2D),
  23018. n.bindTexture(i.TEXTURE_2D, null)
  23019. }
  23020. ,
  23021. h.prototype.rebuildMipMaps3D = function(e) {
  23022. var t = this.renderer
  23023. , i = t.context
  23024. , n = t.state
  23025. , r = t.properties.get(e);
  23026. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23027. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23028. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23029. }
  23030. ,
  23031. h.prototype.renderToCubeMap = (P = !1,
  23032. F = N = D = L = O = null,
  23033. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23034. this.renderer.context,
  23035. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23036. (O = new M.Scene).add(L),
  23037. D = new M.ShaderMaterial({
  23038. uniforms: {
  23039. tDiffuse: {
  23040. type: "t",
  23041. value: null
  23042. },
  23043. alpha: {
  23044. type: "f",
  23045. value: 1
  23046. }
  23047. },
  23048. vertexShader: R.basicTextured.vertexShader,
  23049. fragmentShader: R.basicTextured.fragmentShader,
  23050. depthWrite: !1,
  23051. depthTest: !1,
  23052. side: M.DoubleSide
  23053. }),
  23054. N = new M.PlaneBufferGeometry(1,1),
  23055. (F = new M.Mesh(N,D)).position.z = 0,
  23056. O.add(F),
  23057. P = !0);
  23058. var m = N.getAttribute("uv");
  23059. m.setDynamic(!0),
  23060. m.needsUpdate = !0;
  23061. var v = m.array
  23062. , y = r / i
  23063. , A = o / n
  23064. , C = a / i
  23065. , I = s / n;
  23066. v[0] = y,
  23067. v[1] = A + I,
  23068. v[2] = y + C,
  23069. v[3] = A + I,
  23070. v[4] = y,
  23071. v[5] = A,
  23072. v[6] = y + C,
  23073. v[7] = A;
  23074. var E = N.getAttribute("position");
  23075. E.setDynamic(!0),
  23076. E.needsUpdate = !0;
  23077. var _ = E.array
  23078. , b = l / t.width - .5
  23079. , w = c / t.height - .5
  23080. , T = h / t.width
  23081. , x = u / t.height;
  23082. _[0] = b,
  23083. _[1] = w + x,
  23084. _[3] = b + T,
  23085. _[4] = w + x,
  23086. _[6] = b,
  23087. _[7] = w,
  23088. _[9] = b + T,
  23089. _[10] = w,
  23090. this.renderer.properties.get(e),
  23091. D.uniforms.tDiffuse.value = e,
  23092. D.blending = p || M.NoBlending,
  23093. D.transparent = !!f,
  23094. null != g || (g = 1),
  23095. D.uniforms.alpha.value = g,
  23096. D.needUpdate = !0,
  23097. t.activeCubeFace = d,
  23098. t.viewport.set(0, 0, t.width, t.height);
  23099. var S = this.renderer.autoClear;
  23100. this.renderer.autoClear = !1,
  23101. this.renderer.render(O, L, t, !1),
  23102. this.renderer.autoClear = S
  23103. }
  23104. ),
  23105. h.prototype.copyCubeMap = (g = !1,
  23106. C = A = y = v = m = null,
  23107. I = new M.Euler,
  23108. new M.Vector3,
  23109. function(e, t, i, n, r, o, a, s, l) {
  23110. this.renderer,
  23111. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23112. (m = new M.Scene).add(v),
  23113. y = new M.ShaderMaterial({
  23114. uniforms: {
  23115. tDiffuse: {
  23116. type: "t",
  23117. value: null
  23118. },
  23119. alpha: {
  23120. type: "f",
  23121. value: 1
  23122. }
  23123. },
  23124. vertexShader: R.copyCubeMap.vertexShader,
  23125. fragmentShader: R.copyCubeMap.fragmentShader,
  23126. depthWrite: !1,
  23127. depthTest: !1,
  23128. side: M.DoubleSide
  23129. }),
  23130. A = new M.BoxGeometry(2,2,2),
  23131. C = new M.Mesh(A,y),
  23132. m.add(C),
  23133. g = !0);
  23134. for (var c = 0; c < 6; c++)
  23135. h.getCubeOrientationForCubeFace(c, I),
  23136. C.rotation.copy(I),
  23137. C.matrixWorldNeedsUpdate = !0,
  23138. C.updateMatrixWorld(),
  23139. y.uniforms.tDiffuse.value = e,
  23140. y.blending = a || M.NoBlending,
  23141. y.transparent = !!s,
  23142. null != l || (l = 1),
  23143. y.uniforms.alpha.value = l,
  23144. y.needUpdate = !0,
  23145. t.activeCubeFace = c,
  23146. t.viewport.set(0, 0, r, o),
  23147. this.renderer.render(m, v, t, !1)
  23148. }
  23149. ),
  23150. h.getLookAtForCubeFace = function(e, t) {
  23151. switch (e) {
  23152. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23153. t.set(1, 0, 0);
  23154. break;
  23155. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23156. t.set(-1, 0, 0);
  23157. break;
  23158. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23159. t.set(0, 1, 0);
  23160. break;
  23161. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23162. t.set(0, -1, 0);
  23163. break;
  23164. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23165. t.set(0, 0, 1);
  23166. break;
  23167. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23168. t.set(0, 0, -1)
  23169. }
  23170. }
  23171. ,
  23172. h.getCubeOrientationForCubeFace = function(e, t) {
  23173. switch (e) {
  23174. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23175. t.set(0, -Math.PI / 2, 0);
  23176. break;
  23177. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23178. t.set(0, Math.PI / 2, 0);
  23179. break;
  23180. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23181. t.set(Math.PI / 2, Math.PI, 0);
  23182. break;
  23183. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23184. t.set(-Math.PI / 2, Math.PI, 0);
  23185. break;
  23186. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23187. t.set(0, -Math.PI, 0);
  23188. break;
  23189. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23190. t.set(0, 0, 0)
  23191. }
  23192. }
  23193. ,
  23194. t.exports = h
  23195. }
  23196. , {
  23197. "../enum/GLCubeFaces": 25,
  23198. "../enum/GLTextureType": 26,
  23199. "../enum/SceneRendererEvents": 43,
  23200. "../exception/BasicException": 55,
  23201. "../exception/RendererCreationException": 57,
  23202. "../settings": 166,
  23203. "../shaders": 167,
  23204. "../util/browser": 182,
  23205. events: 202,
  23206. three: 217
  23207. }],
  23208. 159: [function(e, t, i) {
  23209. "use strict";
  23210. function n(e) {
  23211. this.messenger = new a(e),
  23212. this.clientKey = null
  23213. }
  23214. var o = e("../util/ajax")
  23215. , r = e("./PostMessageType")
  23216. , a = e("./postmessage")
  23217. , s = e("./VersionInfo")
  23218. , l = e("events").EventEmitter
  23219. , c = window.location.origin + "/api/v1/user/";
  23220. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  23221. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23222. }
  23223. ,
  23224. n.prototype.waitForConnection = function() {
  23225. return new Promise(function(t, i) {
  23226. this.messenger.on(r.CONNECT, function(e) {
  23227. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23228. }
  23229. .bind(this))
  23230. }
  23231. .bind(this))
  23232. }
  23233. ,
  23234. n.prototype.onConnectionReceived = function(i) {
  23235. return this.messenger.setTarget(i.source, i.origin),
  23236. this.verifyConnection(i).then(function(e, t) {
  23237. this.messenger.send({
  23238. type: r.ACCEPT,
  23239. toId: i.fromId,
  23240. warning: t
  23241. }),
  23242. this.clientKey = e,
  23243. this.messenger.removeAllListeners(r.CONNECT),
  23244. this.bindEvents()
  23245. }
  23246. .bind(this), function(e) {
  23247. this.messenger.send({
  23248. type: r.REJECT,
  23249. toId: i.fromId,
  23250. reason: e
  23251. }),
  23252. this.messenger.setTarget()
  23253. }
  23254. .bind(this))
  23255. }
  23256. ,
  23257. n.prototype.verifyConnection = function(r) {
  23258. return new Promise(function(e, t) {
  23259. var i;
  23260. if (s.isDeprecated(r.sdkVersion))
  23261. i = "这个版本正在被弃用";
  23262. else if (!s.isSupported(r.sdkVersion))
  23263. return t("不支持此版本的SDK");
  23264. var n = {
  23265. cache: !1,
  23266. headers: {
  23267. "X-port-Application-Key": r.applicationKey,
  23268. "X-port-Referrer": r.origin
  23269. }
  23270. };
  23271. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  23272. }
  23273. )
  23274. }
  23275. ,
  23276. n.prototype.onMessageReceived = function(t) {
  23277. if (this.validateClientApplicationKey(t.applicationKey)) {
  23278. var i = this;
  23279. t.onDone = function(e) {
  23280. e.toId = t.fromId,
  23281. e.uid = t.uid,
  23282. e.type = r.RESPONSE,
  23283. i.messenger.send(e)
  23284. }
  23285. ,
  23286. this.emit(r.ACTION, t)
  23287. }
  23288. }
  23289. ,
  23290. n.prototype.validateClientApplicationKey = function(e) {
  23291. return this.clientKey === e
  23292. }
  23293. ,
  23294. n.prototype.sendEvent = function(e, t) {
  23295. this.messenger.send({
  23296. type: r.EVENT,
  23297. eventType: e,
  23298. eventData: t
  23299. })
  23300. }
  23301. ,
  23302. t.exports = n
  23303. }
  23304. , {
  23305. "../util/ajax": 181,
  23306. "./PostMessageType": 160,
  23307. "./VersionInfo": 163,
  23308. "./postmessage": 165,
  23309. events: 202
  23310. }],
  23311. 160: [function(e, t, i) {
  23312. "use strict";
  23313. t.exports = Object.freeze({
  23314. CONNECT: "postmessage.connect",
  23315. ACCEPT: "postmessage.accept",
  23316. REJECT: "postmessage.reject",
  23317. ACTION: "postmessage.action",
  23318. RESPONSE: "postmessage.response",
  23319. EVENT: "postmessage.event"
  23320. })
  23321. }
  23322. , {}],
  23323. 161: [function(e, t, i) {
  23324. "use strict";
  23325. t.exports = Object.freeze({
  23326. MOVE: "sdk.move",
  23327. ENTER_PANO: "sdk.enterpano",
  23328. MODEL_LOADED: "sdk.modelloaded"
  23329. })
  23330. }
  23331. , {}],
  23332. 162: [function(e, t, i) {
  23333. "use strict";
  23334. t.exports = Object.freeze({
  23335. FLY: "transition.fly",
  23336. FADEOUT: "transition.fade",
  23337. INSTANT: "transition.instant"
  23338. })
  23339. }
  23340. , {}],
  23341. 163: [function(e, t, i) {
  23342. "use strict";
  23343. t.exports = {
  23344. current: "1.0",
  23345. supported: ["1.0"],
  23346. deprecated: [],
  23347. isSupported: function(e) {
  23348. return -1 !== this.supported.indexOf(e)
  23349. },
  23350. isDeprecated: function(e) {
  23351. return -1 !== this.deprecated.indexOf(e)
  23352. },
  23353. isValid: function(e) {
  23354. return this.isSupported(e) || this.isDeprecated(e)
  23355. }
  23356. }
  23357. }
  23358. , {}],
  23359. 164: [function(q, X, e) {
  23360. (function(e) {
  23361. "use strict";
  23362. function r(e, t, i) {
  23363. e = e && e.toLowerCase().trim();
  23364. var n = new C.UP.clone
  23365. , r = Math.PI / 3
  23366. , o = Math.PI / 2;
  23367. switch (e) {
  23368. case "left":
  23369. i.copy(t),
  23370. i.applyAxisAngle(n, o);
  23371. break;
  23372. case "right":
  23373. i.copy(t),
  23374. i.applyAxisAngle(n, -o);
  23375. break;
  23376. case "forwardleft":
  23377. i.copy(t),
  23378. i.applyAxisAngle(n, r);
  23379. break;
  23380. case "forwardright":
  23381. i.copy(t),
  23382. i.applyAxisAngle(n, -r);
  23383. break;
  23384. case "forward":
  23385. default:
  23386. i.copy(t)
  23387. }
  23388. return i
  23389. }
  23390. function o(e, t) {
  23391. if (e) {
  23392. var i = {
  23393. pano: e,
  23394. lookAtPoint: null,
  23395. duration: null,
  23396. maxDistanceOverride: null,
  23397. skipWarpingCheck: !1
  23398. };
  23399. this.player.flyToPano(i, function() {
  23400. t && t({
  23401. success: !0,
  23402. message: "Transition complete."
  23403. })
  23404. })
  23405. } else
  23406. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23407. t && t({
  23408. success: !1,
  23409. error: "Unable to find pano."
  23410. })
  23411. }
  23412. function a(e, t) {
  23413. t.copy(C.FORWARD),
  23414. e.getDirection(t)
  23415. }
  23416. function c(i) {
  23417. return {
  23418. panos: i.panos.list.map(function(e) {
  23419. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23420. return {
  23421. uuid: e.id,
  23422. aligned: e.alignmentType === g.ALIGNED,
  23423. neighbourUUIDs: e.neighbourUUIDs.slice(),
  23424. position: function(e) {
  23425. return e.alignmentType !== g.ALIGNED ? null : {
  23426. x: e.position.x,
  23427. y: e.position.y,
  23428. z: e.position.z
  23429. }
  23430. }(e),
  23431. rotation: function(e) {
  23432. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23433. return {
  23434. x: h.Math.radToDeg(t._x),
  23435. y: h.Math.radToDeg(t._y),
  23436. z: h.Math.radToDeg(t._z)
  23437. }
  23438. }(e),
  23439. thumbnail: t
  23440. }
  23441. })
  23442. }
  23443. }
  23444. 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"),
  23445. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  23446. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  23447. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  23448. N.angle = 0,
  23449. N.angleTravelled = 0,
  23450. N.playerDirection = new h.Vector3,
  23451. N.lastFacingDirection = new h.Vector3,
  23452. N.onDone = null,
  23453. N.player = null,
  23454. N.start = function(e, t, i, n) {
  23455. N.active = !0,
  23456. e && t && (t = 0),
  23457. N.angle = e || t,
  23458. N.xAngle = e,
  23459. N.yAngle = t,
  23460. N.angleTravelled = 0,
  23461. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23462. i.getDirection(N.playerDirection),
  23463. N.lastFacingDirection.copy(N.playerDirection),
  23464. N.projectVectors(),
  23465. N.onDone = n,
  23466. N.player = i,
  23467. N()
  23468. }
  23469. ,
  23470. N.projectVectors = function() {
  23471. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  23472. N.lastFacingDirection.projectOnPlane(C.UP))
  23473. }
  23474. ,
  23475. N), P = (i = new h.Vector3,
  23476. function(e) {
  23477. e ? (i.copy(e.position),
  23478. i.add(e.discPosition),
  23479. s.projectPositionToCanvas(i, this.player.camera, i),
  23480. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  23481. }
  23482. ), O = (l = new h.Vector3,
  23483. function(e) {
  23484. var t = this.player.getDirection();
  23485. l.copy(t);
  23486. var i = l.y;
  23487. l.y = 0,
  23488. l.normalize();
  23489. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  23490. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  23491. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23492. 0;
  23493. this.player.mode === I.DOLLHOUSE && (n = -n);
  23494. var r = function() {
  23495. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  23496. }
  23497. .call(this) - .1
  23498. , o = function() {
  23499. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  23500. }
  23501. .call(this) + .1
  23502. , a = n + e;
  23503. r < a ? a = r : a < o && (a = o);
  23504. var s = a - n;
  23505. return 0 < e && s < .01 && (s = 0),
  23506. e < 0 && -.01 < s && (s = 0),
  23507. s
  23508. }
  23509. ), L = (t = new h.Euler,
  23510. function(e) {
  23511. return t.setFromQuaternion(e.quaternion, "YXZ"),
  23512. {
  23513. position: {
  23514. x: e.position.x,
  23515. y: e.position.y,
  23516. z: e.position.z
  23517. },
  23518. rotation: {
  23519. x: h.Math.radToDeg(t.x),
  23520. y: h.Math.radToDeg(t.y),
  23521. z: 0
  23522. },
  23523. pano: e.currentPano ? e.currentPano.id : null,
  23524. mode: e.mode
  23525. }
  23526. }
  23527. ), D = null;
  23528. function N() {
  23529. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23530. N.player.getDirection(N.playerDirection),
  23531. N.projectVectors();
  23532. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  23533. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  23534. N.onDone && (0,
  23535. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  23536. window.setTimeout(N, 4))
  23537. }
  23538. X.exports = {
  23539. init: function(e, t, i, n, r) {
  23540. Y.init(e, t, i, r),
  23541. D = new Promise(function(e, t) {
  23542. i.on(_.Ready, function() {
  23543. e()
  23544. })
  23545. }
  23546. .bind(this));
  23547. var o = new u(window)
  23548. , a = o.waitForConnection();
  23549. a.then(function(e) {
  23550. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  23551. });
  23552. var s, l = (s = Date.now(),
  23553. function() {
  23554. if (!(Date.now() - s < 100)) {
  23555. var e = L(i);
  23556. o.sendEvent(b.MOVE, {
  23557. state: e
  23558. }),
  23559. s = Date.now()
  23560. }
  23561. }
  23562. );
  23563. i.on(_.Move, l),
  23564. i.on(_.ViewChanged, l),
  23565. n.on(p.ActiveModelChanged, function(e) {
  23566. function t(e) {
  23567. var t, i = e.newPano.id;
  23568. e.oldPano && (t = e.oldPano.id),
  23569. i !== t && o.sendEvent(b.ENTER_PANO, {
  23570. oldPano: t,
  23571. newPano: i
  23572. })
  23573. }
  23574. var i = e.model
  23575. , n = e.oldModel;
  23576. Y.model = i,
  23577. a.then(function() {
  23578. o.sendEvent(b.MODEL_LOADED, {
  23579. metadata: c(i)
  23580. })
  23581. }),
  23582. n && n.panos.forEach(function(e) {
  23583. e.removeEventListener("enter", t)
  23584. }),
  23585. i.panos.forEach(function(e) {
  23586. e.on("enter", t)
  23587. })
  23588. })
  23589. }
  23590. };
  23591. var F, B, V, k, U, H, z, G, W, j, Y = {
  23592. director: null,
  23593. player: null,
  23594. controls: null,
  23595. sceneRenderer: null,
  23596. model: null,
  23597. init: function(e, t, i, n) {
  23598. this.director = e,
  23599. this.player = i,
  23600. this.controls = t,
  23601. this.sceneRenderer = n
  23602. },
  23603. handleToObject: {},
  23604. objectToHandle: {},
  23605. handleCount: 0,
  23606. onMessageReceive: function(e) {
  23607. if (e) {
  23608. var t = e.targetFunction
  23609. , i = e.params
  23610. , n = e.onDone;
  23611. t && this[t] && this[t](i, n)
  23612. }
  23613. },
  23614. waitForInit: function(e, t) {
  23615. D.then(t.bind({
  23616. success: !0,
  23617. message: "Init complete."
  23618. }))
  23619. },
  23620. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  23621. j = new h.Quaternion,
  23622. function(e, t) {
  23623. var i = e.pano
  23624. , n = e.rotation
  23625. , r = e.transition;
  23626. if (!this.model)
  23627. return t({
  23628. success: !1,
  23629. error: "The model has not been loaded yet"
  23630. });
  23631. var o = this.model.panos.get(i);
  23632. if (!o)
  23633. return t({
  23634. success: !1,
  23635. error: i + " does not exist in this model"
  23636. });
  23637. if (!n)
  23638. return t({
  23639. sucess: !1,
  23640. erorr: n + " is not a valid rotation"
  23641. });
  23642. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  23643. console.log(n.z);
  23644. var a = {
  23645. success: !0,
  23646. message: i
  23647. };
  23648. if (r === v.FADEOUT)
  23649. j.setFromEuler(W),
  23650. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  23651. else {
  23652. var s, l;
  23653. r === v.INSTANT && (l = s = 0);
  23654. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  23655. this.player.flyToPano({
  23656. pano: o,
  23657. lookAtPoint: c,
  23658. duration: s,
  23659. aimDuration: l
  23660. }, t.bind(this, a))
  23661. }
  23662. }
  23663. ),
  23664. moveInDirection: function(e, t) {
  23665. var i = e.direction;
  23666. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  23667. void (t && t({
  23668. success: !1,
  23669. error: "Invalid direction."
  23670. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  23671. t(e ? {
  23672. success: !0,
  23673. message: "moved " + i
  23674. } : {
  23675. success: !1,
  23676. error: "Cannot move in direction: " + i
  23677. })
  23678. })
  23679. },
  23680. getPose: function(e, t) {
  23681. return this.player.camera.position,
  23682. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  23683. t({
  23684. success: !0,
  23685. message: L(this.player)
  23686. })
  23687. },
  23688. takeScreenShot: (z = new h.PerspectiveCamera,
  23689. G = new h.WebGLRenderTarget,
  23690. function(e, t) {
  23691. if (!e.resolution)
  23692. return t({
  23693. success: !1,
  23694. error: "An invalid resolution was specified"
  23695. });
  23696. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  23697. var i = this.sceneRenderer.renderer.getSize();
  23698. e.resolution.width = i.width,
  23699. e.resolution.height = i.height
  23700. }
  23701. z.layers.set(T.DEFAULT),
  23702. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  23703. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  23704. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  23705. var n = e.resolution.width
  23706. , r = e.resolution.height
  23707. , o = n / r;
  23708. z.position.copy(this.sceneRenderer.camera.position),
  23709. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  23710. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  23711. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  23712. G.setSize(n, r),
  23713. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  23714. var a = new Uint8Array(n * r * 4);
  23715. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  23716. var s = S.encode({
  23717. data: a,
  23718. width: n,
  23719. height: r,
  23720. heading: 180,
  23721. pitch: 0
  23722. }, {
  23723. quality: 75,
  23724. flipY: !0
  23725. });
  23726. t({
  23727. success: !0,
  23728. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  23729. })
  23730. }
  23731. ),
  23732. findRankedPano: (U = new h.Vector3,
  23733. H = new h.Vector3,
  23734. function(e, t) {
  23735. a(this.player, H),
  23736. r(t, H, U);
  23737. var i = this.player.rankedPanoInDirection(e, U);
  23738. if (i) {
  23739. var n = this.objectToHandle[i.id];
  23740. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  23741. this.handleToObject[n] = i),
  23742. n
  23743. }
  23744. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  23745. -1
  23746. }
  23747. ),
  23748. findRankedtag: (V = new h.Vector3,
  23749. k = new h.Vector3,
  23750. function(e, t) {
  23751. a(this.player, k),
  23752. r(t, k, V);
  23753. var i = this.player.rankedtagInDirection(e, V);
  23754. if (i) {
  23755. var n = this.objectToHandle[i.sid];
  23756. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  23757. this.handleToObject[n] = i),
  23758. n
  23759. }
  23760. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  23761. -1
  23762. }
  23763. ),
  23764. clickNearesttag: function(e) {
  23765. this.clickRankedtag(0, e)
  23766. },
  23767. clickRankedtag: function(e, t) {
  23768. var i = function(e, t) {
  23769. var i = this.findRankedtag(e, t);
  23770. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  23771. null)
  23772. }
  23773. .call(this, e, t);
  23774. i && P.call(this, i)
  23775. },
  23776. clickNearestPano: function(e, t) {
  23777. this.clickRankedPano(0, e, t)
  23778. },
  23779. clickRankedPano: function(e, t, i) {
  23780. var n = function(e, t) {
  23781. var i = this.findRankedPano(e, t);
  23782. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  23783. null)
  23784. }
  23785. .call(this, e, t);
  23786. n ? o.call(this, n, i) : i(null)
  23787. },
  23788. clickPano: function(e, t) {
  23789. var i = this.handleTable[e];
  23790. i ? o.call(this, i, t) : t(null)
  23791. },
  23792. rotateDirection: function(e, t) {
  23793. var i = e.direction
  23794. , n = e.angle;
  23795. if (!R.active) {
  23796. var r = 0
  23797. , o = 0
  23798. , a = 0
  23799. , s = 0;
  23800. if (!n || isNaN(n))
  23801. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  23802. void (t && t({
  23803. success: !1,
  23804. error: "Invalid rotation angle."
  23805. }));
  23806. if (this.player.mode === I.TRANSITIONING)
  23807. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  23808. void (t && t({
  23809. success: !1,
  23810. error: "Cannot rotate while transitioning"
  23811. }));
  23812. if (i === m.RIGHT || i === m.LEFT)
  23813. i === m.RIGHT && (n = -n),
  23814. r = 0 < n ? -1 : 1,
  23815. a = n;
  23816. else {
  23817. if (i !== m.UP && i !== m.DOWN)
  23818. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  23819. void (t && t({
  23820. success: !1,
  23821. error: "Invalid direction for rotation."
  23822. }));
  23823. if (this.player.mode === I.FLOORPLAN)
  23824. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  23825. void (t && t({
  23826. success: !1,
  23827. error: "Cannot rotate " + i + " in floorplan mode"
  23828. }));
  23829. if (i === m.DOWN && (n = -n),
  23830. 0 === (n = O.call(this, n)))
  23831. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  23832. void (t && t({
  23833. success: !1,
  23834. error: "Already at maximum rotation in direction: " + i
  23835. }));
  23836. o = 0 < n ? 1 : -1,
  23837. s = n
  23838. }
  23839. var l = n;
  23840. n = h.Math.degToRad(n),
  23841. a = h.Math.degToRad(a),
  23842. s = h.Math.degToRad(s);
  23843. var c = this.controls.activeControl;
  23844. c.startRotating(r, o),
  23845. R.start(a, s, this.player, function() {
  23846. c.stopRotating(!0),
  23847. t && t({
  23848. success: !0,
  23849. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  23850. })
  23851. })
  23852. }
  23853. },
  23854. rotate: (F = new h.Vector3,
  23855. B = new h.Vector3,
  23856. function(e, t) {
  23857. var i = e.xAngle
  23858. , n = e.yAngle;
  23859. if (!R.active) {
  23860. if (i = i || 0,
  23861. n = n || 0,
  23862. isNaN(i) || isNaN(n))
  23863. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  23864. void (t && t({
  23865. success: !1,
  23866. error: "Invalid rotation angle."
  23867. }));
  23868. if (this.player.mode === I.TRANSITIONING)
  23869. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  23870. void (t && t({
  23871. success: !1,
  23872. error: "Cannot rotate while transitioning"
  23873. }));
  23874. Math.abs(i) < .01 && (i = 0),
  23875. Math.abs(n) < .01 && (n = 0);
  23876. var r = n;
  23877. n = O.call(this, n);
  23878. var o = 0 < r ? "UP" : "DOWN";
  23879. if (!(i = -i) && r && !n)
  23880. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  23881. void (t && t({
  23882. success: !1,
  23883. error: "Already at maximum rotation in direction: " + o
  23884. }));
  23885. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  23886. var a = n;
  23887. n = h.Math.degToRad(n),
  23888. i = h.Math.degToRad(i),
  23889. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23890. this.player.getDirection(F),
  23891. B.copy(F).applyAxisAngle(C.UP, i),
  23892. B.applyAxisAngle(C.RIGHT, n);
  23893. var s = (F.angleTo(B),
  23894. 0 < i ? -1 : i < 0 ? 1 : 0)
  23895. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  23896. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  23897. var c = this.controls.activeControl;
  23898. c.startRotating(s, l),
  23899. R.start(i, n, this.player, function() {
  23900. c.stopRotating(!0),
  23901. t && t({
  23902. success: !0,
  23903. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  23904. })
  23905. })
  23906. }
  23907. }
  23908. ),
  23909. panCamera: function(e, i) {
  23910. function t(e) {
  23911. switch (r.removeAllListeners(w.AutoPanComplete),
  23912. r.removeAllListeners(w.AutoPanInterrupt),
  23913. r.removeAllListeners(w.AutoPanClamped),
  23914. e) {
  23915. case w.AutoPanInterrupt:
  23916. i({
  23917. success: !0,
  23918. message: "Camera panning interrupted."
  23919. });
  23920. break;
  23921. case w.AutoPanClamped:
  23922. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  23923. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  23924. return void i({
  23925. success: !1,
  23926. error: "Already at edge of current model bounds."
  23927. });
  23928. var t = "The view point is outside the bounds for the current model. ";
  23929. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  23930. console.warn(t)
  23931. }
  23932. case w.AutoPanComplete:
  23933. i({
  23934. success: !0,
  23935. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  23936. })
  23937. }
  23938. }
  23939. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  23940. return i({
  23941. success: !1,
  23942. error: "Camera panning is not available in the current mode: " + this.player.mode
  23943. });
  23944. var n = e.position
  23945. , r = this.player.control;
  23946. r.setAutoPanPosition(n.x, n.z),
  23947. r.autoPan = !0;
  23948. var o = function(e, t) {
  23949. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  23950. };
  23951. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  23952. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  23953. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  23954. },
  23955. click: function(e, t) {
  23956. var i = e.x
  23957. , n = e.y;
  23958. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  23959. n = n / 100 * $("#player").height()),
  23960. this.player.handleInputStart(i, n),
  23961. this.player.updateIntersect(),
  23962. this.player.handleInputEnd(i, n)
  23963. },
  23964. mouseOver: function(e, t) {
  23965. var i = e.x
  23966. , n = e.y;
  23967. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  23968. n = n / 100 * $("#player").height()),
  23969. this.player.handleInputMove(i, n),
  23970. this.player.updateIntersect()
  23971. },
  23972. moveToMode: function(e, t) {
  23973. function i(e) {
  23974. t(e ? {
  23975. success: !1,
  23976. error: "Failed to load new mode: " + e
  23977. } : {
  23978. success: !0,
  23979. message: "Moved to new mode: " + n
  23980. })
  23981. }
  23982. var n = e.mode;
  23983. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  23984. i()
  23985. }, function(e) {
  23986. i(e)
  23987. }) : t({
  23988. success: !1,
  23989. error: "Invalid mode selection"
  23990. })
  23991. }
  23992. }
  23993. }
  23994. ).call(this, "/js/sdk/automation.js")
  23995. }
  23996. , {
  23997. "../constants": 8,
  23998. "../enum/AlignmentType": 17,
  23999. "../enum/ControlEvents": 21,
  24000. "../enum/Direction": 22,
  24001. "../enum/GLCubeFaces": 25,
  24002. "../enum/Keys": 30,
  24003. "../enum/ModelManagerEvents": 33,
  24004. "../enum/PlayerEvents": 40,
  24005. "../enum/RenderLayers": 41,
  24006. "../enum/Vectors": 50,
  24007. "../enum/Viewmode": 51,
  24008. "../enum/WarpStyle": 52,
  24009. "../lib/jpeg_encoder": 94,
  24010. "../sdk/SdkEvents": 161,
  24011. "../settings": 166,
  24012. "../util/common": 185,
  24013. "../util/logger": 189,
  24014. "../util/math": 190,
  24015. "../util/panorama": 191,
  24016. "./ApiHost": 159,
  24017. "./PostMessageType": 160,
  24018. "./TransitionStyles": 162,
  24019. three: 217
  24020. }],
  24021. 165: [function(e, t, i) {
  24022. "use strict";
  24023. function n(e) {
  24024. this.sourceWindow = e,
  24025. this.targetWindow = null,
  24026. this.targetOrigin = null,
  24027. this.id = Math.floor(1e5 * Math.random()),
  24028. this.bindEvents()
  24029. }
  24030. var r = e("./PostMessageType")
  24031. , o = e("events").EventEmitter;
  24032. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24033. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24034. }
  24035. ,
  24036. n.prototype.setTarget = function(e, t) {
  24037. this.targetWindow = e,
  24038. this.targetOrigin = t
  24039. }
  24040. ,
  24041. n.prototype.onPostmessageReceived = function(e) {
  24042. var t = e.origin || e.originalEvent.origin
  24043. , i = e.source;
  24044. switch (e.data.type) {
  24045. case r.CONNECT:
  24046. break;
  24047. case r.RESPONSE:
  24048. if (this.id !== e.data.toId)
  24049. return;
  24050. default:
  24051. if (!this.validateMessageOrigin(t))
  24052. return
  24053. }
  24054. var n = e.data;
  24055. n.source = i,
  24056. n.origin = t,
  24057. n.timestamp = Date.now(),
  24058. this.emit(e.data.type, n)
  24059. }
  24060. ,
  24061. n.prototype.validateMessageOrigin = function(e) {
  24062. return "*" === this.targetOrigin || e === this.targetOrigin
  24063. }
  24064. ,
  24065. n.prototype.send = function(e) {
  24066. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24067. this.targetWindow.postMessage(e, this.targetOrigin))
  24068. }
  24069. ,
  24070. t.exports = n
  24071. }
  24072. , {
  24073. "./PostMessageType": 160,
  24074. events: 202
  24075. }],
  24076. 166: [function(e, t, i) {
  24077. "use strict";
  24078. var n = e("three")
  24079. , r = e("./util/browser")
  24080. , o = e("./enum/Viewmode")
  24081. , a = e("./enum/VROption")
  24082. , s = e("./enum/Colors")
  24083. , l = e("./enum/WarpStyle")
  24084. , c = e("./util/easing")
  24085. , h = e("./util/common")
  24086. , u = e("./util/showcase")
  24087. , d = e("./constants")
  24088. , p = {
  24089. debug: !1,
  24090. version: "2.25.6-0-gd87e5b1",
  24091. languageTag: r.valueFromHash("lang", null),
  24092. pageTitle: "四维虚拟漫游",
  24093. authorizationHeader: u.getAuthorizationHeader(),
  24094. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24095. logLevel: r.valueFromHash("log", 2),
  24096. skyboxRadius: 2500,
  24097. modelBoundsPadding: 5,
  24098. showNeighbors: !1,
  24099. brand: r.valueFromHash("brand", !0),
  24100. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24101. startHighlights: r.valueFromHash("hl", -1),
  24102. specialEdition: r.valueFromHash("bn", 0),
  24103. useWheel: r.valueFromHash("wh", !0),
  24104. crossOrigin: "anonymous",
  24105. fancierTransition: !1,
  24106. wireframe: !1,
  24107. skyboxWireframe: !1,
  24108. modelAlpha: 1,
  24109. highlightPanoSelection: !1,
  24110. showSweeps: !0,
  24111. showSkyboxes: !1,
  24112. showMesh: !0,
  24113. showFloors: !1,
  24114. showFloorDuration: 300,
  24115. showFloorDelay: 300,
  24116. hideFloorDuration: 300,
  24117. hideFloorDelay: 0,
  24118. reticuleOpacityTransitionTime: 250,
  24119. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue,
  24120. markerOpacityTransitionTime: 500,
  24121. guiAnimationSpeed: 250,
  24122. highlightAnimationDuration: 500,
  24123. modelComponentLoadSpinnerDelay: 150,
  24124. captureErrors: !1,
  24125. maxMobileTextures: 6,
  24126. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24127. startupFlyinDelay: 3e3,
  24128. dollhouseDefault: {
  24129. minDistance: 1,//15, //编辑页面给近一些
  24130. maxDistance: 50,
  24131. minPolarAngle: n.Math.degToRad(10),
  24132. maxPolarAngle: n.Math.degToRad(90)
  24133. },
  24134. hideReticuleTimeout: 1e3,
  24135. analytics: {
  24136. inactivityThreshold: 30,
  24137. sessionTrackingRate: .15,
  24138. maxTrackedErrors: 20,
  24139. sessionDurationPingFrequency: 10,
  24140. sessionDurationTimeout: 15
  24141. },
  24142. flydown: {
  24143. movementEasing: "easeInOutQuad",
  24144. movementDelay: .001,
  24145. rotationEasing: "easeInOutQuad",
  24146. rotationDelay: .5,
  24147. modelTextureDelay: .75,
  24148. skyboxDelay: .75
  24149. },
  24150. transition: {
  24151. flySpeed: .001,
  24152. flyTime: 750,
  24153. flytimeMaxDistanceThreshold: 5,
  24154. flytimeDistanceMultiplier: 150,
  24155. aimTime: 1500,
  24156. aimSlowFactor: 1.5,
  24157. blur: .8,
  24158. movementEasing: "easeInOutQuad",
  24159. blendEasing: "easeInOutQuad",
  24160. fastForwardFactor: 3
  24161. },
  24162. show360Views: {
  24163. enabled: !0,
  24164. transitionTime: 1e3
  24165. },
  24166. quickstart: {
  24167. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24168. animation: 1400,
  24169. showTextDelay: 500,
  24170. fadeOutDelay: 3e3,
  24171. fovChange: 10
  24172. },
  24173. appConfig: {
  24174. webvr_version: null,
  24175. segment_key: null,
  24176. embedly_key: null,
  24177. branch_key: null,
  24178. keen_write_key: null,
  24179. keen_project_id: null
  24180. },
  24181. vr: {
  24182. enabled: !0,
  24183. allowWebVR: !1,
  24184. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24185. },
  24186. share: {
  24187. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24188. },
  24189. input: {
  24190. longTapThreshold: 200,
  24191. moveToleranceNDC: .08,
  24192. touchMoveThreshold: 25
  24193. },
  24194. help: {
  24195. modalStayDuration: 600
  24196. },
  24197. immersive: {
  24198. timeToShowAgain: 1250,
  24199. uiStayDuration: 600
  24200. },
  24201. tourInteraction: {
  24202. disabled: "0" === r.valueFromHash("tourcta", null),
  24203. showPauseButton: 1e3,
  24204. showModal: 1500,
  24205. allowNextClick: 200,
  24206. largeModal: "1" === r.valueFromHash("tourcta", null),
  24207. smallModal: "2" === r.valueFromHash("tourcta", null)
  24208. },
  24209. labels: {
  24210. enabled: !1,
  24211. hideUntilStart: !0,
  24212. fadeInDuration: 250,
  24213. fadeInDelay: 250,
  24214. fadeOutDuration: 250,
  24215. fadeOutDelay: 0,
  24216. zoomHideThreshhold: {
  24217. mobile: r.isSmallScreen() ? .45 : .6,
  24218. desktop: 2
  24219. },
  24220. zoomTruncateThreshhold: {
  24221. mobile: r.isSmallScreen() ? .35 : .45,
  24222. desktop: .85
  24223. },
  24224. minLengthForTruncate: 16,
  24225. truncateLength: 12,
  24226. truncateSuffix: "..."
  24227. },
  24228. tags: {
  24229. enabled: r.valueFromHash("mt", 1),
  24230. startup: {
  24231. hideUntilStart: !0,
  24232. fadeInDuration: 500,
  24233. fadeInDelay: 100
  24234. },
  24235. visibility: {
  24236. anyDistance: !0,
  24237. visibleDistance: 8,
  24238. cameraClearance: .1,
  24239. alphaTestLevel: .05,
  24240. hideViaFloor: !0,
  24241. hideOffScreenDisc: !1,
  24242. hideOffScreenObject: !1
  24243. },
  24244. disc: {
  24245. opacity: 1,
  24246. disabledOpacity: .5,
  24247. scale: {
  24248. nearBound: 1.5,
  24249. farBound: 4.8,
  24250. linkFarBound: !1,
  24251. linkPercent: 40,
  24252. maxSize: 80,
  24253. minSize: 40,
  24254. baseViewportSize: 800,
  24255. responsiveness: 100
  24256. }
  24257. },
  24258. pole: {
  24259. enabled: !0,
  24260. height: .5,
  24261. width: 2,
  24262. opacity: .5,
  24263. color: "white"
  24264. },
  24265. navigate: {
  24266. nearestPano: !0,
  24267. lineOfSight: !0,
  24268. reactivate: !0,
  24269. aimAt: "disc",
  24270. tiltTolerance: 25,
  24271. rotateSpeedFactor: .6
  24272. }
  24273. },
  24274. path: {
  24275. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue,
  24276. colorUp: s._desat(s.newBlue, .5),
  24277. colorDown: s._darken(s.newBlue, .35),
  24278. opacity: .5,
  24279. style: "ribbon",
  24280. height: .025,
  24281. ribbonWidth: .24,
  24282. outsideHeight: .5,
  24283. waypointRadius: .5,
  24284. waypointIndoorRadius: .24,
  24285. waypointPulse: 1e3,
  24286. typ: l.BLACK,
  24287. meshFree: r.valueFromHash("mf", 1),
  24288. mapGuides: r.valueFromHash("guides", !0),
  24289. fadeInTime: 400,
  24290. fadeOutTime: 300
  24291. },
  24292. warp: {
  24293. nearPanoDist: .1,
  24294. matchCam: !1,
  24295. blur: .33,
  24296. fastTime: 1500,
  24297. teleportTime: 1500,
  24298. outsideTime: 2e3,
  24299. lookAheadMax: .3,
  24300. lookAheadDist: 2.5,
  24301. softPushDist: .37,
  24302. softPushEnd: .3,
  24303. softBendAngle: 8,
  24304. softBendTilt: 4,
  24305. softBendEnd: .3,
  24306. doBurns: !0,
  24307. burnsAngle: 8,
  24308. minBurnsAngle: 35,
  24309. minDownAngle: -35,
  24310. maxTurnPerSec: 280,
  24311. maxAimPerSec: 35,
  24312. minRotation: 12,
  24313. maxAimRotation: 33.2,
  24314. turnFriction: .2,
  24315. flySpeed: .01,
  24316. minWarpTime: 1200,
  24317. warpInterruptionRedirectTime: 500,
  24318. tourStepDelay: r.valueFromHash("st", 0),
  24319. walkDelay: 0,
  24320. walkMaxDist: 50,
  24321. walkMinDist: .8,
  24322. walkSlideShowThreshhold: 3e3,
  24323. walkExtraPanosDistance: .4,
  24324. timePerMeter: 1200,
  24325. motionLeadTime: 5e3,
  24326. movementEasing: "easeInOutQuad",
  24327. blendEasing: "easeInOutQuad",
  24328. showBunny: !1,
  24329. loop: r.valueFromHash("lp", !1),
  24330. auto: r.valueFromHash("ts", -1),
  24331. eOrder: "YXZ",
  24332. stepFactor: .25,
  24333. brakeStrength: 2,
  24334. minBrakeAngle: .1,
  24335. maxBrakeAngle: 1.8,
  24336. climbEffort: 4
  24337. },
  24338. rotationFriction: .05,
  24339. rotationAccelerationInside: 4.5,
  24340. rotationAccelerationOutside: .15,
  24341. rotationAfterMoveMultiplier: 40,
  24342. rotationAfterMoveHistoryCount: 5,
  24343. panFriction: .09,
  24344. panAccelerationOutside: 60,
  24345. onload: r.valueFromHash("onload", o.PANORAMA),
  24346. zoomNearLimit: .1,
  24347. zoomFarLimit: 10,
  24348. navigation: {
  24349. panoScores: !1,
  24350. mouseDirection: !0,
  24351. filterStrictness: .75,
  24352. angleFactor: -30,
  24353. directionFactor: 10,
  24354. distanceFactor: -1,
  24355. optionalityFactor: 3
  24356. },
  24357. sdkInit: !1,
  24358. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24359. console: r.valueFromHash("console", !1),
  24360. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24361. panoramaNeighbourMaxDistance: 5,
  24362. panoFloorClickRadius: .35,
  24363. showScreenshotLocations: !1,
  24364. showAxis: !1,
  24365. showNeighbourRaycasts: !1,
  24366. colorMarkerOnLoad: !1,
  24367. colorMarkerByFloor: !1,
  24368. tiling: {
  24369. panoPreRenderRepeatDelay: 2500,
  24370. panoPreRenderDelay: 500,
  24371. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24372. tilingFlagNames: ["usetiles", "tiles"],
  24373. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24374. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24375. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24376. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24377. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24378. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24379. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24380. customCompression: r.valueFromHash("tilecustcomp", 0),
  24381. mobileHighQualityOverride: 1,
  24382. allowUltraHighResolution: !0
  24383. },
  24384. zoom: {
  24385. enabled: !0,
  24386. forceOff: r.valueFromHash("nozoom", 0),
  24387. overridemax: r.valueFromHash("maxzoom", null),
  24388. overridemin: r.valueFromHash("minzoom", null),
  24389. max: d.highQualityMaxZoom,
  24390. min: 1,
  24391. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24392. activationThreshold: 1.1,
  24393. restoreTime: 500
  24394. },
  24395. profiling: {
  24396. enabled: r.valueFromHash("mem", !1)
  24397. }
  24398. };
  24399. (p = h.deepExtend(p, d, {
  24400. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24401. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24402. panorama: {
  24403. transitionTime: 1e3,
  24404. modelAlpha: 0,
  24405. modelAlphaDelay: p.flydown.modelTextureDelay,
  24406. modelAlphaLength: 1,
  24407. skyboxOpacity: 1,
  24408. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24409. skyboxOpacityLength: .9,
  24410. fovLength: 1,
  24411. fovDelay: 0,
  24412. cameraMatrixDuration: .8,
  24413. cameraMatrixDelay: 0,
  24414. cameraMatrixEase: c.easeInCubic,
  24415. reticuleOpacity: 1,
  24416. markerOpacity: .3,
  24417. markerOpacityOnHover: 1
  24418. },
  24419. dollhouse: {
  24420. transitionTime: 1e3,
  24421. modelAlpha: 1,
  24422. modelAlphaDelay: 0,
  24423. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24424. skyboxOpacity: 0,
  24425. skyboxOpacityDelay: 0,
  24426. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24427. fovLength: 1,
  24428. fovDelay: 0,
  24429. cameraMatrixDuration: .8,
  24430. cameraMatrixDelay: .3,
  24431. cameraMatrixEase: c.easeInCubic,
  24432. reticuleOpacity: 1,
  24433. markerOpacity: 0,
  24434. markerOpacityOnHover: 0
  24435. },
  24436. floorplan: {
  24437. transitionTime: 1e3,
  24438. modelAlpha: 1,
  24439. modelAlphaDelay: 0,
  24440. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24441. skyboxOpacity: 0,
  24442. skyboxOpacityDelay: 0,
  24443. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24444. fovLength: 1,
  24445. fovDelay: 0,
  24446. cameraMatrixDuration: .5,
  24447. cameraMatrixDelay: 0,
  24448. cameraMatrixEase: c.easeOutCubic,
  24449. reticuleOpacity: 1,
  24450. markerOpacity: 0,
  24451. markerOpacityOnHover: 0,
  24452. cameraHeight: 50
  24453. },
  24454. transitioning: {
  24455. reticuleOpacity: 0,
  24456. markerOpacity: .3,
  24457. markerOpacityOnHover: 1
  24458. },
  24459. "floorplan-dollhouse": {
  24460. rotationDelay: 0,
  24461. rotationDuration: 1
  24462. },
  24463. "floorplan-panorama": {
  24464. rotationDelay: .5,
  24465. rotationDuration: 1
  24466. },
  24467. "dollhouse-panorama": {
  24468. rotationDelay: .5,
  24469. rotationDuration: 1
  24470. },
  24471. "dollhouse-floorplan": {
  24472. rotationDelay: 0,
  24473. rotationDuration: 1,
  24474. cameraMatrixDuration: 1.05,
  24475. cameraMatrixDelay: .5
  24476. },
  24477. "panorama-dollhouse": {
  24478. rotationDelay: 0,
  24479. rotationDuration: .5
  24480. },
  24481. "panorama-floorplan": {
  24482. transitionTime: 1500,
  24483. rotationDelay: 0,
  24484. rotationDuration: .5
  24485. }
  24486. })).path.meshFree && (p.path.typ = l.WALK),
  24487. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24488. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24489. t.exports = p
  24490. }
  24491. , {
  24492. "./constants": 8,
  24493. "./enum/Colors": 19,
  24494. "./enum/VROption": 47,
  24495. "./enum/Viewmode": 51,
  24496. "./enum/WarpStyle": 52,
  24497. "./util/browser": 182,
  24498. "./util/common": 185,
  24499. "./util/easing": 186,
  24500. "./util/showcase": 193,
  24501. three: 217
  24502. }],
  24503. 167: [function(e, t, i) {
  24504. "use strict";
  24505. var n = e("three")
  24506. , r = e("./settings")
  24507. , 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"
  24508. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24509. t.exports = {
  24510. basicTextured: {
  24511. uniforms: {
  24512. tDiffuse: {
  24513. type: "t",
  24514. value: null
  24515. },
  24516. alpha: {
  24517. type: "f",
  24518. value: 1
  24519. }
  24520. },
  24521. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24522. 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}"
  24523. },
  24524. copyCubeMap: {
  24525. uniforms: {
  24526. tDiffuse: {
  24527. type: "t",
  24528. value: null
  24529. },
  24530. alpha: {
  24531. type: "f",
  24532. value: 1
  24533. }
  24534. },
  24535. 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}",
  24536. 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}"
  24537. },
  24538. cube: {
  24539. uniforms: {
  24540. map: {
  24541. type: "t",
  24542. value: null
  24543. },
  24544. opacity: {
  24545. type: "f",
  24546. value: 1
  24547. }
  24548. },
  24549. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  24550. 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"
  24551. },
  24552. model: {
  24553. uniforms: {
  24554. map: {
  24555. type: "t",
  24556. value: null
  24557. },
  24558. modelAlpha: {
  24559. type: "f",
  24560. value: r.modelAlpha
  24561. },
  24562. opacity: {
  24563. type: "f",
  24564. value: 1
  24565. },
  24566. progress: {
  24567. type: "f",
  24568. value: 0
  24569. },
  24570. blackout: {
  24571. type: "i",
  24572. value: 0
  24573. },
  24574. pano0Map: {
  24575. type: "t",
  24576. value: null
  24577. },
  24578. pano0Position: {
  24579. type: "v3",
  24580. value: new n.Vector3
  24581. },
  24582. pano0Matrix: {
  24583. type: "m4",
  24584. value: new n.Matrix4
  24585. },
  24586. pano1Map: {
  24587. type: "t",
  24588. value: null
  24589. },
  24590. pano1Position: {
  24591. type: "v3",
  24592. value: new n.Vector3
  24593. },
  24594. pano1Matrix: {
  24595. type: "m4",
  24596. value: new n.Matrix4
  24597. }
  24598. },
  24599. 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",
  24600. 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"
  24601. },
  24602. hot: {
  24603. uniforms: {
  24604. color: {
  24605. type: "c",
  24606. value: new n.Color(16720384)
  24607. },
  24608. opac: {
  24609. type: "f",
  24610. value: 0
  24611. },
  24612. texture1: {
  24613. type: "t",
  24614. value: null
  24615. },
  24616. texture2: {
  24617. type: "t",
  24618. value: null
  24619. }
  24620. },
  24621. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24622. 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"
  24623. },
  24624. modelOutside: {
  24625. uniforms: {
  24626. map: {
  24627. type: "t",
  24628. value: null
  24629. },
  24630. opacity: {
  24631. type: "f",
  24632. value: 1
  24633. }
  24634. },
  24635. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24636. 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"
  24637. },
  24638. ribbon: {
  24639. uniforms: {
  24640. map: {
  24641. type: "t",
  24642. value: null
  24643. },
  24644. opacity: {
  24645. type: "f",
  24646. value: 1
  24647. },
  24648. color: {
  24649. type: "c",
  24650. value: new n.Color(r.path.color)
  24651. }
  24652. },
  24653. 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",
  24654. 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"
  24655. },
  24656. waypoint: {
  24657. uniforms: {
  24658. map: {
  24659. type: "t",
  24660. value: null
  24661. },
  24662. opacity: {
  24663. type: "f",
  24664. value: 1
  24665. },
  24666. pulse: {
  24667. type: "f",
  24668. value: 1
  24669. },
  24670. nearFade: {
  24671. type: "v2",
  24672. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  24673. },
  24674. color: {
  24675. type: "c",
  24676. value: new n.Color(r.reticuleColor)
  24677. }
  24678. },
  24679. 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",
  24680. 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"
  24681. },
  24682. modelDebug: {
  24683. uniforms: {
  24684. map: {
  24685. type: "t",
  24686. value: null
  24687. },
  24688. modelAlpha: {
  24689. type: "f",
  24690. value: r.modelAlpha
  24691. },
  24692. depthmapRatio: {
  24693. type: "f",
  24694. value: 0
  24695. },
  24696. opacity: {
  24697. type: "f",
  24698. value: 1
  24699. },
  24700. progress: {
  24701. type: "f",
  24702. value: 0
  24703. },
  24704. considerOcclusion: {
  24705. type: "i",
  24706. value: r.fancierTransition
  24707. },
  24708. highlightPanoSelection: {
  24709. type: "i",
  24710. value: 0
  24711. },
  24712. useThirdPano: {
  24713. type: "i",
  24714. value: r.useThirdPano
  24715. },
  24716. pano0Map: {
  24717. type: "t",
  24718. value: null
  24719. },
  24720. pano0Depth: {
  24721. type: "t",
  24722. value: null
  24723. },
  24724. pano0Position: {
  24725. type: "v3",
  24726. value: new n.Vector3
  24727. },
  24728. pano0Matrix: {
  24729. type: "m4",
  24730. value: new n.Matrix4
  24731. },
  24732. pano0Weight: {
  24733. type: "f",
  24734. value: r.transition.pano0Weight
  24735. },
  24736. pano1Map: {
  24737. type: "t",
  24738. value: null
  24739. },
  24740. pano1Depth: {
  24741. type: "t",
  24742. value: null
  24743. },
  24744. pano1Position: {
  24745. type: "v3",
  24746. value: new n.Vector3
  24747. },
  24748. pano1Matrix: {
  24749. type: "m4",
  24750. value: new n.Matrix4
  24751. },
  24752. pano1Weight: {
  24753. type: "f",
  24754. value: r.transition.pano1Weight
  24755. },
  24756. pano2Map: {
  24757. type: "t",
  24758. value: null
  24759. },
  24760. pano2Depth: {
  24761. type: "t",
  24762. value: null
  24763. },
  24764. pano2Position: {
  24765. type: "v3",
  24766. value: new n.Vector3
  24767. },
  24768. pano2Matrix: {
  24769. type: "m4",
  24770. value: new n.Matrix4
  24771. },
  24772. pano2Weight: {
  24773. type: "f",
  24774. value: r.transition.pano2Weight
  24775. }
  24776. },
  24777. 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",
  24778. 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"
  24779. },
  24780. customDepth: {
  24781. uniforms: {
  24782. panoPosition: {
  24783. type: "v3",
  24784. value: new n.Vector3
  24785. }
  24786. },
  24787. 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",
  24788. 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"
  24789. },
  24790. skysphere: {
  24791. uniforms: {
  24792. radius: {
  24793. type: "f",
  24794. value: 0
  24795. }
  24796. },
  24797. 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",
  24798. 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"
  24799. },
  24800. tagDisc: {
  24801. uniforms: {
  24802. opacity: {
  24803. type: "f",
  24804. value: 0
  24805. },
  24806. color: {
  24807. type: "c",
  24808. value: new n.Color
  24809. },
  24810. bg: {
  24811. type: "t",
  24812. value: null
  24813. },
  24814. mask: {
  24815. type: "t",
  24816. value: null
  24817. }
  24818. },
  24819. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24820. 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"
  24821. }
  24822. }
  24823. window.shaders = t.exports;
  24824. }
  24825. , {
  24826. "./settings": 166,
  24827. three: 217
  24828. }],
  24829. 168: [function(E, _, e) {
  24830. (function(e) {
  24831. "use strict";
  24832. var t = E("three")
  24833. , i = (E("url"),
  24834. E("./util/ajax"))
  24835. , n = E("./settings")
  24836. , r = E("./util/logger")
  24837. , o = E("./util/math")
  24838. , a = E("./util/showcase")
  24839. , s = E("./objects/Panorama")
  24840. , l = new r(e)
  24841. , c = E("./model/Model")
  24842. , h = E("./shaders")
  24843. , u = E("./util/transitions")
  24844. , d = E("./objects/Chunk")
  24845. , p = E("./objects/Reticule")
  24846. , f = E("./objects/Skybox")
  24847. , g = E("./objects/Floor")
  24848. , m = E("./cameras/DollhouseCamera")
  24849. , v = E("./cameras/FloorplanCamera")
  24850. , y = E("./cameras/PanoramaCamera")
  24851. , A = E("./controls/DollhouseControls")
  24852. , C = E("./controls/FloorplanControls")
  24853. , I = E("./controls/PanoramaControls");
  24854. t.ImageUtils.crossOrigin = n.crossOrigin,
  24855. _.exports = {
  24856. shaders: h,
  24857. transitions: u,
  24858. Model: c,
  24859. Chunk: d,
  24860. Floor: g,
  24861. Skybox: f,
  24862. Reticule: p,
  24863. Panorama: s,
  24864. DollhouseCamera: m,
  24865. FloorplanCamera: v,
  24866. PanoramaCamera: y,
  24867. DollhouseControls: A,
  24868. FloorplanControls: C,
  24869. PanoramaControls: I,
  24870. getModel: function(e) {
  24871. if (!e.url)
  24872. throw 'getModel(): missing parameter "url"';
  24873. e.autoload = void 0 === e.autoload || e.autoload;
  24874. var t = a.parseSidUrl(e.url);
  24875. e.urlBase = t.urlBase,
  24876. e.urlModel = t.urlModel,
  24877. e.urlFiles = t.urlFiles;
  24878. var i = this._getPlatformError();
  24879. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  24880. this._loadModel().then(this._buildModel.bind(this)))
  24881. },
  24882. _getPlatformError: function() {
  24883. 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"
  24884. },
  24885. _loadModel: function() {
  24886. return i.get(this.options.urlModel, {
  24887. responseType: "json",
  24888. prefetchFrom: "model",
  24889. auth: a.getAuthorizationHeader()
  24890. }).then(null, function() {
  24891. return l.warn("Model loading failed at initial metadata load"),
  24892. "loading-failed"
  24893. })
  24894. },
  24895. _buildModel: function(e) {
  24896. e = a.normalizeModeldata(e, o);
  24897. var t = new c(this.options,e);
  24898. return this.options.autoload ? t.load(!0) : $.when(t)
  24899. }
  24900. }
  24901. }
  24902. ).call(this, "/js/showcase.js")
  24903. }
  24904. , {
  24905. "./cameras/DollhouseCamera": 5,
  24906. "./cameras/FloorplanCamera": 6,
  24907. "./cameras/PanoramaCamera": 7,
  24908. "./controls/DollhouseControls": 10,
  24909. "./controls/FloorplanControls": 11,
  24910. "./controls/PanoramaControls": 13,
  24911. "./model/Model": 139,
  24912. "./objects/Chunk": 144,
  24913. "./objects/Floor": 146,
  24914. "./objects/Panorama": 148,
  24915. "./objects/Reticule": 149,
  24916. "./objects/Skybox": 152,
  24917. "./settings": 166,
  24918. "./shaders": 167,
  24919. "./util/ajax": 181,
  24920. "./util/logger": 189,
  24921. "./util/math": 190,
  24922. "./util/showcase": 193,
  24923. "./util/transitions": 195,
  24924. three: 217,
  24925. url: 208
  24926. }],
  24927. 169: [function(e, t, i) {
  24928. "use strict";
  24929. function l(e) {
  24930. var t = {
  24931. renderTarget: null,
  24932. inUse: !1,
  24933. size: -1,
  24934. pano: null
  24935. };
  24936. return t.inUse = !0,
  24937. t.size = e,
  24938. function(e) {
  24939. O.push(e)
  24940. }(t),
  24941. t
  24942. }
  24943. function c(e) {
  24944. for (var t = 0; t < O.length; t++) {
  24945. var i = O[t];
  24946. if (i.renderTarget === e)
  24947. return !(i.inUse = !1)
  24948. }
  24949. return !1
  24950. }
  24951. function n() {
  24952. this.tileDirectory = {},
  24953. this.activeRenderTargetDescriptors = {},
  24954. this.activePanos = [],
  24955. this.panoLODDescriptors = {},
  24956. this.panoDescriptors = {},
  24957. this.tileTrees = {},
  24958. this.sceneRenderer = null,
  24959. this.tileDownloader = null,
  24960. this.forceQueue = [],
  24961. this.uploadQueues = {},
  24962. this.uploadInterval = null,
  24963. this.uploadIntervalCancelled = !1,
  24964. this.usingTileOverlay = !1,
  24965. this.overlayTilesLoaded = !1,
  24966. this.overlayTileBase = null,
  24967. this.overlayTilesBasic = {},
  24968. this.overlayTilesEnhanced = {},
  24969. this.zoomRenderTarget = null,
  24970. this.zoomPano = null,
  24971. this.zoomingActive = !1,
  24972. this.zoomPanoId = null,
  24973. this.zoomPanoRenderingDisabled = !1,
  24974. this.direction = new _.Vector3,
  24975. this.initTime = -1,
  24976. this.maxBaseUploadsPerFrame = R,
  24977. this.maxNonBaseUploadsPerFrame = M
  24978. }
  24979. 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"),
  24980. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  24981. e("../objects/Panorama"),
  24982. e("./TileTree")), y = (e("./TileDownloader"),
  24983. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  24984. e("../util/browser"),
  24985. 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 = {
  24986. Base: 0,
  24987. Remaining: 1
  24988. }, O = [];
  24989. function L(e) {
  24990. var t = e.shift();
  24991. return t.uploadQueued = !1,
  24992. t
  24993. }
  24994. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  24995. this.sceneRenderer = e,
  24996. this.tileDownloader = t,
  24997. this.qualityManager = i,
  24998. this.bindEvents(),
  24999. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25000. this.initTime = performance.now()
  25001. }
  25002. ,
  25003. n.prototype.getActivePanoTextures = function(e) {
  25004. e = e || [];
  25005. for (var t = 0; t < O.length; t++) {
  25006. var i = O[t];
  25007. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25008. }
  25009. }
  25010. ,
  25011. n.prototype.hasQueuedTiles = function() {
  25012. var e = this.peekNextFromUploadQueue();
  25013. return null != e
  25014. }
  25015. ,
  25016. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25017. return this.activeRenderTargetDescriptors[e]
  25018. }
  25019. ,
  25020. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25021. this.activeRenderTargetDescriptors[e] = t
  25022. }
  25023. ,
  25024. n.prototype.loadOverlayTiles = function() {
  25025. if (0 !== d.tiling.overlayStyle) {
  25026. var n = 0
  25027. , e = function(e, t, i) {
  25028. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25029. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25030. ++n === r.length && (this.overlayTilesLoaded = !0)
  25031. }
  25032. .bind(this)
  25033. , 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)]];
  25034. r.forEach(function(e) {
  25035. this.tileDownloader.loadImage(e[0], 0, e[1])
  25036. }
  25037. .bind(this)),
  25038. this.usingTileOverlay = !0
  25039. } else
  25040. this.usingTileOverlay = !1
  25041. }
  25042. ,
  25043. n.prototype.bindEvents = function() {
  25044. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25045. }
  25046. ,
  25047. n.prototype.setupZoomRenderTarget = function() {
  25048. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25049. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25050. return;
  25051. var e = this.zoomRenderTarget;
  25052. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25053. e) {
  25054. var t = e.width
  25055. , i = this.zoomRenderTarget.width;
  25056. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25057. e.texture.dispose(),
  25058. e.texture.loaded = !1,
  25059. e.texture.version = 0,
  25060. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25061. e.texture = null
  25062. }
  25063. this.zoomPanoRenderingDisabled = !1
  25064. } else
  25065. this.zoomPanoRenderingDisabled = !0
  25066. }
  25067. ,
  25068. n.prototype.enableUltraHighQualityMode = function(t) {
  25069. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25070. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25071. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25072. e && (this.qualityManager.enableUltraHighQualityMode(),
  25073. this.setupZoomRenderTarget(),
  25074. t())
  25075. }
  25076. .bind(this))
  25077. }
  25078. }
  25079. ,
  25080. n.prototype.activateTiledPano = function(e, t, i) {
  25081. i && this.clearAllQueuedUploads();
  25082. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25083. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25084. this.linkAllTilesAndNodes(e);
  25085. var r = this.getActiveRenderTargetDescriptor(e.id)
  25086. , o = t;
  25087. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25088. !r || o !== r.size) {
  25089. if (r && c(r.renderTarget),
  25090. !(r = function(e) {
  25091. for (var t = 0; t < O.length; t++) {
  25092. var i = O[t];
  25093. if (!i.inUse && i.size === e)
  25094. return i.inUse = !0,
  25095. i
  25096. }
  25097. return null
  25098. }(o))) {
  25099. var a = this.initTiledPano(o, !1);
  25100. (r = l(a.width)).renderTarget = a
  25101. }
  25102. r.pano = e,
  25103. this.resetPanoDescriptor(e.id),
  25104. this.resetPanoLODDescriptors(e.id),
  25105. this.resetRenderStatus(e.id, !0, !0)
  25106. }
  25107. this.setActiveRenderTargetDescriptor(e.id, r);
  25108. var s = i ? 0 : 1;
  25109. return this.updateActivePanos(e, s),
  25110. r.renderTarget
  25111. }
  25112. ,
  25113. n.prototype.deactivateTiledPano = function(e) {
  25114. var t = this.getActiveRenderTargetDescriptor(e.id);
  25115. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  25116. this.setActiveRenderTargetDescriptor(e.id, null);
  25117. var i = this.getUploadQueueForPano(e.id);
  25118. this.clearUploadQueue(i),
  25119. this.updateActivePanos()
  25120. }
  25121. ,
  25122. n.prototype.updateActivePanos = (s = [],
  25123. function(e, t) {
  25124. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  25125. e && s.length === t && s.push(e);
  25126. var n = this.activePanos[i]
  25127. , r = this.getActiveRenderTargetDescriptor(n.id);
  25128. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25129. }
  25130. e && t >= s.length && s.push(e),
  25131. this.activePanos.length = 0,
  25132. this.activePanos.push.apply(this.activePanos, s)
  25133. }
  25134. ),
  25135. n.prototype.getActivePanoCount = function() {
  25136. return this.activePanos.length
  25137. }
  25138. ,
  25139. n.prototype.resetRenderStatus = function(e, r, o, t) {
  25140. var i = null;
  25141. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  25142. for (var n = function(e, t, i, n) {
  25143. o && (t.tile.zoomUploaded = !1),
  25144. r && (t.tile.uploaded = !1)
  25145. }, a = 0; a < A.FACES_PER_PANO; a++) {
  25146. this.getTileTree(e, a).breadthFirst({
  25147. callback: n.bind(this, a),
  25148. minLevel: i
  25149. })
  25150. }
  25151. }
  25152. ,
  25153. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25154. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25155. t.tile.zoomUploaded = t.tile.uploaded,
  25156. t.zoomCovered = t.covered
  25157. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25158. this.getTileTree(e, n).breadthFirst({
  25159. callback: i.bind(this, n),
  25160. maxLevel: t
  25161. })
  25162. }
  25163. }
  25164. ,
  25165. n.prototype.renderPanoTiles = (h = [],
  25166. function(e, t, i, n) {
  25167. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25168. t = t || this.direction || m.FORWARD;
  25169. var r = this.getActiveRenderTargetDescriptor(e);
  25170. if (!this.isRenderTargetDescriptorValid(r))
  25171. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25172. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25173. var a = this.getTileTree(e, o);
  25174. h.length = 0,
  25175. a.breadthFirst({
  25176. saveVisited: h
  25177. });
  25178. for (var s = 0; s < h.length; s++) {
  25179. var l = h[s];
  25180. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  25181. }
  25182. }
  25183. this.updateDirection(t)
  25184. }
  25185. ),
  25186. n.prototype.isRenderTargetDescriptorValid = function(e) {
  25187. return e && e.renderTarget
  25188. }
  25189. ,
  25190. n.prototype.isPanoActive = function(e) {
  25191. var t = this.getActiveRenderTargetDescriptor(e);
  25192. return this.isRenderTargetDescriptorValid(t)
  25193. }
  25194. ,
  25195. n.prototype.isPanoZoomed = function(e) {
  25196. return this.zoomingActive && this.zoomPanoId === e
  25197. }
  25198. ,
  25199. n.prototype.initTileTree = function(e, t, i) {
  25200. var n = this.tileTrees[e];
  25201. n || (n = [],
  25202. this.tileTrees[e] = n);
  25203. var r = n[t];
  25204. if (!r) {
  25205. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  25206. r = new v(A.TILE_SIZE,o),
  25207. n[t] = r
  25208. }
  25209. }
  25210. ,
  25211. n.prototype.getTileTree = function(e, t) {
  25212. var i = this.tileTrees[e];
  25213. if (!i)
  25214. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25215. var n = i[t];
  25216. if (!n)
  25217. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25218. return n
  25219. }
  25220. ,
  25221. n.prototype.initTiledPano = function(e, t) {
  25222. var i = this.sceneRenderer.renderer
  25223. , n = (i.context,
  25224. new _.WebGLRenderTargetCube(e,e,{
  25225. stencilBuffer: !1
  25226. }))
  25227. , r = new _.CubeTexture([]);
  25228. (n.texture = r).image = [null, null, null, null, null, null],
  25229. r.flipY = !0,
  25230. t ? (r.generateMipmaps = !0,
  25231. r.magFilter = _.LinearFilter,
  25232. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25233. r.magFilter = _.LinearFilter,
  25234. r.minFilter = _.LinearFilter),
  25235. r.format = _.RGBAFormat,
  25236. i.setRenderTarget(n),
  25237. i.setRenderTarget(null);
  25238. var o = i.properties.get(r);
  25239. return o.__image__webglTextureCube = o.__webglTexture,
  25240. n
  25241. }
  25242. ,
  25243. n.prototype.getUploadQueueForPano = function(e) {
  25244. var t = this.uploadQueues[e];
  25245. return t || (t = [],
  25246. this.uploadQueues[e] = t),
  25247. t
  25248. }
  25249. ,
  25250. n.prototype.isTileUploaded = function(e) {
  25251. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25252. }
  25253. ,
  25254. n.prototype.setUploaded = function(e, t) {
  25255. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25256. }
  25257. ,
  25258. n.prototype.queueTileUpload = function(e, t, i) {
  25259. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25260. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25261. var r = this.getUploadQueueForPano(e.panoId);
  25262. 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),
  25263. e.uploadQueued = !0,
  25264. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25265. }
  25266. }
  25267. ,
  25268. n.prototype.shoulPushToFrontOfQueue = function(e) {
  25269. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25270. }
  25271. ,
  25272. n.prototype.getTopUploadQueue = function() {
  25273. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  25274. for (var n = 0; n < this.activePanos.length; n++)
  25275. if (e = this.activePanos[n],
  25276. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  25277. switch (i) {
  25278. case P.Base:
  25279. if (0 === t[0].level)
  25280. return t;
  25281. break;
  25282. case P.Remaining:
  25283. return t
  25284. }
  25285. return null
  25286. }
  25287. ,
  25288. n.prototype.getNextFromUploadQueue = function() {
  25289. if (0 < this.forceQueue.length)
  25290. return L(this.forceQueue);
  25291. var e = this.getTopUploadQueue();
  25292. return e && 0 < e.length ? L(e) : null
  25293. }
  25294. ,
  25295. n.prototype.peekNextFromUploadQueue = function() {
  25296. if (0 < this.forceQueue.length)
  25297. return this.forceQueue[0];
  25298. var e = this.getTopUploadQueue();
  25299. return e && 0 < e.length ? e[0] : null
  25300. }
  25301. ,
  25302. n.prototype.clearAllQueuedUploads = function() {
  25303. this.clearAllUploadQueues(null, 0)
  25304. }
  25305. ,
  25306. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  25307. this.clearAllUploadQueues(e, 0)
  25308. }
  25309. ,
  25310. n.prototype.clearAllUploadQueues = function(e, t) {
  25311. if (e)
  25312. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25313. this.clearUploadQueue(this.forceQueue, t, e);
  25314. else {
  25315. for (var i = 0; i < this.activePanos.length; i++) {
  25316. var n = this.activePanos[i];
  25317. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25318. }
  25319. this.clearUploadQueue(this.forceQueue, t)
  25320. }
  25321. }
  25322. ,
  25323. n.prototype.clearUploadQueue = function(e, t, i) {
  25324. null != t || (t = 0);
  25325. for (var n = 0; n < e.length; ) {
  25326. var r = e[n];
  25327. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25328. e.splice(n, 1)) : n++
  25329. }
  25330. }
  25331. ,
  25332. n.prototype.refreshUploadInterval = (a = null,
  25333. function(e) {
  25334. this.uploadIntervalCancelled || (a = a || function() {
  25335. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  25336. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25337. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  25338. }
  25339. .bind(this),
  25340. null != e || (e = x),
  25341. T || (e = S),
  25342. this.uploadInterval = window.setTimeout(a, e),
  25343. this.uploadIntervalDelay = e)
  25344. }
  25345. ),
  25346. n.prototype.update = (r = performance.now(),
  25347. o = 0,
  25348. function() {
  25349. this.uploadIntervalCancelled = !0,
  25350. window.clearTimeout(this.uploadInterval),
  25351. this.uploadInterval = null;
  25352. var e = performance.now() - r;
  25353. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25354. r = performance.now()),
  25355. o++
  25356. }
  25357. ),
  25358. n.prototype.updateUploadQueue = function(e, t) {
  25359. e = e || 1;
  25360. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  25361. var r = this.getNextFromUploadQueue();
  25362. if (!r)
  25363. break;
  25364. if (0 !== r.level ? i++ : n++,
  25365. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25366. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25367. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25368. }
  25369. }
  25370. }
  25371. ,
  25372. n.prototype.updateDirection = function(e) {
  25373. if (e = e || this.direction) {
  25374. this.direction = e;
  25375. for (var t = 0; t < this.activePanos.length; t++) {
  25376. var i = this.activePanos[t]
  25377. , n = this.getUploadQueueForPano(i.id);
  25378. y.sortPanoTiles(n, i, this.direction)
  25379. }
  25380. }
  25381. }
  25382. ,
  25383. n.prototype.uploadTile = (I = {},
  25384. new _.Vector4,
  25385. E = d.tiling.overlayStyle,
  25386. function(e, t) {
  25387. var i = e.panoId
  25388. , n = e.image
  25389. , r = e.tileSize
  25390. , o = e.panoSize
  25391. , a = e.tileIndex
  25392. , s = (e.faceTileIndex,
  25393. e.totalTiles)
  25394. , l = (e.face,
  25395. e.tileX)
  25396. , c = e.tileY
  25397. , h = !0
  25398. , u = !1
  25399. , d = (this.getPanoDescriptor(i),
  25400. this.getPanoLODDescriptor(i, o))
  25401. , p = this.getActiveRenderTargetDescriptor(i)
  25402. , f = p.renderTarget
  25403. , g = p.size;
  25404. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  25405. g = this.qualityManager.getMaxZoomPanoSize()),
  25406. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  25407. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  25408. this.isTileUploaded(e) && (u = h = !1)),
  25409. h) {
  25410. var m = r / o * g
  25411. , v = l * r / o * g
  25412. , y = c * r / o * g;
  25413. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  25414. var A = I[r];
  25415. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  25416. 1 === E || 2 === E) {
  25417. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25418. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  25419. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  25420. } else
  25421. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  25422. d.uploadCount++,
  25423. this.emit(b.TileRenderSuccess, i, o, a, s),
  25424. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  25425. this.setUploaded(e, !0),
  25426. this.addCoverageForNode(e.node)
  25427. } else
  25428. this.setUploaded(e, !1);
  25429. return e.uploadAttempted || (d.uploadAttempts++,
  25430. this.emit(b.TileUploadAttempted, i, o, a, s)),
  25431. e.uploadAttempted = !0,
  25432. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  25433. u
  25434. }
  25435. ),
  25436. n.prototype.linkTileAndNode = function(e, t) {
  25437. (t.tile = e).node = t
  25438. }
  25439. ,
  25440. n.prototype.linkAllTilesAndNodes = function(a) {
  25441. for (var e = function(e, t, i, n, r) {
  25442. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  25443. this.linkTileAndNode(o, i)
  25444. }, t = 0; t < A.FACES_PER_PANO; t++) {
  25445. var i = this.getTileTree(a.id, t);
  25446. i.breadthFirst({
  25447. callback: e.bind(this, i, t)
  25448. })
  25449. }
  25450. }
  25451. ,
  25452. n.prototype.anyUploaded = function(e) {
  25453. if (!e)
  25454. return !1;
  25455. if (e.tile && this.isTileUploaded(e.tile))
  25456. return !0;
  25457. if (e.children)
  25458. for (var t = 0; t < e.children.length; t++) {
  25459. var i = e.children[t];
  25460. if (this.anyUploaded(i))
  25461. return !0
  25462. }
  25463. return !1
  25464. }
  25465. ,
  25466. n.prototype.setNodeCovered = function(e, t) {
  25467. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25468. }
  25469. ,
  25470. n.prototype.isNodeCovered = function(e) {
  25471. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25472. }
  25473. ,
  25474. n.prototype.addCoverageForNode = function(e) {
  25475. if (this.setNodeCovered(e, !0),
  25476. e.parent && e.covered) {
  25477. var t = e.parent;
  25478. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25479. }
  25480. }
  25481. ,
  25482. n.prototype.calcFullCoverage = function(e) {
  25483. var t = !1;
  25484. if (e.children)
  25485. for (var i = 0; i < e.children.length; i++) {
  25486. var n = e.children[i];
  25487. t = t || this.calcFullCoverage(n)
  25488. }
  25489. e.covered = e.tile.uploaded || t
  25490. }
  25491. ,
  25492. n.prototype.nodeSubcovered = function(e) {
  25493. if (!e.children)
  25494. return !1;
  25495. for (var t = 0; t < e.children.length; t++)
  25496. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25497. return !1;
  25498. return !0
  25499. }
  25500. ,
  25501. n.prototype.resetPanoDescriptor = function(e) {
  25502. this.getPanoDescriptor(e)
  25503. }
  25504. ,
  25505. n.prototype.getPanoDescriptor = function(e) {
  25506. var t = this.panoDescriptors[e];
  25507. return t || (t = {},
  25508. this.panoDescriptors[e] = t),
  25509. t
  25510. }
  25511. ,
  25512. n.prototype.resetPanoLODDescriptors = function(e) {
  25513. var t = this.getPanoLODDescriptors(e);
  25514. for (var i in t)
  25515. if (t.hasOwnProperty(i)) {
  25516. var n = t[i];
  25517. n.uploadCount = 0,
  25518. n.uploadAttempts = 0
  25519. }
  25520. }
  25521. ,
  25522. n.prototype.getPanoLODDescriptor = function(e, t) {
  25523. var i = this.getPanoLODDescriptors(e)
  25524. , n = i[t];
  25525. return n || (n = {
  25526. uploadCount: 0,
  25527. uploadAttempts: 0
  25528. },
  25529. i[t] = n),
  25530. n
  25531. }
  25532. ,
  25533. n.prototype.getPanoLODDescriptors = function(e) {
  25534. var t = this.panoLODDescriptors[e];
  25535. return t || (t = {},
  25536. this.panoLODDescriptors[e] = t),
  25537. t
  25538. }
  25539. ,
  25540. n.prototype.onTileDownloaded = function(e) {
  25541. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25542. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  25543. if (i.downloaded = !0,
  25544. i.image = e.image,
  25545. i.panoSize = e.panoSize,
  25546. i.tileX = e.tileX,
  25547. i.tileY = e.tileY,
  25548. i.totalTiles = e.totalTiles,
  25549. i.tileIndex = e.tileIndex,
  25550. i.faceTileIndex = e.faceTileIndex,
  25551. i.face = e.face,
  25552. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  25553. i.panoId = e.panoId,
  25554. i.tileSize = e.tileSize,
  25555. i.direction = (new _.Vector3).copy(e.direction),
  25556. i.node = null,
  25557. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  25558. this.isPanoActive(i.panoId)) {
  25559. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  25560. this.linkTileAndNode(i, n),
  25561. this.queueTileUpload(i, !0)
  25562. }
  25563. }
  25564. ,
  25565. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  25566. var r = this.tileDirectory[e];
  25567. r || (r = {},
  25568. this.tileDirectory[e] = r);
  25569. var o = 16384 * t + 1024 * i + n
  25570. , a = r[o];
  25571. return a || (a = {
  25572. downloaded: !1,
  25573. uploaded: !1,
  25574. zoomUploaded: !1
  25575. },
  25576. r[o] = a),
  25577. a._key = e + ":" + t + ":" + i + ":" + n,
  25578. a._tileKey = o,
  25579. a
  25580. }
  25581. ,
  25582. n.prototype.setZoomingActive = function(e, t, i) {
  25583. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  25584. this.zoomPanoId = t.id,
  25585. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  25586. }
  25587. ,
  25588. n.prototype.updateZoomedPanoFromBase = function(e) {
  25589. if (!this.zoomPanoRenderingDisabled) {
  25590. var t = this.getActiveRenderTargetDescriptor(e.id);
  25591. if (t && t.renderTarget) {
  25592. var i = this.qualityManager.getMaxZoomPanoSize()
  25593. , n = t.renderTarget
  25594. , r = t.size;
  25595. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  25596. this.copyBaseRenderStatusToZoomed(e.id)
  25597. }
  25598. }
  25599. }
  25600. ,
  25601. t.exports = n
  25602. }
  25603. , {
  25604. "../enum/GLCubeFaces": 25,
  25605. "../enum/PanoRendererEvents": 35,
  25606. "../enum/PanoSizeClass": 36,
  25607. "../enum/SceneRendererEvents": 43,
  25608. "../enum/TileDownloaderEvents": 45,
  25609. "../enum/Vectors": 50,
  25610. "../exception/BasicException": 55,
  25611. "../objects/Panorama": 148,
  25612. "../settings": 166,
  25613. "../util/browser": 182,
  25614. "../util/panorama": 191,
  25615. "./TileDownloader": 171,
  25616. "./TilePrioritizer": 172,
  25617. "./TileTree": 173,
  25618. "./TileUtils": 174,
  25619. events: 202,
  25620. three: 217
  25621. }],
  25622. 170: [function(e, t, i) {
  25623. "use strict";
  25624. function n(e, t, i) {
  25625. this.maxNavPanoSize = -1,
  25626. this.maxZoomPanoSize = -1,
  25627. this.devicePixelDensity = e,
  25628. this.deviceScreenSize = t,
  25629. this.clientBandwidth = i,
  25630. this.panoSizeClassMap = {},
  25631. this.useHighResolutionPanos = !0,
  25632. this.useUltraHighResolutionPanos = !1,
  25633. this.modelHasUltraHighPanos = !1
  25634. }
  25635. var r = e("../enum/PanoSizeClass")
  25636. , o = e("../settings")
  25637. , a = e("../util/browser")
  25638. , s = e("../constants")
  25639. , l = e("../util/showcase")
  25640. , c = e("../enum/ModelManagerEvents");
  25641. n.prototype.init = function(e) {
  25642. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  25643. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  25644. this.highSize = this.getPanoSize(r.HIGH),
  25645. this.standardSize = this.getPanoSize(r.STANDARD),
  25646. this.baseSize = this.getPanoSize(r.BASE),
  25647. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  25648. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  25649. this.updateMaximums(),
  25650. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  25651. }
  25652. ,
  25653. n.prototype.updateFromModel = function(e) {
  25654. this.updateHighResolutionSettings(e),
  25655. this.updateUltraHighResolutionSettings(e)
  25656. }
  25657. ,
  25658. n.prototype.updateHighResolutionSettings = function(e) {
  25659. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  25660. this.updateMaximums()
  25661. }
  25662. ,
  25663. n.prototype.updateUltraHighResolutionSettings = function(e) {
  25664. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  25665. this.updateMaximums()
  25666. }
  25667. ,
  25668. n.prototype.enableUltraHighQualityMode = function() {
  25669. this.modelHasUltraHighPanos = !0,
  25670. this.updateUltraHighResolutionSettings(null)
  25671. }
  25672. ,
  25673. n.prototype.ultraHighQualityModeEnabled = function() {
  25674. return this.modelHasUltraHighPanos
  25675. }
  25676. ,
  25677. n.prototype.onModelChanged = function(e) {
  25678. this.updateFromModel(e.model),
  25679. this.updateMaximums()
  25680. }
  25681. ,
  25682. n.prototype.updateMaximums = function() {
  25683. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  25684. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  25685. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  25686. }
  25687. ,
  25688. n.prototype.buildPanoSizeClassMap = function() {
  25689. this.panoSizeClassMap[r.BASE] = 512,
  25690. this.panoSizeClassMap[r.STANDARD] = 1024,
  25691. this.panoSizeClassMap[r.HIGH] = 2048,
  25692. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  25693. }
  25694. ,
  25695. n.prototype.getPanoSize = function(e) {
  25696. return this.panoSizeClassMap[e]
  25697. }
  25698. ,
  25699. n.prototype.getMaxPossiblePanoSize = function() {
  25700. return this.getPanoSize(r.ULTRAHIGH)
  25701. }
  25702. ,
  25703. n.prototype.getMaxPanoSize = function() {
  25704. return this.maxZoomPanoSize
  25705. }
  25706. ,
  25707. n.prototype.getMaxNavPanoSize = function() {
  25708. return this.maxNavPanoSize
  25709. }
  25710. ,
  25711. n.prototype.getMaxZoomPanoSize = function() {
  25712. return this.maxZoomPanoSize
  25713. }
  25714. ,
  25715. n.prototype.detectMaxNavPanoSizeClass = function() {
  25716. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  25717. }
  25718. ,
  25719. n.prototype.detectMaxNavPanoSize = function() {
  25720. var e = this.detectMaxNavPanoSizeClass();
  25721. return this.getPanoSize(e)
  25722. }
  25723. ,
  25724. n.prototype.detectMaxZoomPanoSize = function() {
  25725. 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)
  25726. }
  25727. ,
  25728. t.exports = n
  25729. }
  25730. , {
  25731. "../constants": 8,
  25732. "../enum/ModelManagerEvents": 33,
  25733. "../enum/PanoSizeClass": 36,
  25734. "../settings": 166,
  25735. "../util/browser": 182,
  25736. "../util/showcase": 193
  25737. }],
  25738. 171: [function(A, C, e) {
  25739. (function(e) {
  25740. "use strict";
  25741. function i(e) {
  25742. this.panos = null,
  25743. this.retryMinimumTime = 1e4,
  25744. this.urls = null,
  25745. this.panoLoadCallbacks = {},
  25746. this.downloadDescriptors = {},
  25747. this.priorityQueue = [],
  25748. this.forceQueue = [],
  25749. this.activeDownloads = [],
  25750. this.qualityManager = null,
  25751. this.tilePrioritizer = null,
  25752. this.refreshInterval = null,
  25753. this.processPriorityQueue = !1,
  25754. this.concurrentDownloads = e.concurrentDownloads || 1,
  25755. this.downloadTestResults = {}
  25756. }
  25757. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  25758. A("../settings")), r = (A("../objects/Panorama"),
  25759. A("../util/logger")), o = (A("../enum/Vectors"),
  25760. A("../enum/PanoSizeClass"),
  25761. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  25762. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  25763. Object.freeze({
  25764. Testing: 1,
  25765. Success: 2,
  25766. Fail: 3
  25767. }));
  25768. i.prototype = Object.create(l.prototype),
  25769. i.IDLE_REFRESH_DELAY = 500,
  25770. i.ACTIVE_REFRESH_DELAY = 16,
  25771. i.DOWNLOAD_RETRIES = 4,
  25772. i.prototype.init = function(e) {
  25773. this.qualityManager = e
  25774. }
  25775. ,
  25776. i.prototype.setUrls = function(e) {
  25777. this.urls = e
  25778. }
  25779. ,
  25780. i.prototype.setPanoData = function(e, t, i) {
  25781. this.panos = e,
  25782. this.imagePanos = t,
  25783. this.panoGroupId = i
  25784. }
  25785. ,
  25786. i.prototype.start = function() {
  25787. this.refreshUpdateInterval(0)
  25788. }
  25789. ,
  25790. i.prototype.stop = function() {
  25791. window.cancel(this.refreshInterval)
  25792. }
  25793. ,
  25794. i.prototype.refreshUpdateInterval = function(e) {
  25795. e = e || 0,
  25796. this.refreshInterval = window.setTimeout(function() {
  25797. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  25798. }
  25799. .bind(this), e)
  25800. }
  25801. ,
  25802. i.prototype.update = function() {
  25803. var e = 0 < this.forceQueue.length;
  25804. return this.processQueueForDownloading(this.forceQueue),
  25805. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  25806. 0 < this.priorityQueue.length && (e = !0),
  25807. this.processQueueForDownloading(this.priorityQueue)),
  25808. e
  25809. }
  25810. ,
  25811. i.prototype.forceQueueTilesForPano = (p = [],
  25812. f = [],
  25813. function(e, t, i, n, r, o) {
  25814. p.length = 0;
  25815. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  25816. var l = a[s];
  25817. l.status !== v.None && l.status !== v.Queued || p.push(l)
  25818. }
  25819. if (i && 0 < p.length) {
  25820. g.sortPanoTiles(p, e, i),
  25821. f.length = 0,
  25822. m.matchingTilesInDirection(e, t, i, n, r, f);
  25823. for (var c = 0, h = function(e) {
  25824. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  25825. }; c < p.length; ) {
  25826. var u = p[c];
  25827. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  25828. }
  25829. }
  25830. for (var d = 0; d < p.length; d++)
  25831. this.forceQueue.push(p[d]);
  25832. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  25833. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  25834. o && this.processQueueForDownloading(this.forceQueue, !0)
  25835. }
  25836. ),
  25837. i.prototype.clearForceQueue = function() {
  25838. this.clearQueue(this.forceQueue)
  25839. }
  25840. ,
  25841. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  25842. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  25843. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  25844. this.clearFromQueue(this.priorityQueue, v.None, !0),
  25845. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  25846. }
  25847. ,
  25848. i.prototype.clearQueue = function(e) {
  25849. this.setStatusForAllDescriptors(e, v.None),
  25850. e.length = 0
  25851. }
  25852. ,
  25853. i.prototype.clearFromQueue = function(e, t, i) {
  25854. for (var n = 0; n < e.length; n++) {
  25855. var r = e[n];
  25856. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  25857. }
  25858. }
  25859. ,
  25860. i.prototype.setStatusForAllDescriptors = function(e, t) {
  25861. for (var i = 0; i < e.length; i++) {
  25862. var n = e[i];
  25863. n && (n.status = t)
  25864. }
  25865. }
  25866. ,
  25867. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  25868. for (var i = 0; i < e.length; i++) {
  25869. var n = e[i];
  25870. n && (n.status !== t ? n.status = t : e[i] = null)
  25871. }
  25872. }
  25873. ,
  25874. i.prototype.getTileDownloadDescriptors = function(e, t) {
  25875. var i = this.getAllTileDownloadDescriptorsForPano(e)
  25876. , n = i[t];
  25877. return n || (n = this.buildDownloadDescriptorArray(t),
  25878. i[t] = n,
  25879. this.initTileDownloadDescriptors(n, e, t)),
  25880. n
  25881. }
  25882. ,
  25883. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  25884. var t = this.downloadDescriptors[e.id];
  25885. return t || (t = {},
  25886. this.downloadDescriptors[e.id] = t),
  25887. t
  25888. }
  25889. ,
  25890. i.prototype.processQueueForDownloading = function(e, t) {
  25891. if (this.cleanupActiveDownloads(),
  25892. this.activeDownloads.length < this.concurrentDownloads || t)
  25893. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  25894. var r = e.shift();
  25895. r && (this.startDownload(r),
  25896. n++)
  25897. }
  25898. }
  25899. ,
  25900. i.prototype.testDownload = function(t, e, i) {
  25901. var n = this.downloadTestResults[t];
  25902. if (n)
  25903. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  25904. else {
  25905. this.downloadTestResults[t] = y.Testing;
  25906. var r = this.panos.list[0]
  25907. , o = this.getTileUrl(r.id, t, e, 0)
  25908. , a = function(e) {
  25909. this.downloadTestResults[t] = y.Success,
  25910. i(!0)
  25911. }
  25912. .bind(this)
  25913. , s = function() {
  25914. this.downloadTestResults[t] = y.Fail,
  25915. i(!1)
  25916. }
  25917. .bind(this);
  25918. this.loadImage(o, 0, a, s)
  25919. }
  25920. }
  25921. ,
  25922. i.prototype.startDownload = function(e) {
  25923. e.status = v.Downloading;
  25924. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  25925. this.activeDownloads.push(e),
  25926. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  25927. }
  25928. ,
  25929. i.prototype.downloadFailed = function(e, t) {}
  25930. ,
  25931. i.prototype.downloadComplete = function(e, t) {
  25932. if (e.panoGroupId === this.panoGroupId) {
  25933. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  25934. e.status = v.Downloaded,
  25935. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  25936. var n = {
  25937. panoId: e.pano.id,
  25938. image: t,
  25939. tileSize: e.tileSize,
  25940. panoSize: e.panoSize,
  25941. tileIndex: e.tileIndex,
  25942. faceTileIndex: e.faceTileIndex,
  25943. totalTiles: e.totalTiles,
  25944. face: e.face,
  25945. tileX: e.tileX,
  25946. tileY: e.tileY,
  25947. direction: e.direction
  25948. };
  25949. e.image = t,
  25950. this.emit(o.TileDownloadSuccess, n),
  25951. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  25952. panoId: e.pano.id,
  25953. tileSize: e.tileSize,
  25954. panoSize: e.panoSize
  25955. },
  25956. this.emit(o.PanoDownloadComplete, n),
  25957. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  25958. }
  25959. }
  25960. ,
  25961. i.prototype.cleanupActiveDownloads = (n = [],
  25962. function() {
  25963. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  25964. var t = this.activeDownloads[e];
  25965. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  25966. }
  25967. this.activeDownloads.length = 0,
  25968. this.activeDownloads.push.apply(this.activeDownloads, n)
  25969. }
  25970. ),
  25971. i.prototype.isPanoDownloaded = function(e, t) {
  25972. var i = this.getTileDownloadDescriptors(e, t);
  25973. if (i.length <= 0)
  25974. return !1;
  25975. for (var n = 0; n < i.length; n++) {
  25976. if (i[n].status !== v.Downloaded)
  25977. return !1
  25978. }
  25979. return !0
  25980. }
  25981. ,
  25982. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  25983. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  25984. this.panoLoadCallbacks[o] = {
  25985. onLoad: i,
  25986. onFail: n,
  25987. onProgress: r
  25988. }
  25989. }
  25990. ,
  25991. i.prototype.getPanoLoadCallbacks = function(e, t) {
  25992. var i = e.id + ":" + t;
  25993. return this.panoLoadCallbacks[i]
  25994. }
  25995. ,
  25996. i.prototype.buildDownloadDescriptorArray = function(e) {
  25997. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  25998. var r = this.buildDownloadDescriptor();
  25999. i.push(r)
  26000. }
  26001. return i
  26002. }
  26003. ,
  26004. i.prototype.buildDownloadDescriptor = function() {
  26005. return {
  26006. panoGroupId: null,
  26007. pano: null,
  26008. panoSize: -1,
  26009. tileSize: -1,
  26010. tileIndex: -1,
  26011. totalTiles: -1,
  26012. faceTileIndex: -1,
  26013. status: v.None,
  26014. url: null,
  26015. image: null,
  26016. direction: new t.Vector3,
  26017. face: -1,
  26018. cubeFace: -1,
  26019. tileX: -1,
  26020. tileY: -1
  26021. }
  26022. }
  26023. ,
  26024. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26025. for (var n = 0; n < e.length; n++) {
  26026. var r = e[n];
  26027. this.initTileDownloadDescriptor(r, t, i, n)
  26028. }
  26029. }
  26030. ,
  26031. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26032. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26033. e.face = m.getFaceForTile(i, n),
  26034. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26035. e.panoGroupId = this.panoGroupId,
  26036. e.pano = t,
  26037. e.panoSize = i,
  26038. e.tileSize = r,
  26039. e.tileIndex = n,
  26040. e.totalTiles = m.getTileCountForSize(i),
  26041. e.status = v.None,
  26042. e.image = null,
  26043. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26044. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26045. }
  26046. ,
  26047. i.prototype.getTileUrl = (c = {
  26048. 256: "256",
  26049. 512: "512",
  26050. 1024: "1k",
  26051. 2048: "2k",
  26052. 4096: "4k"
  26053. },
  26054. h = {
  26055. face: -1,
  26056. faceTileIndex: -1,
  26057. tileX: -1,
  26058. tileY: -1
  26059. },
  26060. function(e, t, i, n) {
  26061. m.getTileLocation(t, n, h);
  26062. var r = Math.floor(t / i)
  26063. , o = r * r
  26064. , a = Math.floor(n / o)
  26065. , s = "";
  26066. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26067. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26068. return d.changeIfTileGenerating(l)
  26069. }
  26070. ),
  26071. i.prototype.loadImage = function(e, t, i, n) {
  26072. s.getImage(e, t).then(function(e) {
  26073. i(e)
  26074. }).fail(n)
  26075. }
  26076. ,
  26077. C.exports = i
  26078. }
  26079. ).call(this, "/js/tile/TileDownloader.js")
  26080. }
  26081. , {
  26082. "../ab": 3,
  26083. "../enum/DownloadStatus": 24,
  26084. "../enum/GLCubeFaces": 25,
  26085. "../enum/PanoSizeClass": 36,
  26086. "../enum/TileDownloaderEvents": 45,
  26087. "../enum/Vectors": 50,
  26088. "../enum/Viewmode": 51,
  26089. "../objects/Panorama": 148,
  26090. "../settings": 166,
  26091. "../util/ajax": 181,
  26092. "../util/logger": 189,
  26093. "../util/panorama": 191,
  26094. "./TilePrioritizer": 172,
  26095. "./TileUtils": 174,
  26096. events: 202,
  26097. three: 217
  26098. }],
  26099. 172: [function(n, C, e) {
  26100. (function(e) {
  26101. "use strict";
  26102. function h(e, t, i, n, r) {
  26103. this.qualityManager = e,
  26104. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26105. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26106. this.baseSize = t,
  26107. this.standardSize = i,
  26108. this.highSize = n,
  26109. this.ultraHighSize = r,
  26110. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26111. }
  26112. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26113. n("../settings"),
  26114. n("../settings"),
  26115. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  26116. n("../enum/PanoSizeClass"),
  26117. n("../enum/ModelManagerEvents"),
  26118. n("../enum/GLCubeFaces"),
  26119. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  26120. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  26121. new t(e),
  26122. Object.freeze({
  26123. None: 0,
  26124. DirectionalFOV: 1
  26125. }));
  26126. h.PriorityCriteria = function(e, t, i, n, r) {
  26127. this.pano = e,
  26128. this.cameraPosition = (new o.Vector3).copy(t),
  26129. this.cameraDir = (new o.Vector3).copy(i),
  26130. this.panoSpaceDir = (new o.Vector3).copy(n),
  26131. this.upcomingPanos = r,
  26132. this.copy = function(e) {
  26133. this.pano = e.pano,
  26134. this.cameraPosition.copy(e.cameraPosition),
  26135. this.cameraDir.copy(e.cameraDir),
  26136. this.panoSpaceDir.copy(e.panoSpaceDir),
  26137. this.upcomingPanos = r
  26138. }
  26139. ,
  26140. this.zoomingActive = !1
  26141. }
  26142. ,
  26143. h.DIRECTIONAL_FOV = 180,
  26144. h.DIRECTIONAL_FOV_NARROW = 120,
  26145. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26146. h.MAX_SCORED_PANOS_TOADD = 2,
  26147. h.MAX_UPCOMING_PANOS_TOADD = 3,
  26148. h.DIRECTION_SCORE_STRICTNESS = .75,
  26149. h.appendQueue = function(e, t) {
  26150. if (e && t)
  26151. for (var i = 0; i < t.length; i++)
  26152. e.push(t[i])
  26153. }
  26154. ,
  26155. h.prototype.updateCriteria = function(e, t, i, n) {
  26156. this.priorityCriteria.pano = e,
  26157. this.priorityCriteria.cameraPosition.copy(t),
  26158. this.priorityCriteria.cameraDir.copy(i),
  26159. this.priorityCriteria.upcomingPanos = n,
  26160. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26161. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26162. }
  26163. ,
  26164. h.prototype.filterAndPrioritize = (u = [],
  26165. p = [],
  26166. f = [],
  26167. function(e, t, i) {
  26168. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26169. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  26170. var n = this.baseSize
  26171. , r = this.standardSize
  26172. , o = this.highSize
  26173. , a = this.ultraHighSize;
  26174. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26175. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26176. f.length = 0,
  26177. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26178. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26179. h.appendQueue(e, f),
  26180. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26181. f.length = 0,
  26182. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26183. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26184. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26185. h.appendQueue(e, f),
  26186. f.length = 0,
  26187. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26188. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26189. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26190. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26191. h.appendQueue(e, f),
  26192. this.queueTilesForPanos(e, u, i, n)
  26193. }
  26194. ),
  26195. h.prototype.canDownloadSize = function(e) {
  26196. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26197. }
  26198. ,
  26199. h.prototype.populateNeighborPanos = function(e, t, i) {
  26200. (i = i || []).length = 0;
  26201. var n = t.getNeighbours(e);
  26202. for (var r in n)
  26203. if (n.hasOwnProperty(r)) {
  26204. var o = t.get(r);
  26205. i.push(o)
  26206. }
  26207. return i
  26208. }
  26209. ,
  26210. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  26211. (i = i || []).length = 0;
  26212. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  26213. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  26214. , s = t.sortByScore(o, a);
  26215. if (s)
  26216. for (var l = 0; l < s.length && l < r; l++) {
  26217. var c = s[l].pano;
  26218. i.push(c)
  26219. }
  26220. return i
  26221. }
  26222. ,
  26223. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26224. for (var o = 0, a = 0; a < t.length; a++) {
  26225. var s = t[a];
  26226. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  26227. r && r <= o)
  26228. break
  26229. }
  26230. return o
  26231. }
  26232. ,
  26233. h.prototype.queueTilesForPano = (r = {
  26234. filter: a.None
  26235. },
  26236. function(e, t, i, n) {
  26237. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26238. }
  26239. ),
  26240. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  26241. function(e, t, i, n, r, o, a, s) {
  26242. for (var l = 0, c = 0; c < i.length; c++) {
  26243. var h = i[c];
  26244. d.copy(h.position),
  26245. d.sub(r),
  26246. d.normalize();
  26247. var u = Math.max(Math.min(o.dot(d), 1), -1);
  26248. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  26249. s && s <= l))
  26250. break
  26251. }
  26252. return l
  26253. }
  26254. ),
  26255. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26256. for (var l = 0, c = 0; c < i.length; c++) {
  26257. var h = i[c];
  26258. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  26259. s && s <= l)
  26260. break
  26261. }
  26262. return l
  26263. }
  26264. ,
  26265. h.prototype.queueTilesInDirectionForPano = (s = {
  26266. filter: a.DirectionalFOV,
  26267. direction: new o.Vector3,
  26268. fov: 60
  26269. },
  26270. l = new o.Vector3,
  26271. function(e, t, i, n, r, o, a) {
  26272. return l.copy(o),
  26273. m.getRelativeDirection(i.quaternion, l),
  26274. s.direction.copy(l),
  26275. s.fov = a,
  26276. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26277. }
  26278. ),
  26279. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  26280. function(e, t, i, n, r) {
  26281. var o = t.getTileDownloadDescriptors(i, n);
  26282. c.length = 0,
  26283. this.filterTileDownloadDescriptors(i, o, c, r);
  26284. for (var a = 0, s = 0; s < c.length; s++) {
  26285. var l = c[s];
  26286. l && (e.push(l),
  26287. a++)
  26288. }
  26289. return a
  26290. }
  26291. ),
  26292. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  26293. function(e, t, i, n) {
  26294. var r, o;
  26295. switch (n.filter) {
  26296. case a.DirectionalFOV:
  26297. for (r = 0; r < t.length; r++)
  26298. o = t[r],
  26299. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26300. break;
  26301. default:
  26302. for (r = 0; r < t.length; r++)
  26303. o = t[r],
  26304. i.push(o)
  26305. }
  26306. for (r = 0; r < i.length; r++)
  26307. o = i[r],
  26308. this.canIncludeDescriptor(o) || (i[r] = null)
  26309. }
  26310. ),
  26311. h.prototype.canIncludeDescriptor = function(e) {
  26312. return e.status !== i.Downloading && e.status !== i.Downloaded
  26313. }
  26314. ,
  26315. h.prototype.canIncludePano = function(e, t) {
  26316. return !e.isLoaded(t)
  26317. }
  26318. ,
  26319. h.getFOVDotThreshold = function(e) {
  26320. return Math.cos(o.Math.degToRad(e / 2))
  26321. }
  26322. ;
  26323. var y = (A._panoSpaceDir = new o.Vector3,
  26324. A._fovThreshold = -1,
  26325. A._fovThresholdNarrow = -1,
  26326. A);
  26327. function A(e, t) {
  26328. var i = A._panoSpaceDir
  26329. , n = A._fovThreshold
  26330. , r = A._fovThresholdNarrow
  26331. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  26332. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  26333. return e._dot = o,
  26334. t._dot = a,
  26335. 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)
  26336. }
  26337. h.sortPanoTiles = function(e, t, i) {
  26338. y._panoSpaceDir.copy(i),
  26339. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  26340. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26341. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  26342. e.sort(y)
  26343. }
  26344. ,
  26345. h.insertSortedPanoTile = function(e, t, i, n) {
  26346. y._panoSpaceDir.copy(n),
  26347. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  26348. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26349. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  26350. for (var r = -1, o = 0; o < e.length; o++) {
  26351. if (y(t, e[o]) <= 0) {
  26352. r = o;
  26353. break
  26354. }
  26355. }
  26356. if (-1 === r)
  26357. e[e.length] = t;
  26358. else {
  26359. for (var a = e.length; r < a; a--)
  26360. e[a] = e[a - 1];
  26361. e[r] = t
  26362. }
  26363. }
  26364. ,
  26365. h.prototype.setZoomingActive = function(e) {
  26366. e !== this.zoomingActive && (this.zoomingActive = e)
  26367. }
  26368. ,
  26369. C.exports = h
  26370. }
  26371. ).call(this, "/js/tile/TilePrioritizer.js")
  26372. }
  26373. , {
  26374. "../enum/DownloadStatus": 24,
  26375. "../enum/GLCubeFaces": 25,
  26376. "../enum/ModelManagerEvents": 33,
  26377. "../enum/PanoSizeClass": 36,
  26378. "../enum/Vectors": 50,
  26379. "../enum/Viewmode": 51,
  26380. "../objects/Panorama": 148,
  26381. "../settings": 166,
  26382. "../util/browser": 182,
  26383. "../util/logger": 189,
  26384. "../util/math": 190,
  26385. "./TileUtils": 174,
  26386. events: 202,
  26387. three: 217
  26388. }],
  26389. 173: [function(e, t, i) {
  26390. "use strict";
  26391. function f(e, t) {
  26392. this.levels = t,
  26393. this.tileSize = e,
  26394. this.root = null,
  26395. this.allNodes = [],
  26396. function(e) {
  26397. e.root = function e(t, i, n) {
  26398. if (n > t.levels)
  26399. return null;
  26400. var r = new a(t,i);
  26401. t.allNodes.push(r);
  26402. for (var o = 0; o < s; o++)
  26403. r.children[o] = e(t, r, n + 1);
  26404. return r
  26405. }(e, null, 0)
  26406. }(this)
  26407. }
  26408. function a(e, t) {
  26409. this.tree = e,
  26410. this.parent = t,
  26411. this.children = [],
  26412. this.id = ++n
  26413. }
  26414. var g = (e("three"),
  26415. e("./TileUtils"),
  26416. e("../objects/Panorama"),
  26417. e("../util/panorama"),
  26418. e("events").EventEmitter,
  26419. 2)
  26420. , s = g * g;
  26421. f.TraversalType = Object.freeze({
  26422. PreOrder: 0,
  26423. PostOrder: 1
  26424. });
  26425. var n = 0;
  26426. f.getLevelCountForSize = function(e, t) {
  26427. var i = 0;
  26428. for (t < e && (t = e); !((t /= g) < e); )
  26429. i++;
  26430. return i
  26431. }
  26432. ,
  26433. f.getSizeForLevel = function(e, t) {
  26434. return Math.pow(g, t) * e
  26435. }
  26436. ,
  26437. f.prototype.getSubNode = function(e, t, i) {
  26438. (!t || e < this.tileSize) && (t = 0),
  26439. (!i || e < this.tileSize) && (i = 0),
  26440. e < this.tileSize && (e = this.tileSize);
  26441. var n = f.getLevelCountForSize(this.tileSize, e);
  26442. return function e(t, i, n, r, o) {
  26443. if (!t)
  26444. return null;
  26445. if (0 === n)
  26446. return t;
  26447. if (!t.children || 0 === t.children.length)
  26448. return null;
  26449. var a = Math.pow(g, n) / g
  26450. , s = r % a
  26451. , l = o % a
  26452. , c = Math.floor(o / a)
  26453. , h = Math.floor(r / a)
  26454. , u = c * g + h;
  26455. return e(t.children[u], i + 1, n - 1, s, l)
  26456. }(this.root, 0, n, t, i)
  26457. }
  26458. ,
  26459. f.prototype.breadthFirst = function(e) {
  26460. var t = !!(e = e || {}).nullLevelEnd
  26461. , i = e.maxLevel
  26462. , n = e.minLevel
  26463. , r = e.callback
  26464. , o = e.saveVisited
  26465. , a = []
  26466. , s = {}
  26467. , l = 0;
  26468. for (a.push(this.root),
  26469. a.push(s); 0 < a.length && !(i && i < l); ) {
  26470. var c = a.shift();
  26471. if (c === s)
  26472. (!n || n <= l) && (r && t && r(null),
  26473. o && t && o.push(null)),
  26474. 0 < a.length && a.push(s),
  26475. l++,
  26476. 0;
  26477. else {
  26478. if (c.children)
  26479. for (var h = 0; h < c.children.length; h++) {
  26480. c.children[h] && a.push(c.children[h])
  26481. }
  26482. var u = this.getFaceIndexFromNode(c);
  26483. (!n || n <= l) && (r && r(c, l, u),
  26484. o && o.push(c)),
  26485. 0
  26486. }
  26487. }
  26488. }
  26489. ,
  26490. f.prototype.getFaceIndexFromNode = function(e) {
  26491. if (!e)
  26492. return -1;
  26493. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26494. var o = i.parent;
  26495. if (!o)
  26496. break;
  26497. for (var a = -1, s = 0; s < o.children.length; s++)
  26498. o.children[s] === i && (a = s);
  26499. n = a % g * t + n,
  26500. r = Math.floor(a / g) * t + r,
  26501. t *= g,
  26502. i = o
  26503. }
  26504. return r * t + n
  26505. }
  26506. ,
  26507. f.prototype.depthFirst = function(e, t, i) {
  26508. !function e(t, i, n, r, o, a, s, l) {
  26509. if (t) {
  26510. s = s || f.TraversalType.PreOrder;
  26511. var c = r * g + n;
  26512. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  26513. a && a.push(t)),
  26514. t.children && 0 !== t.children.length) {
  26515. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  26516. for (var p = 0; p < g; p++)
  26517. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  26518. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  26519. a && a.push(t))
  26520. }
  26521. }
  26522. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  26523. }
  26524. ,
  26525. t.exports = f
  26526. }
  26527. , {
  26528. "../objects/Panorama": 148,
  26529. "../util/panorama": 191,
  26530. "./TileUtils": 174,
  26531. events: 202,
  26532. three: 217
  26533. }],
  26534. 174: [function(e, t, i) {
  26535. "use strict";
  26536. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  26537. b.TILE_SIZE = 512,
  26538. b.FACES_PER_PANO = 6,
  26539. b.LocationOnTile = {
  26540. Center: 0,
  26541. UpperLeft: 1,
  26542. UpperRight: 2,
  26543. LowerRight: 3,
  26544. LowerLeft: 4
  26545. },
  26546. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  26547. var l = e / t
  26548. , c = t / e * 2
  26549. , h = c / 2
  26550. , u = n / l * 2 - 1 + h
  26551. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  26552. switch (o = o || b.LocationOnTile.Center) {
  26553. case b.LocationOnTile.UpperLeft:
  26554. u -= h,
  26555. d += h,
  26556. u += a * c;
  26557. break;
  26558. case b.LocationOnTile.UpperRight:
  26559. u += h,
  26560. d += h,
  26561. d -= a * c;
  26562. break;
  26563. case b.LocationOnTile.LowerRight:
  26564. u += h,
  26565. d -= h,
  26566. u -= a * c;
  26567. break;
  26568. case b.LocationOnTile.LowerLeft:
  26569. u -= h,
  26570. d -= h,
  26571. d += a * c;
  26572. break;
  26573. case b.LocationOnTile.Center:
  26574. }
  26575. switch (i) {
  26576. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26577. _.setVector(s, -1, d, -u);
  26578. break;
  26579. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26580. _.setVector(s, 1, d, u);
  26581. break;
  26582. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26583. _.setVector(s, -u, 1, -d);
  26584. break;
  26585. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26586. _.setVector(s, -u, -1, d);
  26587. break;
  26588. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26589. _.setVector(s, -u, d, 1);
  26590. break;
  26591. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26592. _.setVector(s, u, d, -1)
  26593. }
  26594. _.normalize(s)
  26595. }
  26596. ,
  26597. b.getFaceForTile = function(e, t) {
  26598. var i = b.TILE_SIZE;
  26599. e < b.TILE_SIZE && (i = e);
  26600. var n = Math.floor(e / i)
  26601. , r = n * n;
  26602. return Math.floor(t / r)
  26603. }
  26604. ,
  26605. b.getTileLocation = function(e, t, i) {
  26606. var n = b.TILE_SIZE;
  26607. e < b.TILE_SIZE && (n = e);
  26608. var r = b.getFaceForTile(e, t)
  26609. , o = Math.floor(e / n)
  26610. , a = t - r * (o * o);
  26611. i.tileX = a % o,
  26612. i.tileY = Math.floor(a / o),
  26613. i.face = r,
  26614. i.faceTileIndex = a
  26615. }
  26616. ,
  26617. b.getTileCountForSize = function(e) {
  26618. if (e <= b.TILE_SIZE)
  26619. return b.FACES_PER_PANO;
  26620. var t = Math.floor(e / b.TILE_SIZE);
  26621. return t * t * b.FACES_PER_PANO
  26622. }
  26623. ,
  26624. b.getRelativeDirection = (r = new _.Matrix4,
  26625. o = new _.Quaternion,
  26626. function(e, t) {
  26627. o.copy(e),
  26628. o.inverse(),
  26629. r.makeRotationFromQuaternion(o),
  26630. r.applyToVector3(t),
  26631. _.normalize(t)
  26632. }
  26633. ),
  26634. b.matchingTilesInDirection = (c = new _.Vector3,
  26635. h = new _.Vector3(0,0,-1),
  26636. u = new _.Quaternion,
  26637. l = {
  26638. face: -1,
  26639. faceTileIndex: -1,
  26640. tileX: -1,
  26641. tileY: -1
  26642. },
  26643. d = function(e, t, i) {
  26644. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  26645. b.getTileLocation(e, o, l),
  26646. t && !t(l) || (r++,
  26647. i && (a = l,
  26648. i.push({
  26649. face: a.face,
  26650. faceTileIndex: a.faceTileIndex,
  26651. tileX: a.tileX,
  26652. tileY: a.tileY
  26653. })));
  26654. var a;
  26655. return r
  26656. }
  26657. ,
  26658. function(e, t, i, n, r, o) {
  26659. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  26660. if (b.getTileCountForSize(t),
  26661. !n && !r)
  26662. return d(t, null, o);
  26663. var s = !!r;
  26664. return r = r || n,
  26665. r = Math.max(0, Math.min(r, 360)),
  26666. n = Math.max(0, Math.min(n, 360)),
  26667. _.copyVector(i, c),
  26668. b.getRelativeDirection(e.quaternion, c),
  26669. s ? (u.setFromUnitVectors(c, h),
  26670. d(t, function(e) {
  26671. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  26672. }, o)) : d(t, function(e) {
  26673. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  26674. }, o)
  26675. }
  26676. ),
  26677. b.isTileWithinFrustum = (E = new _.Vector3,
  26678. function(e, t, i, n, r, o, a, s) {
  26679. 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++)
  26680. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  26681. _.applyQuaternionToVector(o, E),
  26682. -1e-5 <= E.z)
  26683. ;
  26684. else {
  26685. var A = -1 / E.z
  26686. , C = E.x * A
  26687. , I = E.y * A;
  26688. l < I ? p++ : I < c && f++,
  26689. h < C ? g++ : C < u && m++,
  26690. v++
  26691. }
  26692. return f !== v && p !== v && g !== v && m !== v
  26693. }
  26694. ),
  26695. b.isTileWithinFOV = (p = new _.Vector3,
  26696. f = new _.Vector3(0,1,0),
  26697. g = new _.Vector3(1,0,0),
  26698. function(e, t, i, n, r, o, a) {
  26699. var s = b.mapFaceToCubemapFace(i);
  26700. if (_.cross(o, f, g),
  26701. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  26702. b.isWithinFOV(p, o, a, null))
  26703. return !0;
  26704. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  26705. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  26706. if (b.getTileVector(e, t, s, n, r, d, h, p),
  26707. b.isWithinFOV(p, o, a, null))
  26708. return !0;
  26709. h += l
  26710. }
  26711. return !1
  26712. }
  26713. ),
  26714. b.isWithinFOV = (a = new _.Vector3,
  26715. s = new _.Vector3,
  26716. function(e, t, i, n) {
  26717. if (_.copyVector(e, s),
  26718. n) {
  26719. _.copyVector(n, a),
  26720. _.normalize(a);
  26721. var r = _.dot(a, e);
  26722. a.x *= r,
  26723. a.y *= r,
  26724. a.z *= r,
  26725. _.subVector(s, a)
  26726. }
  26727. var o = i / 2 * _.RADIANS_PER_DEGREE;
  26728. return Math.cos(o) <= _.dot(s, t)
  26729. }
  26730. ),
  26731. b.mapFaceToCubemapFace = (n = {
  26732. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  26733. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  26734. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  26735. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  26736. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  26737. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  26738. },
  26739. function(e) {
  26740. return n[e]
  26741. }
  26742. ),
  26743. t.exports = b
  26744. }
  26745. , {
  26746. "../enum/GLCubeFaces": 25,
  26747. "../util/MathLight": 176
  26748. }],
  26749. 175: [function(i, n, e) {
  26750. (function(e) {
  26751. "use strict";
  26752. function t() {
  26753. this.list = [],
  26754. this.index = {},
  26755. Object.defineProperty(this, "length", {
  26756. get: function() {
  26757. return this.list.length
  26758. }
  26759. })
  26760. }
  26761. new (i("./common"),
  26762. i("./logger"))(e),
  26763. t.prototype.forEach = function(e) {
  26764. this.list.forEach(e)
  26765. }
  26766. ,
  26767. t.prototype.add = function(e) {
  26768. this.list.push(e),
  26769. this.index[this.getIndex(e)] = e
  26770. }
  26771. ,
  26772. t.prototype.getIndex = function(e) {
  26773. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  26774. }
  26775. ,
  26776. t.prototype.extend = function(e) {
  26777. for (var t = 0; t < e.length; t++)
  26778. this.add(e[t])
  26779. }
  26780. ,
  26781. t.prototype.get = function(e) {
  26782. return this.index[e]
  26783. }
  26784. ,
  26785. t.prototype.first = function() {
  26786. return this.list[0]
  26787. }
  26788. ,
  26789. t.prototype.last = function() {
  26790. return this.list[this.list.length - 1]
  26791. }
  26792. ,
  26793. t.prototype.reIndex = function() {
  26794. this.index = {};
  26795. var t = this;
  26796. this.forEach(function(e) {
  26797. t.index[t.getIndex(e)] = e
  26798. })
  26799. }
  26800. ,
  26801. t.prototype.filter = function(e) {
  26802. var t = this.list.filter(e);
  26803. return this.reIndex(),
  26804. t
  26805. }
  26806. ,
  26807. t.prototype.reduce = function(e, t) {
  26808. return this.list.reduce(e, t)
  26809. }
  26810. ,
  26811. t.prototype.sort = function(e) {
  26812. return this.list.sort(e)
  26813. }
  26814. ,
  26815. t.prototype.indexOf = function(e) {
  26816. for (var t = 0; t < this.list.length; ++t)
  26817. if (this.list[t] === e)
  26818. return t;
  26819. return -1
  26820. }
  26821. ,
  26822. n.exports = t
  26823. }
  26824. ).call(this, "/js/util/IndexedCollection.js")
  26825. }
  26826. , {
  26827. "./common": 185,
  26828. "./logger": 189
  26829. }],
  26830. 176: [function(e, t, i) {
  26831. "use strict";
  26832. e("../constants");
  26833. var n, r, o = {};
  26834. o.RADIANS_PER_DEGREE = Math.PI / 180,
  26835. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  26836. o.Vector3 = function(e, t, i) {
  26837. this.x = e || 0,
  26838. this.y = t || 0,
  26839. this.z = i || 0
  26840. }
  26841. ,
  26842. o.Matrix4 = function() {
  26843. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  26844. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  26845. }
  26846. ,
  26847. o.Matrix4.prototype = {
  26848. identity: function() {
  26849. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  26850. this
  26851. },
  26852. copy: function(e) {
  26853. return this.elements.set(e.elements),
  26854. this
  26855. },
  26856. applyToVector3: function(e) {
  26857. var t = e.x
  26858. , i = e.y
  26859. , n = e.z
  26860. , r = this.elements;
  26861. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  26862. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  26863. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  26864. this
  26865. },
  26866. getInverse: function(e, t) {
  26867. var i = this.elements
  26868. , n = e.elements
  26869. , r = n[0]
  26870. , o = n[1]
  26871. , a = n[2]
  26872. , s = n[3]
  26873. , l = n[4]
  26874. , c = n[5]
  26875. , h = n[6]
  26876. , u = n[7]
  26877. , d = n[8]
  26878. , p = n[9]
  26879. , f = n[10]
  26880. , g = n[11]
  26881. , m = n[12]
  26882. , v = n[13]
  26883. , y = n[14]
  26884. , A = n[15]
  26885. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  26886. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  26887. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  26888. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  26889. , b = r * C + o * I + a * E + s * _;
  26890. if (0 == b) {
  26891. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  26892. if (t)
  26893. throw new Error(w);
  26894. return console.warn(w),
  26895. this.identity()
  26896. }
  26897. var T = 1 / b;
  26898. return i[0] = C * T,
  26899. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  26900. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  26901. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  26902. i[4] = I * T,
  26903. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  26904. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  26905. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  26906. i[8] = E * T,
  26907. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  26908. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  26909. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  26910. i[12] = _ * T,
  26911. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  26912. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  26913. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  26914. this
  26915. },
  26916. makeRotationFromQuaternion: function(e) {
  26917. var t = this.elements
  26918. , i = e.x
  26919. , n = e.y
  26920. , r = e.z
  26921. , o = e.w
  26922. , a = i + i
  26923. , s = n + n
  26924. , l = r + r
  26925. , c = i * a
  26926. , h = i * s
  26927. , u = i * l
  26928. , d = n * s
  26929. , p = n * l
  26930. , f = r * l
  26931. , g = o * a
  26932. , m = o * s
  26933. , v = o * l;
  26934. return t[0] = 1 - (d + f),
  26935. t[4] = h - v,
  26936. t[8] = u + m,
  26937. t[1] = h + v,
  26938. t[5] = 1 - (c + f),
  26939. t[9] = p - g,
  26940. t[2] = u - m,
  26941. t[6] = p + g,
  26942. t[10] = 1 - (c + d),
  26943. t[3] = 0,
  26944. t[7] = 0,
  26945. t[11] = 0,
  26946. t[12] = 0,
  26947. t[13] = 0,
  26948. t[14] = 0,
  26949. t[15] = 1,
  26950. this
  26951. }
  26952. },
  26953. o.Quaternion = function(e, t, i, n) {
  26954. this._x = e || 0,
  26955. this._y = t || 0,
  26956. this._z = i || 0,
  26957. this._w = void 0 !== n ? n : 1
  26958. }
  26959. ,
  26960. o.Quaternion.prototype = {
  26961. get x() {
  26962. return this._x
  26963. },
  26964. set x(e) {
  26965. this._x = e
  26966. },
  26967. get y() {
  26968. return this._y
  26969. },
  26970. set y(e) {
  26971. this._y = e
  26972. },
  26973. get z() {
  26974. return this._z
  26975. },
  26976. set z(e) {
  26977. this._z = e
  26978. },
  26979. get w() {
  26980. return this._w
  26981. },
  26982. set w(e) {
  26983. this._w = e
  26984. },
  26985. copy: function(e) {
  26986. this._x = e.x,
  26987. this._y = e.y,
  26988. this._z = e.z,
  26989. this._w = e.w
  26990. },
  26991. inverse: function() {
  26992. return this.conjugate().normalize()
  26993. },
  26994. conjugate: function() {
  26995. return this._x *= -1,
  26996. this._y *= -1,
  26997. this._z *= -1,
  26998. this
  26999. },
  27000. length: function() {
  27001. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27002. },
  27003. normalize: function() {
  27004. var e = this.length();
  27005. return 0 === e ? (this._x = 0,
  27006. this._y = 0,
  27007. this._z = 0,
  27008. this._w = 1) : (e = 1 / e,
  27009. this._x = this._x * e,
  27010. this._y = this._y * e,
  27011. this._z = this._z * e,
  27012. this._w = this._w * e),
  27013. this
  27014. },
  27015. setFromAxisAngle: function(e, t) {
  27016. var i = t / 2
  27017. , n = Math.sin(i);
  27018. return this._x = e.x * n,
  27019. this._y = e.y * n,
  27020. this._z = e.z * n,
  27021. this._w = Math.cos(i),
  27022. this
  27023. },
  27024. setFromUnitVectors: function(e, t) {
  27025. return void 0 === n && (n = new o.Vector3),
  27026. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27027. 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),
  27028. this._x = n.x,
  27029. this._y = n.y,
  27030. this._z = n.z,
  27031. this._w = r,
  27032. this.normalize()
  27033. },
  27034. multiply: function(e) {
  27035. return this.multiplyQuaternions(this, e)
  27036. },
  27037. premultiply: function(e) {
  27038. return this.multiplyQuaternions(e, this)
  27039. },
  27040. multiplyQuaternions: function(e, t) {
  27041. var i = e._x
  27042. , n = e._y
  27043. , r = e._z
  27044. , o = e._w
  27045. , a = t._x
  27046. , s = t._y
  27047. , l = t._z
  27048. , c = t._w;
  27049. return this._x = i * c + o * a + n * l - r * s,
  27050. this._y = n * c + o * s + r * a - i * l,
  27051. this._z = r * c + o * l + i * s - n * a,
  27052. this._w = o * c - i * a - n * s - r * l,
  27053. this
  27054. }
  27055. },
  27056. o.convertWorkshopVector = function(e) {
  27057. return new o.Vector3(-e.x,e.y,e.z)
  27058. }
  27059. ,
  27060. o.convertWorkshopQuaternion = function(e) {
  27061. 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))
  27062. }
  27063. ,
  27064. o.convertWorkshopOrthoZoom = function(e) {
  27065. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27066. }
  27067. ,
  27068. o.convertWorkshopPanoramaQuaternion = function(e) {
  27069. 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))
  27070. }
  27071. ,
  27072. o.normalize = function(e) {
  27073. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27074. , i = Math.sqrt(t);
  27075. e.x /= i,
  27076. e.y /= i,
  27077. e.z /= i
  27078. }
  27079. ,
  27080. o.dot = function(e, t) {
  27081. return e.x * t.x + e.y * t.y + e.z * t.z
  27082. }
  27083. ,
  27084. o.cross = function(e, t, i) {
  27085. var n = e.x
  27086. , r = e.y
  27087. , o = e.z;
  27088. i.x = r * t.z - o * t.y,
  27089. i.y = o * t.x - n * t.z,
  27090. i.z = n * t.y - r * t.x
  27091. }
  27092. ,
  27093. o.setVector = function(e, t, i, n) {
  27094. e.x = t,
  27095. e.y = i,
  27096. e.z = n
  27097. }
  27098. ,
  27099. o.copyVector = function(e, t) {
  27100. t.x = e.x,
  27101. t.y = e.y,
  27102. t.z = e.z
  27103. }
  27104. ,
  27105. o.addVector = function(e, t) {
  27106. e.x += t.x,
  27107. e.y += t.y,
  27108. e.z += t.z
  27109. }
  27110. ,
  27111. o.subVector = function(e, t) {
  27112. e.x -= t.x,
  27113. e.y -= t.y,
  27114. e.z -= t.z
  27115. }
  27116. ,
  27117. o.applyQuaternionToVector = function(e, t) {
  27118. var i = t.x
  27119. , n = t.y
  27120. , r = t.z
  27121. , o = e.x
  27122. , a = e.y
  27123. , s = e.z
  27124. , l = e.w
  27125. , c = l * i + a * r - s * n
  27126. , h = l * n + s * i - o * r
  27127. , u = l * r + o * n - a * i
  27128. , d = -o * i - a * n - s * r;
  27129. t.x = c * l + d * -o + h * -s - u * -a,
  27130. t.y = h * l + d * -a + u * -o - c * -s,
  27131. t.z = u * l + d * -s + c * -a - h * -o
  27132. }
  27133. ,
  27134. o.angleBetweenVectors = function(e, t) {
  27135. return Math.acos(o.dot(e, t))
  27136. }
  27137. ,
  27138. t.exports = o
  27139. }
  27140. , {
  27141. "../constants": 8
  27142. }],
  27143. 177: [function(c, h, e) {
  27144. (function(e) {
  27145. "use strict";
  27146. function t(e) {
  27147. this.cache = null,
  27148. this.expires = 0
  27149. }
  27150. function i() {
  27151. this.baseUrl = null,
  27152. this.cache = null,
  27153. this.expires = 0
  27154. }
  27155. function n() {
  27156. this.baseUrl = null,
  27157. this.expires = 0
  27158. }
  27159. function r(e) {
  27160. this.initialLoadingPromise = null,
  27161. this.endpoint = e + "?type=3",
  27162. this.urlContainer = null,
  27163. this.authorizationHeader = s.getAuthorizationHeader(),
  27164. this.containerClasses = [n, i, t]
  27165. }
  27166. c("./ajax");
  27167. var o = c("./logger")
  27168. , a = c("../constants")
  27169. , s = c("./showcase")
  27170. , l = (c("../ab"),
  27171. new o(e));
  27172. t.prototype = {
  27173. version: 1,
  27174. validate: function(e) {
  27175. return "catalog.json"in e && 0 < Object.keys(e).length
  27176. },
  27177. update: function(e) {
  27178. return this.cache = e,
  27179. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27180. $.when()
  27181. },
  27182. get: function(e) {
  27183. return this.cache[e]
  27184. }
  27185. },
  27186. i.prototype = {
  27187. version: 2,
  27188. validate: function(e) {
  27189. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  27190. },
  27191. update: function(e) {
  27192. return this.baseUrl = e["base.url"],
  27193. this.cache = e,
  27194. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27195. $.when()
  27196. },
  27197. get: function(e) {
  27198. var t = this.cache[e];
  27199. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27200. }
  27201. },
  27202. n.prototype = {
  27203. version: 3,
  27204. validate: function(e) {
  27205. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27206. },
  27207. update: function(e) {
  27208. return this.baseUrl = e.templates[0],
  27209. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27210. $.when()
  27211. },
  27212. get: function(e) {
  27213. return this.baseUrl.replace("{{filename}}", e)
  27214. }
  27215. },
  27216. r.prototype = {
  27217. init: function() {
  27218. return this.initialLoadingPromise || (setInterval(function() {
  27219. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27220. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  27221. this.refresh().done(function() {
  27222. l.debug("Refreshed")
  27223. }).fail(function() {
  27224. l.error("Failed url refresh, urls might go stale soon")
  27225. }))
  27226. }
  27227. .bind(this), a.signedUrlCheckInterval),
  27228. this.initialLoadingPromise = this.refresh()),
  27229. this.initialLoadingPromise
  27230. },
  27231. refresh: function(e) {
  27232. return {},
  27233. $.Deferred().resolve()
  27234. },
  27235. get: function(e) {
  27236. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  27237. }
  27238. },
  27239. h.exports = r
  27240. }
  27241. ).call(this, "/js/util/ModelUrls.js")
  27242. }
  27243. , {
  27244. "../ab": 3,
  27245. "../constants": 8,
  27246. "./ajax": 181,
  27247. "./logger": 189,
  27248. "./showcase": 193
  27249. }],
  27250. 178: [function(l, c, e) {
  27251. (function(e) {
  27252. "use strict";
  27253. function t() {
  27254. i.call(this),
  27255. this.neighbourMap = {},
  27256. this.map = null
  27257. }
  27258. 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"),
  27259. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  27260. n.inherit(t, i),
  27261. t.prototype.getIndex = function(e) {
  27262. return e.id
  27263. }
  27264. ,
  27265. t.prototype.find = function(e, t) {
  27266. var i = n.filterAll(this.list, e);
  27267. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27268. i = n.stableSort(i, e)
  27269. }),
  27270. i[0])
  27271. }
  27272. ,
  27273. t.prototype.sortByScore = function(e, t) {
  27274. var i = n.filterAll(this.list, e);
  27275. return 0 === i.length ? null : i = i.map(function(i) {
  27276. return {
  27277. pano: i,
  27278. score: t.reduce(function(e, t) {
  27279. return e + t(i)
  27280. }, 0)
  27281. }
  27282. }).sort(function(e, t) {
  27283. return t.score - e.score
  27284. })
  27285. }
  27286. ,
  27287. t.prototype.lowestByScore = function(e, t, i) {
  27288. return this.findRankedByScore(0, e, t, i)
  27289. }
  27290. ,
  27291. t.prototype.findRankedByScore = function(e, t, i, n) {
  27292. n && (n.candidates = null,
  27293. n.pano = null),
  27294. e = e || 0;
  27295. var r = this.sortByScore(t, i);
  27296. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27297. n.pano = r[e].pano),
  27298. r[e].pano)
  27299. }
  27300. ,
  27301. t.prototype.showPanoScores = function(e) {
  27302. this.list.forEach(function(e) {
  27303. e.removeTextSprite()
  27304. });
  27305. var t = 6344768;
  27306. e.forEach(function(e) {
  27307. e.pano.addTextSprite(e.score.toFixed(2), t),
  27308. t = 16428055
  27309. })
  27310. }
  27311. ,
  27312. t.prototype.isNeighbour = function(e, t) {
  27313. return this.neighbourMap[e.id][t.id]
  27314. }
  27315. ,
  27316. t.prototype.getNeighbours = function(e) {
  27317. return this.neighbourMap[e.id]
  27318. }
  27319. ,
  27320. t.prototype.setNeighbour = function(e, t, i) {
  27321. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27322. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27323. this.neighbourMap[e.id][e.id] = !0,
  27324. this.neighbourMap[t.id][t.id] = !0,
  27325. this.neighbourMap[e.id][t.id] = i,
  27326. this.neighbourMap[t.id][e.id] = i,
  27327. this.neighbourMap[e.id]
  27328. }
  27329. ,
  27330. t.prototype.findClosest = function(e, t) {
  27331. var i = [r.filters.isPanoAligned()];
  27332. return t && i.push(r.filters.inDirection(e, t, .75)),
  27333. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  27334. }
  27335. ,
  27336. t.prototype.dualNeighbors = function(e, t) {
  27337. var i, n = [];
  27338. for (i in this.neighbourMap[e.id])
  27339. this.neighbourMap[t.id][i] && n.push(i);
  27340. return n
  27341. }
  27342. ,
  27343. t.prototype.populate_path_graph = function() {
  27344. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  27345. for (e = 0; e < this.list.length; e += 1) {
  27346. for (t in s = !(a = {}),
  27347. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  27348. if (i[t]) {
  27349. o = this.index[t],
  27350. u.copy(r.floorPosition),
  27351. u.sub(o.floorPosition);
  27352. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  27353. , p = (Math.abs(u.y),
  27354. Math.max(d, .01),
  27355. Math.max(0, Math.abs(u.y) - .2));
  27356. n = 0 < p ? (1,
  27357. p = Math.pow(4 * p, 2),
  27358. d = Math.pow(d, 2),
  27359. Math.sqrt(p * p + d * d)) : (1,
  27360. u.length()),
  27361. a[o.id] = n,
  27362. s = !0
  27363. }
  27364. s ? c[r.id] = a : h += 1
  27365. }
  27366. this.map = c,
  27367. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  27368. }
  27369. ,
  27370. t.prototype.aStarSearch = function(e, t) {
  27371. var i = Date.now()
  27372. , n = new o({
  27373. start: e,
  27374. isEnd: function(e) {
  27375. return e === t
  27376. },
  27377. neighbor: function(e) {
  27378. var t = e.neighbourPanos || e.findNeighourPanos()
  27379. , i = [];
  27380. for (var n in t)
  27381. i.push(this.index[n]);
  27382. return i
  27383. }
  27384. .bind(this),
  27385. distance: function(e, t) {
  27386. return this.map[e.id][t.id]
  27387. }
  27388. .bind(this),
  27389. heuristic: function(e, t) {
  27390. return 1
  27391. }
  27392. .bind(this),
  27393. hash: function(e) {
  27394. return e.id
  27395. },
  27396. timeout: 5e3
  27397. });
  27398. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  27399. "success" !== n.status)
  27400. return T.debug("Did not find A* path from " + e + " to " + t),
  27401. null;
  27402. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27403. var r = [];
  27404. return n.path.forEach(function(e) {
  27405. r.push(e.id)
  27406. }),
  27407. r
  27408. }
  27409. ,
  27410. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  27411. g = new w.Vector3,
  27412. m = new w.Vector3,
  27413. v = new w.Vector3,
  27414. y = new w.Vector3,
  27415. A = new w.Vector3,
  27416. C = new w.Vector3,
  27417. I = new w.Vector3,
  27418. E = [],
  27419. _ = new w.Vector3,
  27420. b = new w.Vector3,
  27421. function(e, t) {
  27422. if (e)
  27423. for (var i = function(e, t, i) {
  27424. return y.copy(t).sub(e),
  27425. y.dot(i)
  27426. }, n = function(e, t) {
  27427. return i(_, e.position, m) - i(_, t.position, m)
  27428. }, r = 0; r < e.length - 1; ) {
  27429. var o = e[r]
  27430. , a = e[r + 1]
  27431. , s = this.index[o]
  27432. , l = this.index[a];
  27433. _.copy(s.position),
  27434. b.copy(l.position),
  27435. E.length = 0,
  27436. f.copy(b).sub(_),
  27437. m.copy(f).normalize();
  27438. for (var c = 0; c < this.list.length; c++) {
  27439. var h = this.list[c];
  27440. y.copy(h.position).sub(_);
  27441. var u = y.dot(m);
  27442. 0 < u && (C.copy(m),
  27443. C.multiplyScalar(u),
  27444. A.copy(y),
  27445. A.sub(C),
  27446. A.length() < t && (g.copy(f).negate(),
  27447. v.copy(g).normalize(),
  27448. I.copy(h.position).sub(b),
  27449. 0 < I.dot(v) && E.push(h)))
  27450. }
  27451. if (0 < E.length) {
  27452. E.sort(n);
  27453. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  27454. e[d] = e[d - E.length];
  27455. for (var p = 0; p < E.length; p++)
  27456. e[p + r + 1] = E[p].id
  27457. }
  27458. r += E.length + 1
  27459. }
  27460. }
  27461. ),
  27462. t.prototype.fadeMarkerOpacity = function(e, t) {
  27463. var i = void 0 === e ? a.panorama.markerOpacity : e
  27464. , n = this.list.findIndex(function(e) {
  27465. return e.marker
  27466. });
  27467. if (!(n < 0)) {
  27468. var r = this.list[n].marker.material.opacity;
  27469. if (r !== e) {
  27470. var o = i - r;
  27471. s.trigger({
  27472. func: function(e, t) {
  27473. var i = r + e * o;
  27474. this.forEach(function(e) {
  27475. e.marker && (e.marker.material.opacity = i)
  27476. })
  27477. }
  27478. .bind(this),
  27479. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27480. name: "_fpm"
  27481. })
  27482. }
  27483. }
  27484. }
  27485. ,
  27486. c.exports = t
  27487. }
  27488. ).call(this, "/js/util/PanoramaCollection.js")
  27489. }
  27490. , {
  27491. "../objects/Panorama": 148,
  27492. "../settings": 166,
  27493. "./IndexedCollection": 175,
  27494. "./aStar": 180,
  27495. "./common": 185,
  27496. "./logger": 189,
  27497. "./transitions": 195,
  27498. three: 217
  27499. }],
  27500. 179: [function(e, t, i) {
  27501. "use strict";
  27502. function n() {
  27503. this.actionSequence = [],
  27504. this.actionSequenceInProgress = !1
  27505. }
  27506. function r(e, t, i, n) {
  27507. c.trackAlways("zoom_" + e, {
  27508. from: t,
  27509. to: i,
  27510. pano: n
  27511. })
  27512. }
  27513. var o, a, s, l, c = e("../analytics");
  27514. n.prototype.reset = function(e) {
  27515. this.actionSequenceInProgress = !1,
  27516. this.actionSequence.length = 0
  27517. }
  27518. ,
  27519. n.prototype.addZoomAction = (a = o = null,
  27520. s = !1,
  27521. l = function() {
  27522. if (o = null,
  27523. 0 < this.actionSequence.length) {
  27524. var e = this.actionSequence[0].start
  27525. , t = this.actionSequence[this.actionSequence.length - 1].end;
  27526. 1 === e ? function(e, t) {
  27527. r("initial", 1, e, t)
  27528. }(t, a) : function(e, t, i) {
  27529. r("followup", e, t, i)
  27530. }(e, t, a)
  27531. }
  27532. this.reset()
  27533. }
  27534. ,
  27535. function(e, t, i) {
  27536. if (e !== t) {
  27537. s || (l = l.bind(this),
  27538. s = !0),
  27539. o && (window.clearTimeout(o),
  27540. o = null),
  27541. i === a && this.actionSequenceInProgress || (this.reset(),
  27542. a = i),
  27543. this.actionSequenceInProgress = !0;
  27544. var n = {
  27545. start: e,
  27546. end: t
  27547. };
  27548. this.actionSequence.push(n),
  27549. o = window.setTimeout(l, 150)
  27550. }
  27551. }
  27552. ),
  27553. t.exports = n
  27554. }
  27555. , {
  27556. "../analytics": 4
  27557. }],
  27558. 180: [function(e, t, i) {
  27559. "use strict";
  27560. function g(e) {
  27561. if (void 0 === e.parent)
  27562. return [e.data];
  27563. var t = g(e.parent);
  27564. return t.push(e.data),
  27565. t
  27566. }
  27567. function m(e) {
  27568. return e.toString()
  27569. }
  27570. function v(e, t) {
  27571. return e.f - t.f
  27572. }
  27573. var y = e("Set")
  27574. , A = e("heap")
  27575. , C = e("dict");
  27576. t.exports = function(e) {
  27577. void 0 === e.timeout && (e.timeout = 1 / 0);
  27578. var t = e.hash || m
  27579. , i = {
  27580. data: e.start,
  27581. g: 0,
  27582. h: e.heuristic(e.start)
  27583. }
  27584. , n = i;
  27585. i.f = i.h;
  27586. var r = new y
  27587. , o = new A(v)
  27588. , a = C();
  27589. o.push(i),
  27590. a.set(t(i.data), i);
  27591. for (var s = new Date; o.size(); ) {
  27592. if (new Date - s > e.timeout)
  27593. return {
  27594. status: "timeout",
  27595. cost: n.g,
  27596. path: g(n)
  27597. };
  27598. var l = o.pop();
  27599. if (a.delete(t(l.data)),
  27600. e.isEnd(l.data))
  27601. return {
  27602. status: "success",
  27603. cost: l.g,
  27604. path: g(l)
  27605. };
  27606. r.add(t(l.data));
  27607. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  27608. var u = c[h];
  27609. if (!r.contains(t(u))) {
  27610. var d = l.g + e.distance(l.data, u)
  27611. , p = a.get(t(u))
  27612. , f = !1;
  27613. if (void 0 === p)
  27614. p = {
  27615. data: u
  27616. },
  27617. a.set(t(u), p);
  27618. else {
  27619. if (p.g < d)
  27620. continue;
  27621. f = !0
  27622. }
  27623. p.parent = l,
  27624. p.g = d,
  27625. p.h = e.heuristic(u),
  27626. p.f = d + p.h,
  27627. p.h < n.h && (n = p),
  27628. f ? o.heapify() : o.push(p)
  27629. }
  27630. }
  27631. }
  27632. return {
  27633. status: "noPath",
  27634. cost: n.g,
  27635. path: g(n)
  27636. }
  27637. }
  27638. }
  27639. , {
  27640. Set: 196,
  27641. dict: 210,
  27642. heap: 211
  27643. }],
  27644. 181: [function(i, n, e) {
  27645. (function(e) {
  27646. "use strict";
  27647. function s(e, t, i) {
  27648. function n() {
  27649. l.warn("Retrying ", t),
  27650. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  27651. }
  27652. var r = function(e, t, i) {
  27653. var n = new XMLHttpRequest;
  27654. if (i && "withCredentials"in n)
  27655. n.open(e, t, i);
  27656. else if ("undefined" != typeof XDomainRequest)
  27657. (n = new XDomainRequest).open(e, t);
  27658. else {
  27659. if (i)
  27660. throw "Browser does not support CORS!";
  27661. n.open(e, t)
  27662. }
  27663. return n
  27664. }(e, t, !1);
  27665. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  27666. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  27667. i.responseType)
  27668. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  27669. r.responseType = i.responseType;
  27670. else {
  27671. if ("image/jpeg" !== i.responseType)
  27672. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  27673. r.responseType = "arraybuffer"
  27674. }
  27675. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  27676. i.auth && r.setRequestHeader("Authorization", i.auth),
  27677. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  27678. r.setRequestHeader("Content-Type", "application/json")),
  27679. "object" == typeof i.headers)
  27680. for (var o in i.headers)
  27681. r.setRequestHeader(o, i.headers[o]);
  27682. var a = $.Deferred();
  27683. return r.onreadystatechange = function(e) {
  27684. if (4 === this.readyState)
  27685. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  27686. i.retries++,
  27687. setTimeout(n, 1e3);
  27688. else if (200 === this.status) {
  27689. var t = function(e, t) {
  27690. var i = e.response;
  27691. if ("json" === t && "object" != typeof i)
  27692. try {
  27693. i = JSON.parse(e.responseText)
  27694. } catch (e) {
  27695. return void a.reject({
  27696. error: "Failed parsing JSON"
  27697. })
  27698. }
  27699. else if ("image/jpeg" === t) {
  27700. var n = new Uint8Array(e.response)
  27701. , r = new Blob([n],{
  27702. type: "image/jpeg"
  27703. })
  27704. , o = URL.createObjectURL(r);
  27705. (i = new Image).src = o,
  27706. i.crossOrigin = "Anonymous",
  27707. i.onload = function() {
  27708. URL.revokeObjectURL(o)
  27709. }
  27710. }
  27711. return i
  27712. }(this, i.responseType);
  27713. a.resolve(t)
  27714. } else
  27715. a.reject(this)
  27716. }
  27717. ,
  27718. r.onprogress = function(e) {
  27719. a.notify(e)
  27720. }
  27721. ,
  27722. r.send(i.data),
  27723. a.promise()
  27724. }
  27725. function o(e, t) {
  27726. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  27727. return t.headers && function(t) {
  27728. return Object.keys(t).sort().map(function(e) {
  27729. return {
  27730. key: e,
  27731. value: t[e]
  27732. }
  27733. })
  27734. }(t.headers).forEach(function(e) {
  27735. i += "__" + e.key + ":" + e.value
  27736. }),
  27737. i
  27738. }
  27739. var t = i("./logger")
  27740. , a = i("../ab")
  27741. , l = new t(e);
  27742. window.URL = window.URL || window.webkitURL,
  27743. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  27744. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {},
  27745. n.exports = {
  27746. get: function(e, t) {
  27747. var i, n = void 0 === (t = t || {}).cache || t.cache;
  27748. if (n) {
  27749. var r = function(e, t) {
  27750. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  27751. }(e, t);
  27752. if (r)
  27753. return r
  27754. }
  27755. return i = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : s("GET", e, t),
  27756. n && function(e, t, i) {
  27757. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  27758. }(e, t, i),
  27759. i
  27760. },
  27761. post: function(e, t) {
  27762. return s("POST", e, t)
  27763. },
  27764. patch: function(e, t) {
  27765. return s("PATCH", e, t)
  27766. },
  27767. getImage: function(e, t) {
  27768. function i() {
  27769. l.warn("Retrying ", e),
  27770. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  27771. }
  27772. var n = $.Deferred()
  27773. , r = new Image
  27774. , o = this;
  27775. return e = a.changeIfImageOptimzing(e),
  27776. null != t || (t = 3),
  27777. r.onerror = function() {
  27778. 0 < t ? setTimeout(i, 1e3) : n.reject()
  27779. }
  27780. ,
  27781. r.onload = function() {
  27782. n.resolve(r)
  27783. }
  27784. ,
  27785. r.crossOrigin = "anonymous",
  27786. r.src = e,
  27787. n
  27788. }
  27789. }
  27790. }
  27791. ).call(this, "/js/util/ajax.js")
  27792. }
  27793. , {
  27794. "../ab": 3,
  27795. "./logger": 189
  27796. }],
  27797. 182: [function(e, t, i) {
  27798. "use strict";
  27799. function n(e, t) {
  27800. var i = window.navigator.userAgent.match(e);
  27801. return i = i ? i[1].split(t) : [],
  27802. {
  27803. major: parseInt(i[0]) || 0,
  27804. minor: parseInt(i[1]) || 0,
  27805. patch: parseInt(i[2]) || 0
  27806. }
  27807. }
  27808. var r = e("../exception/DeviceMismatchException");
  27809. t.exports = {
  27810. isFullscreen: function() {
  27811. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  27812. },
  27813. supportsFullscreen: function() {
  27814. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  27815. },
  27816. isPointerLocked: function() {
  27817. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  27818. },
  27819. requestFullscreen: function(e, t) {
  27820. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  27821. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  27822. },
  27823. requestPointerLock: function() {
  27824. var e;
  27825. if (document.fullscreenElement)
  27826. e = document.fullscreenElement();
  27827. else if (document.mozFullscreenElement)
  27828. e = document.mozFullscreenElement();
  27829. else if (document.mozFullScreenElement)
  27830. e = document.mozFullScreenElement();
  27831. else {
  27832. if (!document.webkitFullscreenElement)
  27833. return;
  27834. e = document.webkitFullscreenElement()
  27835. }
  27836. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  27837. e.requestPointerLock(),
  27838. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  27839. },
  27840. exitPointerLock: function() {
  27841. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  27842. document.exitPointerLock()
  27843. },
  27844. exitFullscreen: function() {
  27845. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  27846. },
  27847. details: function() {
  27848. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  27849. return e ? {
  27850. name: e[1],
  27851. version: parseInt(e[2]),
  27852. platform: navigator.platform
  27853. } : {}
  27854. },
  27855. is: function(e) {
  27856. return this.details() && this.details().name === e
  27857. },
  27858. inIframe: function() {
  27859. return window.parent !== window
  27860. },
  27861. aspectRatio: function() {
  27862. var e = $("#player").width() / $("#player").height();
  27863. return isFinite(e) ? e : 0
  27864. },
  27865. userAgent: function() {
  27866. return window.navigator.userAgent
  27867. },
  27868. isMobile: function() {
  27869. var e = navigator.userAgent || navigator.vendor || window.opera;
  27870. 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))
  27871. },
  27872. isLandscape: function() {
  27873. return this.isMobile && 1 < this.aspectRatio()
  27874. },
  27875. isSmallScreen: function() {
  27876. return screen.width / window.devicePixelRatio < 240
  27877. },
  27878. detectIE: function() {
  27879. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  27880. },
  27881. detectSafari: function() {
  27882. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  27883. },
  27884. detectFirefox: function() {
  27885. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  27886. },
  27887. detectChrome: function() {
  27888. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  27889. },
  27890. detectOpera: function() {
  27891. return -1 !== window.navigator.userAgent.indexOf("OPR")
  27892. },
  27893. detectIOS: function() {
  27894. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  27895. },
  27896. detectIPad: function() {
  27897. var e = window.navigator.userAgent;
  27898. return /iPad/.test(e)
  27899. },
  27900. detectIPod: function() {
  27901. var e = window.navigator.userAgent;
  27902. return /iPod/.test(e)
  27903. },
  27904. detectIPhone: function() {
  27905. var e = window.navigator.userAgent;
  27906. return /iPhone/.test(e)
  27907. },
  27908. detectAndroid: function() {
  27909. return -1 !== window.navigator.userAgent.indexOf("Android")
  27910. },
  27911. detectAndroidMobile: function() {
  27912. var e = window.navigator.userAgent;
  27913. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  27914. },
  27915. detectSamsungNative: function() {
  27916. var e = window.navigator.userAgent;
  27917. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  27918. },
  27919. detectSamsungS6: function() {
  27920. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  27921. },
  27922. detectHUAWEI5X: function() {
  27923. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  27924. },
  27925. detectWebVR: function() {
  27926. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  27927. },
  27928. getVRDisplay: function() {
  27929. var t = $.Deferred();
  27930. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  27931. 1 <= e.length && t.resolve(e[0]),
  27932. t.reject(null)
  27933. }),
  27934. t) : t.reject(null)
  27935. },
  27936. iosVersion: function() {
  27937. if (!this.detectIOS())
  27938. throw new r("Did not detect an iDevice");
  27939. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  27940. },
  27941. androidVersion: function() {
  27942. if (!this.detectAndroid())
  27943. throw new r("Did not detect an Android based device");
  27944. return n(/Android ((?:\d+\.?){1,3})/, ".")
  27945. },
  27946. valueFromCookie: function(e, t) {
  27947. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  27948. if (!i)
  27949. return t;
  27950. var n = i[1];
  27951. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  27952. },
  27953. valueFromHash: function(e, t) {
  27954. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  27955. if (!i)
  27956. return t;
  27957. var n = i[1];
  27958. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  27959. }
  27960. }
  27961. }
  27962. , {
  27963. "../exception/DeviceMismatchException": 56
  27964. }],
  27965. 183: [function(i, n, e) {
  27966. (function(e) {
  27967. "use strict";
  27968. var o = i("../controls/serializer")
  27969. , a = i("../util/math")
  27970. , s = i("./browser")
  27971. , l = i("../enum/Viewmode")
  27972. , t = i("../util/logger")
  27973. , c = i("three")
  27974. , h = new t(e);
  27975. n.exports = {
  27976. getStartCameraOptions: function(e, t) {
  27977. var i = function(e) {
  27978. var t = s.valueFromHash("start", "")
  27979. , i = {};
  27980. if ("" !== t) {
  27981. h.debug("Start override found in parameters, trying to parse..."),
  27982. i = function(e) {
  27983. return o.deserialize(e)
  27984. }(t) || {};
  27985. var n = s.valueFromHash("tag", null);
  27986. n && (i.tag = n),
  27987. i.panoId && (i.pano = e.get(i.panoId))
  27988. }
  27989. return i
  27990. }(t);
  27991. if (0 < Object.keys(i).length)
  27992. return i;
  27993. if (e.heroImage)
  27994. i = function(e, t) {
  27995. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  27996. return {};
  27997. var i = {}
  27998. , n = e.heroImage.metadata;
  27999. h.debug("Using start position from thumbnail image"),
  28000. i.position = n.camera_position,
  28001. i.quaternion = n.camera_quaternion;
  28002. try {
  28003. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28004. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28005. } catch (e) {
  28006. h.debug(e.message)
  28007. }
  28008. return i
  28009. }(e, t);
  28010. else if (window.MP_PREFETCHED_MODELDATA.camera_start) {
  28011. var n = window.MP_PREFETCHED_MODELDATA.camera_start;
  28012. try {
  28013. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28014. i.position = (new c.Vector3).fromArray(n.camera.position),
  28015. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28016. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28017. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28018. h.debug("Using camera_start"),
  28019. h.debug("Modeldata pano: ", i.pano.quaternion),
  28020. h.debug("Camera start pano: ", n.pano.quaternion)),
  28021. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28022. } catch (e) {
  28023. h.warn(e.message)
  28024. }
  28025. }
  28026. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28027. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28028. i.pano = t.findClosest(i.position),
  28029. i.quaternion = i.pano.quaternion),
  28030. 0 === Object.keys(i).length) {
  28031. var r = t.list[0];
  28032. r && (i.mode = l.PANORAMA,
  28033. i.pano = r,
  28034. i.position = r.position,
  28035. i.quaternion = r.quaternion,
  28036. h.info("Starting at 1st pano " + r.id))
  28037. }
  28038. return i.mode = i.mode || l.DOLLHOUSE,
  28039. i
  28040. }
  28041. }
  28042. }
  28043. ).call(this, "/js/util/camera.js")
  28044. }
  28045. , {
  28046. "../controls/serializer": 14,
  28047. "../enum/Viewmode": 51,
  28048. "../util/logger": 189,
  28049. "../util/math": 190,
  28050. "./browser": 182,
  28051. three: 217
  28052. }],
  28053. 184: [function(e, t, i) {
  28054. "use strict";
  28055. function r(e, t, i) {
  28056. var n = t
  28057. , r = i;
  28058. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28059. }
  28060. function o(e, t, i) {
  28061. var n = t
  28062. , r = i;
  28063. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28064. }
  28065. var a = e("./MathLight");
  28066. t.exports = {
  28067. clampVFOV: function(e, t, i, n) {
  28068. return t < r(e, i, n) ? o(t, i, n) : e
  28069. },
  28070. getHFOVForCamera: function(e, t, i) {
  28071. return r(e.fov, t, i)
  28072. },
  28073. getHFOVFromVFOV: r,
  28074. getVFOVFromHFOV: o
  28075. }
  28076. }
  28077. , {
  28078. "./MathLight": 176
  28079. }],
  28080. 185: [function(e, t, i) {
  28081. "use strict";
  28082. var a = e("three");
  28083. t.exports = {
  28084. delayOneFrame: function(e) {
  28085. window.setTimeout(e, 1)
  28086. },
  28087. normalizeUrl: function(e) {
  28088. return e.replace("https://", "http://")
  28089. },
  28090. domainFromUrl: function(e) {
  28091. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28092. return t ? t[3] : e
  28093. },
  28094. average: function(e, t) {
  28095. if (0 === e.length)
  28096. return null;
  28097. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28098. i += t ? e[r][t] : e[r],
  28099. n++
  28100. }
  28101. return i / n
  28102. },
  28103. countUnique: function(e) {
  28104. for (var t = {}, i = 0; i < e.length; i++)
  28105. t[e[i]] = 1 + (t[e[i]] || 0);
  28106. return Object.keys(t).length
  28107. },
  28108. averageVectors: function(e, t) {
  28109. var i = new a.Vector3;
  28110. if (0 === e.length)
  28111. return i;
  28112. for (var n = 0, r = 0; r < e.length; r++) {
  28113. var o = t ? e[r][t] : e[r];
  28114. i.add(o),
  28115. n++
  28116. }
  28117. return i.divideScalar(n)
  28118. },
  28119. equalLists: function(e, t) {
  28120. if (e.length !== t.length)
  28121. return !1;
  28122. for (var i = 0; i < e.length; i++)
  28123. if (e[i] !== t[i])
  28124. return !1;
  28125. return !0
  28126. },
  28127. lowerMedian: function(e, t) {
  28128. return 0 === e.length ? null : (t = t || 2,
  28129. e.sort(function(e, t) {
  28130. return e - t
  28131. }),
  28132. e[Math.floor(e.length / t)])
  28133. },
  28134. stableSort: function(e, n) {
  28135. return e.map(function(e, t) {
  28136. return {
  28137. value: e,
  28138. index: t
  28139. }
  28140. }).sort(function(e, t) {
  28141. var i = n(e.value, t.value);
  28142. return 0 !== i ? i : e.index - t.index
  28143. }).map(function(e) {
  28144. return e.value
  28145. })
  28146. },
  28147. filterAll: function(e, i) {
  28148. return e.filter(function(t) {
  28149. return i.every(function(e) {
  28150. return e(t)
  28151. })
  28152. })
  28153. },
  28154. formatDate: function(e) {
  28155. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28156. },
  28157. formatDatetime: function(e) {
  28158. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28159. },
  28160. randomString: function(e) {
  28161. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28162. t += i.charAt(Math.floor(Math.random() * i.length));
  28163. return t
  28164. },
  28165. uint8ToBase64: function(e, t) {
  28166. t && "number" == typeof t || (t = 8192);
  28167. for (var i = [], n = 0; n < e.length; n += t)
  28168. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28169. return btoa(i.join(""))
  28170. },
  28171. uuid4: function e(t) {
  28172. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28173. },
  28174. nth: function(e) {
  28175. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28176. },
  28177. extendObject: function(t, i) {
  28178. return Object.keys(i).forEach(function(e) {
  28179. t[e] = i[e]
  28180. }),
  28181. t
  28182. },
  28183. deepExtend: function e(t) {
  28184. t = t || {};
  28185. for (var i = 1; i < arguments.length; i++) {
  28186. var n = arguments[i];
  28187. if (n)
  28188. for (var r in n)
  28189. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28190. }
  28191. return t
  28192. },
  28193. inherit: function(e, t) {
  28194. e.prototype = Object.create(t.prototype),
  28195. e.prototype.constructor = e
  28196. },
  28197. extend: function(e, t) {
  28198. for (var i in t.prototype)
  28199. e.prototype[i] = t.prototype[i]
  28200. }
  28201. },
  28202. Math.sign = function(e) {
  28203. return e < 0 ? -1 : 1
  28204. }
  28205. }
  28206. , {
  28207. three: 217
  28208. }],
  28209. 186: [function(e, t, i) {
  28210. "use strict";
  28211. var r = {
  28212. linearTween: function(e, t, i, n) {
  28213. return i * e / n + t
  28214. },
  28215. easeInQuad: function(e, t, i, n) {
  28216. return i * (e /= n) * e + t
  28217. },
  28218. easeOutQuad: function(e, t, i, n) {
  28219. return -i * (e /= n) * (e - 2) + t
  28220. },
  28221. easeInOutQuad: function(e, t, i, n) {
  28222. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  28223. },
  28224. easeInCubic: function(e, t, i, n) {
  28225. return i * (e /= n) * e * e + t
  28226. },
  28227. easeOutCubic: function(e, t, i, n) {
  28228. return e /= n,
  28229. i * (--e * e * e + 1) + t
  28230. },
  28231. easeInOutCubic: function(e, t, i, n) {
  28232. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  28233. },
  28234. easeInQuart: function(e, t, i, n) {
  28235. return i * (e /= n) * e * e * e + t
  28236. },
  28237. easeOutQuart: function(e, t, i, n) {
  28238. return e /= n,
  28239. -i * (--e * e * e * e - 1) + t
  28240. },
  28241. easeInOutQuart: function(e, t, i, n) {
  28242. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  28243. },
  28244. easeInQuint: function(e, t, i, n) {
  28245. return i * (e /= n) * e * e * e * e + t
  28246. },
  28247. easeOutQuint: function(e, t, i, n) {
  28248. return e /= n,
  28249. i * (--e * e * e * e * e + 1) + t
  28250. },
  28251. easeInOutQuint: function(e, t, i, n) {
  28252. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  28253. },
  28254. easeInSine: function(e, t, i, n) {
  28255. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28256. },
  28257. easeOutSine: function(e, t, i, n) {
  28258. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28259. },
  28260. easeInOutSine: function(e, t, i, n) {
  28261. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28262. },
  28263. easeInExpo: function(e, t, i, n) {
  28264. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28265. },
  28266. easeOutExpo: function(e, t, i, n) {
  28267. return i * (1 - Math.pow(2, -10 * e / n)) + t
  28268. },
  28269. easeInOutExpo: function(e, t, i, n) {
  28270. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28271. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  28272. },
  28273. easeInCirc: function(e, t, i, n) {
  28274. return e /= n,
  28275. -i * (Math.sqrt(1 - e * e) - 1) + t
  28276. },
  28277. easeOutCirc: function(e, t, i, n) {
  28278. return e /= n,
  28279. e--,
  28280. i * Math.sqrt(1 - e * e) + t
  28281. },
  28282. easeInOutCirc: function(e, t, i, n) {
  28283. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28284. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28285. },
  28286. easeInElastic: function(e, t, i, n) {
  28287. var r = 1.70158
  28288. , o = 0
  28289. , a = i;
  28290. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28291. r = a < Math.abs(i) ? (a = i,
  28292. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28293. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  28294. },
  28295. easeOutElastic: function(e, t, i, n) {
  28296. var r = 1.70158
  28297. , o = 0
  28298. , a = i;
  28299. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28300. r = a < Math.abs(i) ? (a = i,
  28301. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28302. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28303. },
  28304. easeInOutElastic: function(e, t, i, n) {
  28305. var r = 1.70158
  28306. , o = 0
  28307. , a = i;
  28308. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  28309. r = a < Math.abs(i) ? (a = i,
  28310. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28311. 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)
  28312. },
  28313. easeInBack: function(e, t, i, n, r) {
  28314. return void 0 === r && (r = 1.70158),
  28315. i * (e /= n) * e * ((r + 1) * e - r) + t
  28316. },
  28317. easeOutBack: function(e, t, i, n, r) {
  28318. return void 0 === r && (r = 1.70158),
  28319. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28320. },
  28321. easeInOutBack: function(e, t, i, n, r) {
  28322. return void 0 === r && (r = 1.70158),
  28323. (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
  28324. },
  28325. easeOutBounce: function(e, t, i, n) {
  28326. 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
  28327. },
  28328. easeInBounce: function(e, t, i, n) {
  28329. return i - r.easeOutBounce(n - e, 0, i, n) + t
  28330. },
  28331. easeInOutBounce: function(e, t, i, n) {
  28332. 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
  28333. }
  28334. };
  28335. t.exports = r
  28336. }
  28337. , {}],
  28338. 187: [function(e, t, i) {
  28339. "use strict";
  28340. function n() {
  28341. this.events = [],
  28342. this.valid = !1
  28343. }
  28344. var r = e("../enum/Joystick");
  28345. n.prototype.push = function(e, t) {
  28346. this.events.push({
  28347. direction: e,
  28348. pano: t
  28349. }),
  28350. this.valid = !0
  28351. }
  28352. ,
  28353. n.prototype.pop = function(e) {
  28354. var t = this.events.pop();
  28355. return this.events.length < 1 && (this.valid = !1),
  28356. t
  28357. }
  28358. ,
  28359. n.prototype.peek = function() {
  28360. return this.events.length ? this.events[this.events.length - 1] : {
  28361. direction: null,
  28362. pano: null
  28363. }
  28364. }
  28365. ,
  28366. n.prototype.invalidate = function() {
  28367. this.events = [],
  28368. this.valid = !1
  28369. }
  28370. ,
  28371. n.prototype.reversePano = function(e) {
  28372. if (!this.valid)
  28373. return null;
  28374. var t = this.peek();
  28375. return r.opposite(e) === t.direction ? (this.pop(),
  28376. t.pano) : null
  28377. }
  28378. ,
  28379. t.exports = n
  28380. }
  28381. , {
  28382. "../enum/Joystick": 29
  28383. }],
  28384. 188: [function(e, t, i) {
  28385. "use strict";
  28386. t.exports = {
  28387. vector: function(t, i) {
  28388. var n = t.clone();
  28389. return i = i.clone(),
  28390. function(e) {
  28391. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  28392. }
  28393. },
  28394. quaternion: function(t, i) {
  28395. var n = t.clone();
  28396. return function(e) {
  28397. t.copy(n).slerp(i, e)
  28398. }
  28399. },
  28400. property: function(t, i, n, r) {
  28401. var o = t[i];
  28402. return function(e) {
  28403. t[i] = o * (1 - e) + n * e,
  28404. r && r(t[i])
  28405. }
  28406. },
  28407. uniform: function(t, i, n) {
  28408. var r = t.material.uniforms[i].value;
  28409. return function(e) {
  28410. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  28411. }
  28412. },
  28413. matrix4: function(o, a) {
  28414. var s = o.clone();
  28415. return function(e) {
  28416. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  28417. t[r] = i[r] * (1 - e) + n[r] * e
  28418. }
  28419. },
  28420. allUniforms: function(e, t, i) {
  28421. var n = e.map(function(e) {
  28422. return this.uniform(e, t, i)
  28423. }
  28424. .bind(this));
  28425. return function(t) {
  28426. n.forEach(function(e) {
  28427. e(t)
  28428. })
  28429. }
  28430. }
  28431. }
  28432. }
  28433. , {}],
  28434. 189: [function(e, t, i) {
  28435. "use strict";
  28436. function h(n) {
  28437. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  28438. if (h.consoleEnabled) {
  28439. var l = function(e) {
  28440. $("#debug-console").append("<p>" + e + "</p>"),
  28441. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28442. };
  28443. e = function(e) {
  28444. l(Array.prototype.slice.call(arguments).join(" "))
  28445. }
  28446. ,
  28447. t = function(e) {
  28448. l(Array.prototype.slice.call(arguments).join(" "))
  28449. }
  28450. ,
  28451. i = function(e) {
  28452. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28453. }
  28454. ,
  28455. r = function(e) {
  28456. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28457. }
  28458. } else
  28459. console.log ? (e = console.log,
  28460. t = console.info ? console.info : console.log,
  28461. i = console.warn ? console.warn : console.log,
  28462. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  28463. ;
  28464. function c(e) {
  28465. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  28466. }
  28467. return {
  28468. debug: function() {
  28469. h.level >= h.levels.debug && e.apply(console, c(arguments))
  28470. },
  28471. info: function() {
  28472. h.level >= h.levels.info && t.apply(console, c(arguments))
  28473. },
  28474. warn: function() {
  28475. (function(e, t) {
  28476. if (u) {
  28477. var i = Array.prototype.slice.call(e).join(" ");
  28478. u.captureMessage(i, {
  28479. level: t,
  28480. path: n,
  28481. timestamp: h.timestamp()
  28482. })
  28483. }
  28484. }
  28485. )(arguments, "warn"),
  28486. h.level >= h.levels.warn && i.apply(console, c(arguments))
  28487. },
  28488. error: function() {
  28489. (function(e, t) {
  28490. if (u) {
  28491. var i = Array.prototype.slice.call(e).join(" ");
  28492. u.captureException(new Error(i), {
  28493. level: t,
  28494. path: n,
  28495. timestamp: h.timestamp()
  28496. })
  28497. }
  28498. }
  28499. )(arguments, "error"),
  28500. h.level >= h.levels.error && r.apply(console, c(arguments))
  28501. },
  28502. v3str: function(e, t) {
  28503. var i = void 0 === t ? 2 : t;
  28504. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  28505. },
  28506. eulstr: function(e, t) {
  28507. var i = void 0 === t ? 2 : t;
  28508. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  28509. },
  28510. time: function(e) {
  28511. h.level >= h.levels.debug && (s[e] = Date.now())
  28512. },
  28513. timeEnd: function(e) {
  28514. if (h.level >= h.levels.debug) {
  28515. var t = s[e];
  28516. if (!t)
  28517. return;
  28518. var i = (Date.now() - t) / 1e3;
  28519. this.debug(e, i + "s")
  28520. }
  28521. }
  28522. }
  28523. }
  28524. var u = window.Raven;
  28525. h.timestamp = function() {
  28526. return (Date.now() - window.navigationStart) / 1e3 + "s"
  28527. }
  28528. ,
  28529. h.level = (h.levels = {
  28530. debug: 3,
  28531. info: 2,
  28532. warn: 1,
  28533. error: 0
  28534. }).info,
  28535. t.exports = h
  28536. }
  28537. , {}],
  28538. 190: [function(e, t, i) {
  28539. "use strict";
  28540. var o = e("three")
  28541. , r = e("../enum/GLCubeFaces");
  28542. e("../constants");
  28543. t.exports = {
  28544. convertVisionVector: function(e) {
  28545. return new o.Vector3(e.x,e.z,-e.y)
  28546. },
  28547. convertVisionQuaternion: function(e) {
  28548. 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)))
  28549. },
  28550. convertWorkshopVector: function(e) {
  28551. return new o.Vector3(-e.x,e.y,e.z)
  28552. },
  28553. convertWorkshopQuaternion: function(e) {
  28554. 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))
  28555. },
  28556. convertWorkshopPanoramaQuaternion: function(e) {
  28557. 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)))
  28558. },
  28559. convertWorkshopOrthoZoom: function(e) {
  28560. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  28561. },
  28562. toPrecision: function(e, t) {
  28563. function i(e, t) {
  28564. var i = Math.pow(10, t);
  28565. return Math.round(e * i) / i
  28566. }
  28567. if (e instanceof Array) {
  28568. for (var n = 0; n < e.length; n++)
  28569. e[n] = i(e[n], t);
  28570. return e
  28571. }
  28572. return i(e, t)
  28573. },
  28574. isEmptyQuaternion: function(e) {
  28575. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  28576. },
  28577. projectPositionToCanvas: function(e, t, i) {
  28578. (i = i || new o.Vector3).copy(e);
  28579. var n = .5 * $("#player").width()
  28580. , r = .5 * $("#player").height();
  28581. return i.project(t),
  28582. i.x = i.x * n + n,
  28583. i.y = -i.y * r + r,
  28584. i
  28585. },
  28586. convertScreenPositionToNDC: function(e, t, i) {
  28587. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  28588. i.y = -t / $("#player").height() * 2 + 1,
  28589. i
  28590. },
  28591. constrainedTurn: function(e) {
  28592. var t = e % (2 * Math.PI);
  28593. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  28594. },
  28595. getFOVDotThreshold: function(e) {
  28596. return Math.cos(o.Math.degToRad(e / 2))
  28597. },
  28598. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  28599. switch (e) {
  28600. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28601. i.set(1, t.y, t.x);
  28602. break;
  28603. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28604. i.set(-1, t.y, -t.x);
  28605. break;
  28606. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28607. i.set(-t.x, 1, -t.y);
  28608. break;
  28609. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28610. i.set(-t.x, -1, t.y);
  28611. break;
  28612. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28613. i.set(-t.x, t.y, 1);
  28614. break;
  28615. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28616. i.set(t.x, t.y, -1)
  28617. }
  28618. n && i.normalize()
  28619. }
  28620. }
  28621. }
  28622. , {
  28623. "../constants": 8,
  28624. "../enum/GLCubeFaces": 25,
  28625. three: 217
  28626. }],
  28627. 191: [function(e, t, i) {
  28628. "use strict";
  28629. function o(e) {
  28630. return r[e]
  28631. }
  28632. var n = e("../enum/GLCubeFaces")
  28633. , a = [0, 1, 2, 3, 4, 5]
  28634. , r = {
  28635. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28636. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28637. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28638. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28639. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28640. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28641. };
  28642. t.exports = {
  28643. mapFaceToCubemapFace: o,
  28644. getCubemapUrls: function(i, n, r) {
  28645. return a.map(function(e, t) {
  28646. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  28647. }
  28648. .bind(this))
  28649. }
  28650. }
  28651. }
  28652. , {
  28653. "../enum/GLCubeFaces": 25
  28654. }],
  28655. 192: [function(e, t, i) {
  28656. "use strict";
  28657. t.exports = {
  28658. captureErrors: function(e, t, i) {
  28659. if ("Raven"in window) {
  28660. Raven.config(e, t).install(),
  28661. i && Raven.setTagsContext(i);
  28662. var n = console.warn
  28663. , r = console.error;
  28664. console.warn = function() {
  28665. var e = Array.prototype.slice.call(arguments);
  28666. Raven.captureMessage(e.join(" "), {
  28667. level: "warning"
  28668. }),
  28669. n.apply(console, e)
  28670. }
  28671. ,
  28672. console.error = function() {
  28673. var e = Array.prototype.slice.call(arguments);
  28674. Raven.captureException(new Error(e.join(" ")), {
  28675. level: "error"
  28676. }),
  28677. r.apply(console, e)
  28678. }
  28679. } else
  28680. console.error("Raven not found, not capturing errors.")
  28681. }
  28682. }
  28683. }
  28684. , {}],
  28685. 193: [function(c, h, e) {
  28686. (function(e) {
  28687. "use strict";
  28688. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  28689. getAuthorizationHeader: function() {
  28690. var e = n.valueFromHash("auth");
  28691. if (e)
  28692. return e.replace(",", " ");
  28693. var t = n.valueFromCookie("token");
  28694. return t ? "Token " + t : null
  28695. },
  28696. parseSidUrl: function(e) {
  28697. var t, i;
  28698. if (t = g_Prefix,
  28699. (e = e || "").match(/^https?/)) {
  28700. o.parse(e);
  28701. t = g_Prefix,
  28702. i = e
  28703. } else
  28704. i = (t = g_Prefix) + "data/" + e;
  28705. return {
  28706. urlBase: t,
  28707. urlModel: i,
  28708. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  28709. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  28710. }
  28711. },
  28712. getModelIDFromQueryString: function() {
  28713. return n.valueFromHash("model") || n.valueFromHash("m")
  28714. },
  28715. /* normalizeModeldata: function(e, i) {
  28716. e = JSON.parse(JSON.stringify(e));
  28717. var n = null;
  28718. if (e.images.forEach(function(t) {
  28719. if (t.metadata) {
  28720. if ("string" == typeof t.metadata)
  28721. try {
  28722. t.metadata = JSON.parse(t.metadata)
  28723. } catch (e) {
  28724. s.warn("Unable to parse image metadata"),
  28725. t.metadata = null
  28726. }
  28727. else
  28728. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  28729. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  28730. 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)),
  28731. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  28732. t.metadata.zoom = t.metadata.zoom || 1),
  28733. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  28734. }
  28735. }),
  28736. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  28737. var t = {};
  28738. t.pano = {
  28739. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  28740. position: i.convertWorkshopVector(n.scan_position),
  28741. uuid: n.scan_id
  28742. },
  28743. t.camera = {
  28744. quaternion: n.camera_quaternion,
  28745. position: n.camera_position
  28746. },
  28747. e.startPano = t
  28748. }
  28749. return e
  28750. }, */
  28751. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  28752. e = JSON.parse(JSON.stringify(e));
  28753. var i = null;
  28754. if (e.images.forEach(function(n) {
  28755. if(!n.metadata) return;
  28756. if ("string" == typeof n.metadata)
  28757. try {
  28758. n.metadata = JSON.parse(n.metadata)
  28759. } catch (e) {
  28760. s.warn("Unable to parse image metadata"),
  28761. n.metadata = null
  28762. }
  28763. else{
  28764. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  28765. }
  28766. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  28767. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  28768. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  28769. }else{
  28770. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  28771. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  28772. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  28773. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  28774. }
  28775. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  28776. }),
  28777. //icon初始视角的:
  28778. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  28779. var n = {};
  28780. n.pano = {
  28781. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  28782. position: t.convertWorkshopVector(i.scan_position),
  28783. uuid: i.scan_id
  28784. },
  28785. n.camera = {
  28786. quaternion: i.camera_quaternion,
  28787. position: i.camera_position
  28788. },
  28789. e.startPano = n
  28790. }
  28791. return e
  28792. },
  28793. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  28794. function(e) {
  28795. if (!e)
  28796. throw new Error("Vision version is required");
  28797. var t = i.exec(e);
  28798. if (null === t)
  28799. throw new Error("String is not a vision version: " + e);
  28800. return parseInt(t[1])
  28801. }
  28802. ),
  28803. modelDataPromisesTiles: function(e) {
  28804. var t = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version;
  28805. if (t)
  28806. try {
  28807. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  28808. } catch (e) {
  28809. s.warn("Invalid vision version: " + t)
  28810. }
  28811. return !1
  28812. }
  28813. };
  28814. h.exports = l
  28815. }
  28816. ).call(this, "/js/util/showcase.js")
  28817. }
  28818. , {
  28819. "../constants": 8,
  28820. "./browser": 182,
  28821. "./logger": 189,
  28822. three: 217,
  28823. url: 208
  28824. }],
  28825. 194: [function(e, t, i) {
  28826. "use strict";
  28827. var r = e("../util/ajax")
  28828. , o = e("three")
  28829. , a = e("../settings")
  28830. , s = {};
  28831. t.exports = {
  28832. load: function(e, t, i) {
  28833. var n = s[e];
  28834. return n ? t && setTimeout(function() {
  28835. t(n)
  28836. }, 1) : (n = new o.Texture,
  28837. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  28838. n.magFilter = o.LinearFilter,
  28839. n.generateMipmaps = !1),
  28840. n.sourceFile = e,
  28841. s[e] = n,
  28842. r.getImage(e).then(function(e) {
  28843. n.image = e,
  28844. n.needsUpdate = !0,
  28845. t && t(n)
  28846. }).fail(i)),
  28847. n
  28848. },
  28849. loadBase64: function(e, t) {
  28850. t = t || "png";
  28851. var i = new o.Texture;
  28852. return i.image = document.createElement("img"),
  28853. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  28854. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  28855. i.magFilter = o.LinearFilter,
  28856. i.generateMipmaps = !1),
  28857. i.needsUpdate = !0,
  28858. i
  28859. },
  28860. isLoaded: function(e) {
  28861. return !!s[e]
  28862. }
  28863. }
  28864. window.Texture = t.exports
  28865. }
  28866. , {
  28867. "../settings": 166,
  28868. "../util/ajax": 181,
  28869. three: 217
  28870. }],
  28871. 195: [function(e, t, i) {
  28872. "use strict";
  28873. var l = e("./easing");
  28874. t.exports = {
  28875. globalDone: null,
  28876. funcs: [],
  28877. counter: 0,
  28878. uniqueID: 0,
  28879. start: function(e, t, i, n, r, o, a) {
  28880. return n = n || 0,
  28881. this.funcs.push({
  28882. func: e,
  28883. current: -n * Math.abs(t),
  28884. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  28885. done: i,
  28886. easing: r || l.linearTween,
  28887. cycling: t < 0,
  28888. running: !0,
  28889. debug: n < 0,
  28890. name: o || "T" + this.counter,
  28891. id: void 0 === a ? this.counter : a,
  28892. paused: !1
  28893. }),
  28894. e(0, 16),
  28895. this.counter += 1,
  28896. e
  28897. },
  28898. trigger: function(e) {
  28899. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  28900. , i = e.func || function() {}
  28901. , n = void 0 === e.duration ? 0 : e.duration;
  28902. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  28903. var r = e.done || null
  28904. , o = e.easing || l.linearTween
  28905. , a = e.name || "R" + this.counter
  28906. , s = void 0 === e.id ? this.counter : e.id;
  28907. return this.start(i, n, r, t, o, a, s)
  28908. },
  28909. setTimeout: function(e, t, i) {
  28910. var n = void 0 === i ? this.counter : i;
  28911. return this.trigger({
  28912. done: e,
  28913. duration: void 0 === t ? 0 : t,
  28914. name: "O" + this.counter,
  28915. id: n
  28916. })
  28917. },
  28918. pause: function() {
  28919. this.paused = !0
  28920. },
  28921. resume: function() {
  28922. this.paused = !1
  28923. },
  28924. update: function(n) {
  28925. this.funcs.forEach(function(e) {
  28926. if (!(e.paused || (e.current += 1e3 * n,
  28927. e.current < 0)))
  28928. if (e.current >= e.duration && !e.cycling) {
  28929. var t = e.easing(1, 0, 1, 1);
  28930. e.func(t, 1e3 * n),
  28931. e.done && e.done(),
  28932. e.running = !1
  28933. } else {
  28934. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  28935. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  28936. e.running = !1)
  28937. }
  28938. });
  28939. var e = this.funcs.length;
  28940. this.funcs = this.funcs.filter(function(e) {
  28941. return e.running
  28942. });
  28943. var t = this.funcs.length;
  28944. if (0 < e && 0 === t && this.globalDone) {
  28945. var i = this.globalDone;
  28946. this.globalDone = null,
  28947. i()
  28948. }
  28949. },
  28950. adjustSpeed: function(e, t) {
  28951. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  28952. var r = i[n];
  28953. r.duration /= t,
  28954. r.current /= t
  28955. }
  28956. },
  28957. getById: function(t) {
  28958. return this.funcs.filter(function(e) {
  28959. return t === e.id
  28960. })
  28961. },
  28962. get: function(e) {
  28963. for (var t = 0; t < this.funcs.length; t += 1)
  28964. if (this.funcs[t].func === e)
  28965. return this.funcs[t];
  28966. return null
  28967. },
  28968. isRunning: function(e) {
  28969. var t = this.get(e);
  28970. return null !== t && t.running
  28971. },
  28972. countActive: function() {
  28973. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  28974. e += this.funcs[t].running;
  28975. return e
  28976. },
  28977. listActive: function() {
  28978. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  28979. this.funcs[t].running && e.push(this.funcs[t].name);
  28980. return e
  28981. },
  28982. done: function(e) {
  28983. this.globalDone = e
  28984. },
  28985. cancelById: function(e) {
  28986. var t = void 0 === e ? 0 : e;
  28987. this.funcs = this.funcs.filter(function(e) {
  28988. return e.id !== t
  28989. })
  28990. },
  28991. cancel: function(t) {
  28992. this.funcs = this.funcs.filter(function(e) {
  28993. return e.func !== t
  28994. })
  28995. },
  28996. getUniqueId: function() {
  28997. return this.uniqueID -= 1,
  28998. this.uniqueID
  28999. }
  29000. }
  29001. }
  29002. , {
  29003. "./easing": 186
  29004. }],
  29005. 196: [function(e, t, i) {
  29006. function n(e) {
  29007. if (this.set = {},
  29008. this.infContains = function() {
  29009. return !0
  29010. }
  29011. ,
  29012. "object" == typeof e)
  29013. if (e instanceof Array)
  29014. for (var t = 0; t < e.length; t++)
  29015. this.set[e[t]] = !0;
  29016. else
  29017. this.set = e;
  29018. else if ("function" == typeof e)
  29019. this.infContains = e;
  29020. else if (void 0 !== e)
  29021. throw new Error("set must be either an array or an object.")
  29022. }
  29023. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29024. return !!this.set[e]
  29025. }
  29026. ,
  29027. n.prototype.add = function(e) {
  29028. if (1 == arguments.length)
  29029. this.set[e] = !0;
  29030. else
  29031. for (var t = 0; t < arguments.length; t++)
  29032. this.set[arguments[t]] = !0
  29033. }
  29034. ,
  29035. n.prototype.addAll = function(e) {
  29036. if ("object" != typeof e && !(e instanceof Array))
  29037. throw new Error("arr must be an array.");
  29038. for (var t = 0; t < e.length; t++)
  29039. this.add(e[t])
  29040. }
  29041. ,
  29042. n.prototype.delete = n.prototype.remove = function(e) {
  29043. if (1 == arguments.length)
  29044. delete this.set[e];
  29045. else
  29046. for (var t = 0; t < arguments.length; t++)
  29047. delete this.set[arguments[t]]
  29048. }
  29049. ,
  29050. n.prototype.clear = function() {
  29051. this.set = {}
  29052. }
  29053. ,
  29054. n.prototype.size = function() {
  29055. return Object.keys(this.set).length
  29056. }
  29057. ,
  29058. n.prototype.toString = function() {
  29059. return "{" + Object.keys(this.set).toString() + "}"
  29060. }
  29061. ,
  29062. n.prototype["*values"] = n.prototype.toArray = function() {
  29063. return void 0 === this.set ? [] : Object.keys(this.set)
  29064. }
  29065. }
  29066. , {}],
  29067. 197: [function(e, t, i) {}
  29068. , {}],
  29069. 198: [function(N, e, F) {
  29070. (function(e) {
  29071. "use strict";
  29072. function i() {
  29073. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29074. }
  29075. function o(e, t) {
  29076. if (i() < t)
  29077. throw new RangeError("Invalid typed array length");
  29078. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  29079. e.length = t),
  29080. e
  29081. }
  29082. function u(e, t, i) {
  29083. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  29084. return new u(e,t,i);
  29085. if ("number" != typeof e)
  29086. return n(this, e, t, i);
  29087. if ("string" == typeof t)
  29088. throw new Error("If encoding is specified then the first argument must be a string");
  29089. return a(this, e)
  29090. }
  29091. function n(e, t, i, n) {
  29092. if ("number" == typeof t)
  29093. throw new TypeError('"value" argument must not be a number');
  29094. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  29095. if (t.byteLength,
  29096. i < 0 || t.byteLength < i)
  29097. throw new RangeError("'offset' is out of bounds");
  29098. if (t.byteLength < i + (n || 0))
  29099. throw new RangeError("'length' is out of bounds");
  29100. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29101. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  29102. e
  29103. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  29104. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29105. !u.isEncoding(i))
  29106. throw new TypeError('"encoding" must be a valid string encoding');
  29107. var n = 0 | c(t, i)
  29108. , r = (e = o(e, n)).write(t, i);
  29109. return r !== n && (e = e.slice(0, r)),
  29110. e
  29111. }(e, t, i) : function(e, t) {
  29112. if (u.isBuffer(t)) {
  29113. var i = 0 | l(t.length);
  29114. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  29115. e
  29116. }
  29117. if (t) {
  29118. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29119. return "number" != typeof t.length || function(e) {
  29120. return e != e
  29121. }(t.length) ? o(e, 0) : s(e, t);
  29122. if ("Buffer" === t.type && L(t.data))
  29123. return s(e, t.data)
  29124. }
  29125. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29126. }(e, t)
  29127. }
  29128. function r(e) {
  29129. if ("number" != typeof e)
  29130. throw new TypeError('"size" argument must be a number');
  29131. if (e < 0)
  29132. throw new RangeError('"size" argument must not be negative')
  29133. }
  29134. function a(e, t) {
  29135. if (r(t),
  29136. e = o(e, t < 0 ? 0 : 0 | l(t)),
  29137. !u.TYPED_ARRAY_SUPPORT)
  29138. for (var i = 0; i < t; ++i)
  29139. e[i] = 0;
  29140. return e
  29141. }
  29142. function s(e, t) {
  29143. var i = t.length < 0 ? 0 : 0 | l(t.length);
  29144. e = o(e, i);
  29145. for (var n = 0; n < i; n += 1)
  29146. e[n] = 255 & t[n];
  29147. return e
  29148. }
  29149. function l(e) {
  29150. if (e >= i())
  29151. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  29152. return 0 | e
  29153. }
  29154. function c(e, t) {
  29155. if (u.isBuffer(e))
  29156. return e.length;
  29157. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29158. return e.byteLength;
  29159. "string" != typeof e && (e = "" + e);
  29160. var i = e.length;
  29161. if (0 === i)
  29162. return 0;
  29163. for (var n = !1; ; )
  29164. switch (t) {
  29165. case "ascii":
  29166. case "latin1":
  29167. case "binary":
  29168. return i;
  29169. case "utf8":
  29170. case "utf-8":
  29171. case void 0:
  29172. return S(e).length;
  29173. case "ucs2":
  29174. case "ucs-2":
  29175. case "utf16le":
  29176. case "utf-16le":
  29177. return 2 * i;
  29178. case "hex":
  29179. return i >>> 1;
  29180. case "base64":
  29181. return M(e).length;
  29182. default:
  29183. if (n)
  29184. return S(e).length;
  29185. t = ("" + t).toLowerCase(),
  29186. n = !0
  29187. }
  29188. }
  29189. function h(e, t, i) {
  29190. var n = e[t];
  29191. e[t] = e[i],
  29192. e[i] = n
  29193. }
  29194. function d(e, t, i, n, r) {
  29195. if (0 === e.length)
  29196. return -1;
  29197. if ("string" == typeof i ? (n = i,
  29198. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29199. i = +i,
  29200. isNaN(i) && (i = r ? 0 : e.length - 1),
  29201. i < 0 && (i = e.length + i),
  29202. i >= e.length) {
  29203. if (r)
  29204. return -1;
  29205. i = e.length - 1
  29206. } else if (i < 0) {
  29207. if (!r)
  29208. return -1;
  29209. i = 0
  29210. }
  29211. if ("string" == typeof t && (t = u.from(t, n)),
  29212. u.isBuffer(t))
  29213. return 0 === t.length ? -1 : p(e, t, i, n, r);
  29214. if ("number" == typeof t)
  29215. return t &= 255,
  29216. 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);
  29217. throw new TypeError("val must be string, number or Buffer")
  29218. }
  29219. function p(e, t, i, n, r) {
  29220. function o(e, t) {
  29221. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29222. }
  29223. var a, s = 1, l = e.length, c = t.length;
  29224. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29225. if (e.length < 2 || t.length < 2)
  29226. return -1;
  29227. l /= s = 2,
  29228. c /= 2,
  29229. i /= 2
  29230. }
  29231. if (r) {
  29232. var h = -1;
  29233. for (a = i; a < l; a++)
  29234. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  29235. if (-1 === h && (h = a),
  29236. a - h + 1 === c)
  29237. return h * s
  29238. } else
  29239. -1 !== h && (a -= a - h),
  29240. h = -1
  29241. } else
  29242. for (l < i + c && (i = l - c),
  29243. a = i; 0 <= a; a--) {
  29244. for (var u = !0, d = 0; d < c; d++)
  29245. if (o(e, a + d) !== o(t, d)) {
  29246. u = !1;
  29247. break
  29248. }
  29249. if (u)
  29250. return a
  29251. }
  29252. return -1
  29253. }
  29254. function g(e, t, i, n) {
  29255. i = Number(i) || 0;
  29256. var r = e.length - i;
  29257. n ? r < (n = Number(n)) && (n = r) : n = r;
  29258. var o = t.length;
  29259. if (o % 2 != 0)
  29260. throw new TypeError("Invalid hex string");
  29261. o / 2 < n && (n = o / 2);
  29262. for (var a = 0; a < n; ++a) {
  29263. var s = parseInt(t.substr(2 * a, 2), 16);
  29264. if (isNaN(s))
  29265. return a;
  29266. e[i + a] = s
  29267. }
  29268. return a
  29269. }
  29270. function m(e, t, i, n) {
  29271. return R(function(e) {
  29272. for (var t = [], i = 0; i < e.length; ++i)
  29273. t.push(255 & e.charCodeAt(i));
  29274. return t
  29275. }(t), e, i, n)
  29276. }
  29277. function f(e, t, i) {
  29278. i = Math.min(e.length, i);
  29279. for (var n = [], r = t; r < i; ) {
  29280. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  29281. if (r + u <= i)
  29282. switch (u) {
  29283. case 1:
  29284. c < 128 && (h = c);
  29285. break;
  29286. case 2:
  29287. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  29288. break;
  29289. case 3:
  29290. o = e[r + 1],
  29291. a = e[r + 2],
  29292. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  29293. break;
  29294. case 4:
  29295. o = e[r + 1],
  29296. a = e[r + 2],
  29297. s = e[r + 3],
  29298. 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))
  29299. }
  29300. null === h ? (h = 65533,
  29301. u = 1) : 65535 < h && (h -= 65536,
  29302. n.push(h >>> 10 & 1023 | 55296),
  29303. h = 56320 | 1023 & h),
  29304. n.push(h),
  29305. r += u
  29306. }
  29307. return function(e) {
  29308. var t = e.length;
  29309. if (t <= D)
  29310. return String.fromCharCode.apply(String, e);
  29311. for (var i = "", n = 0; n < t; )
  29312. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  29313. return i
  29314. }(n)
  29315. }
  29316. function v(e, t, i) {
  29317. var n = "";
  29318. i = Math.min(e.length, i);
  29319. for (var r = t; r < i; ++r)
  29320. n += String.fromCharCode(127 & e[r]);
  29321. return n
  29322. }
  29323. function y(e, t, i) {
  29324. var n = "";
  29325. i = Math.min(e.length, i);
  29326. for (var r = t; r < i; ++r)
  29327. n += String.fromCharCode(e[r]);
  29328. return n
  29329. }
  29330. function A(e, t, i) {
  29331. var n, r = e.length;
  29332. (!t || t < 0) && (t = 0),
  29333. (!i || i < 0 || r < i) && (i = r);
  29334. for (var o = "", a = t; a < i; ++a)
  29335. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  29336. return o
  29337. }
  29338. function C(e, t, i) {
  29339. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29340. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29341. return r
  29342. }
  29343. function I(e, t, i) {
  29344. if (e % 1 != 0 || e < 0)
  29345. throw new RangeError("offset is not uint");
  29346. if (i < e + t)
  29347. throw new RangeError("Trying to access beyond buffer length")
  29348. }
  29349. function E(e, t, i, n, r, o) {
  29350. if (!u.isBuffer(e))
  29351. throw new TypeError('"buffer" argument must be a Buffer instance');
  29352. if (r < t || t < o)
  29353. throw new RangeError('"value" argument is out of bounds');
  29354. if (i + n > e.length)
  29355. throw new RangeError("Index out of range")
  29356. }
  29357. function _(e, t, i, n) {
  29358. t < 0 && (t = 65535 + t + 1);
  29359. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29360. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29361. }
  29362. function b(e, t, i, n) {
  29363. t < 0 && (t = 4294967295 + t + 1);
  29364. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29365. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29366. }
  29367. function w(e, t, i, n) {
  29368. if (i + n > e.length)
  29369. throw new RangeError("Index out of range");
  29370. if (i < 0)
  29371. throw new RangeError("Index out of range")
  29372. }
  29373. function T(e, t, i, n, r) {
  29374. return r || w(e, 0, i, 4),
  29375. O.write(e, t, i, n, 23, 4),
  29376. i + 4
  29377. }
  29378. function x(e, t, i, n, r) {
  29379. return r || w(e, 0, i, 8),
  29380. O.write(e, t, i, n, 52, 8),
  29381. i + 8
  29382. }
  29383. function S(e, t) {
  29384. t = t || 1 / 0;
  29385. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29386. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  29387. if (!r) {
  29388. if (56319 < i) {
  29389. -1 < (t -= 3) && o.push(239, 191, 189);
  29390. continue
  29391. }
  29392. if (a + 1 === n) {
  29393. -1 < (t -= 3) && o.push(239, 191, 189);
  29394. continue
  29395. }
  29396. r = i;
  29397. continue
  29398. }
  29399. if (i < 56320) {
  29400. -1 < (t -= 3) && o.push(239, 191, 189),
  29401. r = i;
  29402. continue
  29403. }
  29404. i = 65536 + (r - 55296 << 10 | i - 56320)
  29405. } else
  29406. r && -1 < (t -= 3) && o.push(239, 191, 189);
  29407. if (r = null,
  29408. i < 128) {
  29409. if ((t -= 1) < 0)
  29410. break;
  29411. o.push(i)
  29412. } else if (i < 2048) {
  29413. if ((t -= 2) < 0)
  29414. break;
  29415. o.push(i >> 6 | 192, 63 & i | 128)
  29416. } else if (i < 65536) {
  29417. if ((t -= 3) < 0)
  29418. break;
  29419. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29420. } else {
  29421. if (!(i < 1114112))
  29422. throw new Error("Invalid code point");
  29423. if ((t -= 4) < 0)
  29424. break;
  29425. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29426. }
  29427. }
  29428. return o
  29429. }
  29430. function M(e) {
  29431. return P.toByteArray(function(e) {
  29432. if ((e = function(e) {
  29433. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29434. }(e).replace(t, "")).length < 2)
  29435. return "";
  29436. for (; e.length % 4 != 0; )
  29437. e += "=";
  29438. return e
  29439. }(e))
  29440. }
  29441. function R(e, t, i, n) {
  29442. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29443. t[r + i] = e[r];
  29444. return r
  29445. }
  29446. var P = N("base64-js")
  29447. , O = N("ieee754")
  29448. , L = N("isarray");
  29449. F.Buffer = u,
  29450. F.SlowBuffer = function(e) {
  29451. return +e != e && (e = 0),
  29452. u.alloc(+e)
  29453. }
  29454. ,
  29455. F.INSPECT_MAX_BYTES = 50,
  29456. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  29457. try {
  29458. var e = new Uint8Array(1);
  29459. return e.__proto__ = {
  29460. __proto__: Uint8Array.prototype,
  29461. foo: function() {
  29462. return 42
  29463. }
  29464. },
  29465. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  29466. } catch (e) {
  29467. return !1
  29468. }
  29469. }(),
  29470. F.kMaxLength = i(),
  29471. u.poolSize = 8192,
  29472. u._augment = function(e) {
  29473. return e.__proto__ = u.prototype,
  29474. e
  29475. }
  29476. ,
  29477. u.from = function(e, t, i) {
  29478. return n(null, e, t, i)
  29479. }
  29480. ,
  29481. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  29482. u.__proto__ = Uint8Array,
  29483. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  29484. value: null,
  29485. configurable: !0
  29486. })),
  29487. u.alloc = function(e, t, i) {
  29488. return function(e, t, i, n) {
  29489. return r(t),
  29490. 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)
  29491. }(null, e, t, i)
  29492. }
  29493. ,
  29494. u.allocUnsafe = function(e) {
  29495. return a(null, e)
  29496. }
  29497. ,
  29498. u.allocUnsafeSlow = function(e) {
  29499. return a(null, e)
  29500. }
  29501. ,
  29502. u.isBuffer = function(e) {
  29503. return !(null == e || !e._isBuffer)
  29504. }
  29505. ,
  29506. u.compare = function(e, t) {
  29507. if (!u.isBuffer(e) || !u.isBuffer(t))
  29508. throw new TypeError("Arguments must be Buffers");
  29509. if (e === t)
  29510. return 0;
  29511. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  29512. if (e[r] !== t[r]) {
  29513. i = e[r],
  29514. n = t[r];
  29515. break
  29516. }
  29517. return i < n ? -1 : n < i ? 1 : 0
  29518. }
  29519. ,
  29520. u.isEncoding = function(e) {
  29521. switch (String(e).toLowerCase()) {
  29522. case "hex":
  29523. case "utf8":
  29524. case "utf-8":
  29525. case "ascii":
  29526. case "latin1":
  29527. case "binary":
  29528. case "base64":
  29529. case "ucs2":
  29530. case "ucs-2":
  29531. case "utf16le":
  29532. case "utf-16le":
  29533. return !0;
  29534. default:
  29535. return !1
  29536. }
  29537. }
  29538. ,
  29539. u.concat = function(e, t) {
  29540. if (!L(e))
  29541. throw new TypeError('"list" argument must be an Array of Buffers');
  29542. if (0 === e.length)
  29543. return u.alloc(0);
  29544. var i;
  29545. if (void 0 === t)
  29546. for (i = t = 0; i < e.length; ++i)
  29547. t += e[i].length;
  29548. var n = u.allocUnsafe(t)
  29549. , r = 0;
  29550. for (i = 0; i < e.length; ++i) {
  29551. var o = e[i];
  29552. if (!u.isBuffer(o))
  29553. throw new TypeError('"list" argument must be an Array of Buffers');
  29554. o.copy(n, r),
  29555. r += o.length
  29556. }
  29557. return n
  29558. }
  29559. ,
  29560. u.byteLength = c,
  29561. u.prototype._isBuffer = !0,
  29562. u.prototype.swap16 = function() {
  29563. var e = this.length;
  29564. if (e % 2 != 0)
  29565. throw new RangeError("Buffer size must be a multiple of 16-bits");
  29566. for (var t = 0; t < e; t += 2)
  29567. h(this, t, t + 1);
  29568. return this
  29569. }
  29570. ,
  29571. u.prototype.swap32 = function() {
  29572. var e = this.length;
  29573. if (e % 4 != 0)
  29574. throw new RangeError("Buffer size must be a multiple of 32-bits");
  29575. for (var t = 0; t < e; t += 4)
  29576. h(this, t, t + 3),
  29577. h(this, t + 1, t + 2);
  29578. return this
  29579. }
  29580. ,
  29581. u.prototype.swap64 = function() {
  29582. var e = this.length;
  29583. if (e % 8 != 0)
  29584. throw new RangeError("Buffer size must be a multiple of 64-bits");
  29585. for (var t = 0; t < e; t += 8)
  29586. h(this, t, t + 7),
  29587. h(this, t + 1, t + 6),
  29588. h(this, t + 2, t + 5),
  29589. h(this, t + 3, t + 4);
  29590. return this
  29591. }
  29592. ,
  29593. u.prototype.toString = function() {
  29594. var e = 0 | this.length;
  29595. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  29596. var n, r, o, a = !1;
  29597. if ((void 0 === t || t < 0) && (t = 0),
  29598. t > this.length)
  29599. return "";
  29600. if ((void 0 === i || i > this.length) && (i = this.length),
  29601. i <= 0)
  29602. return "";
  29603. if ((i >>>= 0) <= (t >>>= 0))
  29604. return "";
  29605. for (e = e || "utf8"; ; )
  29606. switch (e) {
  29607. case "hex":
  29608. return A(this, t, i);
  29609. case "utf8":
  29610. case "utf-8":
  29611. return f(this, t, i);
  29612. case "ascii":
  29613. return v(this, t, i);
  29614. case "latin1":
  29615. case "binary":
  29616. return y(this, t, i);
  29617. case "base64":
  29618. return n = this,
  29619. o = i,
  29620. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  29621. case "ucs2":
  29622. case "ucs-2":
  29623. case "utf16le":
  29624. case "utf-16le":
  29625. return C(this, t, i);
  29626. default:
  29627. if (a)
  29628. throw new TypeError("Unknown encoding: " + e);
  29629. e = (e + "").toLowerCase(),
  29630. a = !0
  29631. }
  29632. }
  29633. .apply(this, arguments)
  29634. }
  29635. ,
  29636. u.prototype.equals = function(e) {
  29637. if (!u.isBuffer(e))
  29638. throw new TypeError("Argument must be a Buffer");
  29639. return this === e || 0 === u.compare(this, e)
  29640. }
  29641. ,
  29642. u.prototype.inspect = function() {
  29643. var e = ""
  29644. , t = F.INSPECT_MAX_BYTES;
  29645. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  29646. this.length > t && (e += " ... ")),
  29647. "<Buffer " + e + ">"
  29648. }
  29649. ,
  29650. u.prototype.compare = function(e, t, i, n, r) {
  29651. if (!u.isBuffer(e))
  29652. throw new TypeError("Argument must be a Buffer");
  29653. if (void 0 === t && (t = 0),
  29654. void 0 === i && (i = e ? e.length : 0),
  29655. void 0 === n && (n = 0),
  29656. void 0 === r && (r = this.length),
  29657. t < 0 || i > e.length || n < 0 || r > this.length)
  29658. throw new RangeError("out of range index");
  29659. if (r <= n && i <= t)
  29660. return 0;
  29661. if (r <= n)
  29662. return -1;
  29663. if (i <= t)
  29664. return 1;
  29665. if (this === e)
  29666. return 0;
  29667. 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)
  29668. if (l[h] !== c[h]) {
  29669. o = l[h],
  29670. a = c[h];
  29671. break
  29672. }
  29673. return o < a ? -1 : a < o ? 1 : 0
  29674. }
  29675. ,
  29676. u.prototype.includes = function(e, t, i) {
  29677. return -1 !== this.indexOf(e, t, i)
  29678. }
  29679. ,
  29680. u.prototype.indexOf = function(e, t, i) {
  29681. return d(this, e, t, i, !0)
  29682. }
  29683. ,
  29684. u.prototype.lastIndexOf = function(e, t, i) {
  29685. return d(this, e, t, i, !1)
  29686. }
  29687. ,
  29688. u.prototype.write = function(e, t, i, n) {
  29689. if (void 0 === t)
  29690. n = "utf8",
  29691. i = this.length,
  29692. t = 0;
  29693. else if (void 0 === i && "string" == typeof t)
  29694. n = t,
  29695. i = this.length,
  29696. t = 0;
  29697. else {
  29698. if (!isFinite(t))
  29699. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  29700. t |= 0,
  29701. isFinite(i) ? (i |= 0,
  29702. void 0 === n && (n = "utf8")) : (n = i,
  29703. i = void 0)
  29704. }
  29705. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  29706. if ((void 0 === i || p < i) && (i = p),
  29707. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  29708. throw new RangeError("Attempt to write outside buffer bounds");
  29709. n = n || "utf8";
  29710. for (var f = !1; ; )
  29711. switch (n) {
  29712. case "hex":
  29713. return g(this, e, t, i);
  29714. case "utf8":
  29715. case "utf-8":
  29716. return u = t,
  29717. d = i,
  29718. R(S(e, (h = this).length - u), h, u, d);
  29719. case "ascii":
  29720. return m(this, e, t, i);
  29721. case "latin1":
  29722. case "binary":
  29723. return m(this, e, t, i);
  29724. case "base64":
  29725. return s = this,
  29726. l = t,
  29727. c = i,
  29728. R(M(e), s, l, c);
  29729. case "ucs2":
  29730. case "ucs-2":
  29731. case "utf16le":
  29732. case "utf-16le":
  29733. return o = t,
  29734. a = i,
  29735. R(function(e, t) {
  29736. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  29737. i = e.charCodeAt(a),
  29738. n = i >> 8,
  29739. r = i % 256,
  29740. o.push(r),
  29741. o.push(n);
  29742. return o
  29743. }(e, (r = this).length - o), r, o, a);
  29744. default:
  29745. if (f)
  29746. throw new TypeError("Unknown encoding: " + n);
  29747. n = ("" + n).toLowerCase(),
  29748. f = !0
  29749. }
  29750. }
  29751. ,
  29752. u.prototype.toJSON = function() {
  29753. return {
  29754. type: "Buffer",
  29755. data: Array.prototype.slice.call(this._arr || this, 0)
  29756. }
  29757. }
  29758. ;
  29759. var D = 4096;
  29760. u.prototype.slice = function(e, t) {
  29761. var i, n = this.length;
  29762. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  29763. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  29764. t < e && (t = e),
  29765. u.TYPED_ARRAY_SUPPORT)
  29766. (i = this.subarray(e, t)).__proto__ = u.prototype;
  29767. else {
  29768. var r = t - e;
  29769. i = new u(r,void 0);
  29770. for (var o = 0; o < r; ++o)
  29771. i[o] = this[o + e]
  29772. }
  29773. return i
  29774. }
  29775. ,
  29776. u.prototype.readUIntLE = function(e, t, i) {
  29777. e |= 0,
  29778. t |= 0,
  29779. i || I(e, t, this.length);
  29780. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  29781. n += this[e + o] * r;
  29782. return n
  29783. }
  29784. ,
  29785. u.prototype.readUIntBE = function(e, t, i) {
  29786. e |= 0,
  29787. t |= 0,
  29788. i || I(e, t, this.length);
  29789. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  29790. n += this[e + --t] * r;
  29791. return n
  29792. }
  29793. ,
  29794. u.prototype.readUInt8 = function(e, t) {
  29795. return t || I(e, 1, this.length),
  29796. this[e]
  29797. }
  29798. ,
  29799. u.prototype.readUInt16LE = function(e, t) {
  29800. return t || I(e, 2, this.length),
  29801. this[e] | this[e + 1] << 8
  29802. }
  29803. ,
  29804. u.prototype.readUInt16BE = function(e, t) {
  29805. return t || I(e, 2, this.length),
  29806. this[e] << 8 | this[e + 1]
  29807. }
  29808. ,
  29809. u.prototype.readUInt32LE = function(e, t) {
  29810. return t || I(e, 4, this.length),
  29811. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  29812. }
  29813. ,
  29814. u.prototype.readUInt32BE = function(e, t) {
  29815. return t || I(e, 4, this.length),
  29816. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  29817. }
  29818. ,
  29819. u.prototype.readIntLE = function(e, t, i) {
  29820. e |= 0,
  29821. t |= 0,
  29822. i || I(e, t, this.length);
  29823. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  29824. n += this[e + o] * r;
  29825. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  29826. n
  29827. }
  29828. ,
  29829. u.prototype.readIntBE = function(e, t, i) {
  29830. e |= 0,
  29831. t |= 0,
  29832. i || I(e, t, this.length);
  29833. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  29834. o += this[e + --n] * r;
  29835. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  29836. o
  29837. }
  29838. ,
  29839. u.prototype.readInt8 = function(e, t) {
  29840. return t || I(e, 1, this.length),
  29841. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  29842. }
  29843. ,
  29844. u.prototype.readInt16LE = function(e, t) {
  29845. t || I(e, 2, this.length);
  29846. var i = this[e] | this[e + 1] << 8;
  29847. return 32768 & i ? 4294901760 | i : i
  29848. }
  29849. ,
  29850. u.prototype.readInt16BE = function(e, t) {
  29851. t || I(e, 2, this.length);
  29852. var i = this[e + 1] | this[e] << 8;
  29853. return 32768 & i ? 4294901760 | i : i
  29854. }
  29855. ,
  29856. u.prototype.readInt32LE = function(e, t) {
  29857. return t || I(e, 4, this.length),
  29858. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  29859. }
  29860. ,
  29861. u.prototype.readInt32BE = function(e, t) {
  29862. return t || I(e, 4, this.length),
  29863. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  29864. }
  29865. ,
  29866. u.prototype.readFloatLE = function(e, t) {
  29867. return t || I(e, 4, this.length),
  29868. O.read(this, e, !0, 23, 4)
  29869. }
  29870. ,
  29871. u.prototype.readFloatBE = function(e, t) {
  29872. return t || I(e, 4, this.length),
  29873. O.read(this, e, !1, 23, 4)
  29874. }
  29875. ,
  29876. u.prototype.readDoubleLE = function(e, t) {
  29877. return t || I(e, 8, this.length),
  29878. O.read(this, e, !0, 52, 8)
  29879. }
  29880. ,
  29881. u.prototype.readDoubleBE = function(e, t) {
  29882. return t || I(e, 8, this.length),
  29883. O.read(this, e, !1, 52, 8)
  29884. }
  29885. ,
  29886. u.prototype.writeUIntLE = function(e, t, i, n) {
  29887. e = +e,
  29888. t |= 0,
  29889. i |= 0,
  29890. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  29891. var r = 1
  29892. , o = 0;
  29893. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  29894. this[t + o] = e / r & 255;
  29895. return t + i
  29896. }
  29897. ,
  29898. u.prototype.writeUIntBE = function(e, t, i, n) {
  29899. e = +e,
  29900. t |= 0,
  29901. i |= 0,
  29902. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  29903. var r = i - 1
  29904. , o = 1;
  29905. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  29906. this[t + r] = e / o & 255;
  29907. return t + i
  29908. }
  29909. ,
  29910. u.prototype.writeUInt8 = function(e, t, i) {
  29911. return e = +e,
  29912. t |= 0,
  29913. i || E(this, e, t, 1, 255, 0),
  29914. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  29915. this[t] = 255 & e,
  29916. t + 1
  29917. }
  29918. ,
  29919. u.prototype.writeUInt16LE = function(e, t, i) {
  29920. return e = +e,
  29921. t |= 0,
  29922. i || E(this, e, t, 2, 65535, 0),
  29923. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  29924. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  29925. t + 2
  29926. }
  29927. ,
  29928. u.prototype.writeUInt16BE = function(e, t, i) {
  29929. return e = +e,
  29930. t |= 0,
  29931. i || E(this, e, t, 2, 65535, 0),
  29932. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  29933. this[t + 1] = 255 & e) : _(this, e, t, !1),
  29934. t + 2
  29935. }
  29936. ,
  29937. u.prototype.writeUInt32LE = function(e, t, i) {
  29938. return e = +e,
  29939. t |= 0,
  29940. i || E(this, e, t, 4, 4294967295, 0),
  29941. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  29942. this[t + 2] = e >>> 16,
  29943. this[t + 1] = e >>> 8,
  29944. this[t] = 255 & e) : b(this, e, t, !0),
  29945. t + 4
  29946. }
  29947. ,
  29948. u.prototype.writeUInt32BE = function(e, t, i) {
  29949. return e = +e,
  29950. t |= 0,
  29951. i || E(this, e, t, 4, 4294967295, 0),
  29952. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  29953. this[t + 1] = e >>> 16,
  29954. this[t + 2] = e >>> 8,
  29955. this[t + 3] = 255 & e) : b(this, e, t, !1),
  29956. t + 4
  29957. }
  29958. ,
  29959. u.prototype.writeIntLE = function(e, t, i, n) {
  29960. if (e = +e,
  29961. t |= 0,
  29962. !n) {
  29963. var r = Math.pow(2, 8 * i - 1);
  29964. E(this, e, t, i, r - 1, -r)
  29965. }
  29966. var o = 0
  29967. , a = 1
  29968. , s = 0;
  29969. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  29970. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  29971. this[t + o] = (e / a >> 0) - s & 255;
  29972. return t + i
  29973. }
  29974. ,
  29975. u.prototype.writeIntBE = function(e, t, i, n) {
  29976. if (e = +e,
  29977. t |= 0,
  29978. !n) {
  29979. var r = Math.pow(2, 8 * i - 1);
  29980. E(this, e, t, i, r - 1, -r)
  29981. }
  29982. var o = i - 1
  29983. , a = 1
  29984. , s = 0;
  29985. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  29986. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  29987. this[t + o] = (e / a >> 0) - s & 255;
  29988. return t + i
  29989. }
  29990. ,
  29991. u.prototype.writeInt8 = function(e, t, i) {
  29992. return e = +e,
  29993. t |= 0,
  29994. i || E(this, e, t, 1, 127, -128),
  29995. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  29996. e < 0 && (e = 255 + e + 1),
  29997. this[t] = 255 & e,
  29998. t + 1
  29999. }
  30000. ,
  30001. u.prototype.writeInt16LE = function(e, t, i) {
  30002. return e = +e,
  30003. t |= 0,
  30004. i || E(this, e, t, 2, 32767, -32768),
  30005. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30006. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30007. t + 2
  30008. }
  30009. ,
  30010. u.prototype.writeInt16BE = function(e, t, i) {
  30011. return e = +e,
  30012. t |= 0,
  30013. i || E(this, e, t, 2, 32767, -32768),
  30014. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30015. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30016. t + 2
  30017. }
  30018. ,
  30019. u.prototype.writeInt32LE = function(e, t, i) {
  30020. return e = +e,
  30021. t |= 0,
  30022. i || E(this, e, t, 4, 2147483647, -2147483648),
  30023. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30024. this[t + 1] = e >>> 8,
  30025. this[t + 2] = e >>> 16,
  30026. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30027. t + 4
  30028. }
  30029. ,
  30030. u.prototype.writeInt32BE = function(e, t, i) {
  30031. return e = +e,
  30032. t |= 0,
  30033. i || E(this, e, t, 4, 2147483647, -2147483648),
  30034. e < 0 && (e = 4294967295 + e + 1),
  30035. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30036. this[t + 1] = e >>> 16,
  30037. this[t + 2] = e >>> 8,
  30038. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30039. t + 4
  30040. }
  30041. ,
  30042. u.prototype.writeFloatLE = function(e, t, i) {
  30043. return T(this, e, t, !0, i)
  30044. }
  30045. ,
  30046. u.prototype.writeFloatBE = function(e, t, i) {
  30047. return T(this, e, t, !1, i)
  30048. }
  30049. ,
  30050. u.prototype.writeDoubleLE = function(e, t, i) {
  30051. return x(this, e, t, !0, i)
  30052. }
  30053. ,
  30054. u.prototype.writeDoubleBE = function(e, t, i) {
  30055. return x(this, e, t, !1, i)
  30056. }
  30057. ,
  30058. u.prototype.copy = function(e, t, i, n) {
  30059. if (i = i || 0,
  30060. n || 0 === n || (n = this.length),
  30061. t >= e.length && (t = e.length),
  30062. t = t || 0,
  30063. 0 < n && n < i && (n = i),
  30064. n === i)
  30065. return 0;
  30066. if (0 === e.length || 0 === this.length)
  30067. return 0;
  30068. if (t < 0)
  30069. throw new RangeError("targetStart out of bounds");
  30070. if (i < 0 || i >= this.length)
  30071. throw new RangeError("sourceStart out of bounds");
  30072. if (n < 0)
  30073. throw new RangeError("sourceEnd out of bounds");
  30074. n > this.length && (n = this.length),
  30075. e.length - t < n - i && (n = e.length - t + i);
  30076. var r, o = n - i;
  30077. if (this === e && i < t && t < n)
  30078. for (r = o - 1; 0 <= r; --r)
  30079. e[r + t] = this[r + i];
  30080. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  30081. for (r = 0; r < o; ++r)
  30082. e[r + t] = this[r + i];
  30083. else
  30084. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30085. return o
  30086. }
  30087. ,
  30088. u.prototype.fill = function(e, t, i, n) {
  30089. if ("string" == typeof e) {
  30090. if ("string" == typeof t ? (n = t,
  30091. t = 0,
  30092. i = this.length) : "string" == typeof i && (n = i,
  30093. i = this.length),
  30094. 1 === e.length) {
  30095. var r = e.charCodeAt(0);
  30096. r < 256 && (e = r)
  30097. }
  30098. if (void 0 !== n && "string" != typeof n)
  30099. throw new TypeError("encoding must be a string");
  30100. if ("string" == typeof n && !u.isEncoding(n))
  30101. throw new TypeError("Unknown encoding: " + n)
  30102. } else
  30103. "number" == typeof e && (e &= 255);
  30104. if (t < 0 || this.length < t || this.length < i)
  30105. throw new RangeError("Out of range index");
  30106. if (i <= t)
  30107. return this;
  30108. var o;
  30109. if (t >>>= 0,
  30110. i = void 0 === i ? this.length : i >>> 0,
  30111. "number" == typeof (e = e || 0))
  30112. for (o = t; o < i; ++o)
  30113. this[o] = e;
  30114. else {
  30115. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  30116. , s = a.length;
  30117. for (o = 0; o < i - t; ++o)
  30118. this[o + t] = a[o % s]
  30119. }
  30120. return this
  30121. }
  30122. ;
  30123. var t = /[^+\/0-9A-Za-z-_]/g
  30124. }
  30125. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30126. }
  30127. , {
  30128. "base64-js": 199,
  30129. ieee754: 200,
  30130. isarray: 201
  30131. }],
  30132. 199: [function(e, t, i) {
  30133. "use strict";
  30134. function l(e) {
  30135. var t = e.length;
  30136. if (0 < t % 4)
  30137. throw new Error("Invalid string. Length must be a multiple of 4");
  30138. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30139. }
  30140. function c(e, t, i) {
  30141. for (var n, r = [], o = t; o < i; o += 3)
  30142. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30143. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  30144. var a;
  30145. return r.join("")
  30146. }
  30147. i.byteLength = function(e) {
  30148. return 3 * e.length / 4 - l(e)
  30149. }
  30150. ,
  30151. i.toByteArray = function(e) {
  30152. var t, i, n, r, o, a = e.length;
  30153. r = l(e),
  30154. o = new d(3 * a / 4 - r),
  30155. i = 0 < r ? a - 4 : a;
  30156. var s = 0;
  30157. for (t = 0; t < i; t += 4,
  30158. 3)
  30159. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  30160. o[s++] = n >> 16 & 255,
  30161. o[s++] = n >> 8 & 255,
  30162. o[s++] = 255 & n;
  30163. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  30164. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  30165. o[s++] = n >> 8 & 255,
  30166. o[s++] = 255 & n),
  30167. o
  30168. }
  30169. ,
  30170. i.fromByteArray = function(e) {
  30171. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  30172. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  30173. return 1 == n ? (t = e[i - 1],
  30174. r += h[t >> 2],
  30175. r += h[t << 4 & 63],
  30176. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  30177. r += h[t >> 10],
  30178. r += h[t >> 4 & 63],
  30179. r += h[t << 2 & 63],
  30180. r += "="),
  30181. o.push(r),
  30182. o.join("")
  30183. }
  30184. ;
  30185. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  30186. h[r] = n[r],
  30187. u[n.charCodeAt(r)] = r;
  30188. u["-".charCodeAt(0)] = 62,
  30189. u["_".charCodeAt(0)] = 63
  30190. }
  30191. , {}],
  30192. 200: [function(e, t, i) {
  30193. i.read = function(e, t, i, n, r) {
  30194. 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];
  30195. for (u += d,
  30196. o = p & (1 << -h) - 1,
  30197. p >>= -h,
  30198. h += s; 0 < h; o = 256 * o + e[t + u],
  30199. u += d,
  30200. h -= 8)
  30201. ;
  30202. for (a = o & (1 << -h) - 1,
  30203. o >>= -h,
  30204. h += n; 0 < h; a = 256 * a + e[t + u],
  30205. u += d,
  30206. h -= 8)
  30207. ;
  30208. if (0 === o)
  30209. o = 1 - c;
  30210. else {
  30211. if (o === l)
  30212. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  30213. a += Math.pow(2, n),
  30214. o -= c
  30215. }
  30216. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30217. }
  30218. ,
  30219. i.write = function(e, t, i, n, r, o) {
  30220. 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;
  30221. for (t = Math.abs(t),
  30222. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30223. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30224. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30225. l *= 2),
  30226. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  30227. l /= 2),
  30228. h <= a + u ? (s = 0,
  30229. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  30230. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30231. a = 0)); 8 <= r; e[i + p] = 255 & s,
  30232. p += f,
  30233. s /= 256,
  30234. r -= 8)
  30235. ;
  30236. for (a = a << r | s,
  30237. c += r; 0 < c; e[i + p] = 255 & a,
  30238. p += f,
  30239. a /= 256,
  30240. c -= 8)
  30241. ;
  30242. e[i + p - f] |= 128 * g
  30243. }
  30244. }
  30245. , {}],
  30246. 201: [function(e, t, i) {
  30247. var n = {}.toString;
  30248. t.exports = Array.isArray || function(e) {
  30249. return "[object Array]" == n.call(e)
  30250. }
  30251. }
  30252. , {}],
  30253. 202: [function(e, t, i) {
  30254. function n() {
  30255. this._events = this._events || {},
  30256. this._maxListeners = this._maxListeners || void 0
  30257. }
  30258. function l(e) {
  30259. return "function" == typeof e
  30260. }
  30261. function c(e) {
  30262. return "object" == typeof e && null !== e
  30263. }
  30264. function h(e) {
  30265. return void 0 === e
  30266. }
  30267. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  30268. n.prototype._maxListeners = void 0,
  30269. n.defaultMaxListeners = 10,
  30270. n.prototype.setMaxListeners = function(e) {
  30271. if (!function(e) {
  30272. return "number" == typeof e
  30273. }(e) || e < 0 || isNaN(e))
  30274. throw TypeError("n must be a positive number");
  30275. return this._maxListeners = e,
  30276. this
  30277. }
  30278. ,
  30279. n.prototype.emit = function(e) {
  30280. var t, i, n, r, o, a;
  30281. if (this._events || (this._events = {}),
  30282. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  30283. if ((t = arguments[1])instanceof Error)
  30284. throw t;
  30285. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30286. throw s.context = t,
  30287. s
  30288. }
  30289. if (h(i = this._events[e]))
  30290. return !1;
  30291. if (l(i))
  30292. switch (arguments.length) {
  30293. case 1:
  30294. i.call(this);
  30295. break;
  30296. case 2:
  30297. i.call(this, arguments[1]);
  30298. break;
  30299. case 3:
  30300. i.call(this, arguments[1], arguments[2]);
  30301. break;
  30302. default:
  30303. r = Array.prototype.slice.call(arguments, 1),
  30304. i.apply(this, r)
  30305. }
  30306. else if (c(i))
  30307. for (r = Array.prototype.slice.call(arguments, 1),
  30308. n = (a = i.slice()).length,
  30309. o = 0; o < n; o++)
  30310. a[o].apply(this, r);
  30311. return !0
  30312. }
  30313. ,
  30314. n.prototype.on = n.prototype.addListener = function(e, t) {
  30315. var i;
  30316. if (!l(t))
  30317. throw TypeError("listener must be a function");
  30318. return this._events || (this._events = {}),
  30319. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  30320. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30321. 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,
  30322. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30323. "function" == typeof console.trace && console.trace())),
  30324. this
  30325. }
  30326. ,
  30327. n.prototype.once = function(e, t) {
  30328. function i() {
  30329. this.removeListener(e, i),
  30330. n || (n = !0,
  30331. t.apply(this, arguments))
  30332. }
  30333. if (!l(t))
  30334. throw TypeError("listener must be a function");
  30335. var n = !1;
  30336. return i.listener = t,
  30337. this.on(e, i),
  30338. this
  30339. }
  30340. ,
  30341. n.prototype.removeListener = function(e, t) {
  30342. var i, n, r, o;
  30343. if (!l(t))
  30344. throw TypeError("listener must be a function");
  30345. if (!this._events || !this._events[e])
  30346. return this;
  30347. if (r = (i = this._events[e]).length,
  30348. n = -1,
  30349. i === t || l(i.listener) && i.listener === t)
  30350. delete this._events[e],
  30351. this._events.removeListener && this.emit("removeListener", e, t);
  30352. else if (c(i)) {
  30353. for (o = r; 0 < o--; )
  30354. if (i[o] === t || i[o].listener && i[o].listener === t) {
  30355. n = o;
  30356. break
  30357. }
  30358. if (n < 0)
  30359. return this;
  30360. 1 === i.length ? (i.length = 0,
  30361. delete this._events[e]) : i.splice(n, 1),
  30362. this._events.removeListener && this.emit("removeListener", e, t)
  30363. }
  30364. return this
  30365. }
  30366. ,
  30367. n.prototype.removeAllListeners = function(e) {
  30368. var t, i;
  30369. if (!this._events)
  30370. return this;
  30371. if (!this._events.removeListener)
  30372. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30373. this;
  30374. if (0 === arguments.length) {
  30375. for (t in this._events)
  30376. "removeListener" !== t && this.removeAllListeners(t);
  30377. return this.removeAllListeners("removeListener"),
  30378. this._events = {},
  30379. this
  30380. }
  30381. if (l(i = this._events[e]))
  30382. this.removeListener(e, i);
  30383. else if (i)
  30384. for (; i.length; )
  30385. this.removeListener(e, i[i.length - 1]);
  30386. return delete this._events[e],
  30387. this
  30388. }
  30389. ,
  30390. n.prototype.listeners = function(e) {
  30391. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30392. }
  30393. ,
  30394. n.prototype.listenerCount = function(e) {
  30395. if (this._events) {
  30396. var t = this._events[e];
  30397. if (l(t))
  30398. return 1;
  30399. if (t)
  30400. return t.length
  30401. }
  30402. return 0
  30403. }
  30404. ,
  30405. n.listenerCount = function(e, t) {
  30406. return e.listenerCount(t)
  30407. }
  30408. }
  30409. , {}],
  30410. 203: [function(e, t, i) {
  30411. function n() {
  30412. throw new Error("setTimeout has not been defined")
  30413. }
  30414. function r() {
  30415. throw new Error("clearTimeout has not been defined")
  30416. }
  30417. function o(t) {
  30418. if (h === setTimeout)
  30419. return setTimeout(t, 0);
  30420. if ((h === n || !h) && setTimeout)
  30421. return h = setTimeout,
  30422. setTimeout(t, 0);
  30423. try {
  30424. return h(t, 0)
  30425. } catch (e) {
  30426. try {
  30427. return h.call(null, t, 0)
  30428. } catch (e) {
  30429. return h.call(this, t, 0)
  30430. }
  30431. }
  30432. }
  30433. function a() {
  30434. g && p && (g = !1,
  30435. p.length ? f = p.concat(f) : m = -1,
  30436. f.length && s())
  30437. }
  30438. function s() {
  30439. if (!g) {
  30440. var e = o(a);
  30441. g = !0;
  30442. for (var t = f.length; t; ) {
  30443. for (p = f,
  30444. f = []; ++m < t; )
  30445. p && p[m].run();
  30446. m = -1,
  30447. t = f.length
  30448. }
  30449. p = null,
  30450. g = !1,
  30451. function(t) {
  30452. if (u === clearTimeout)
  30453. return clearTimeout(t);
  30454. if ((u === r || !u) && clearTimeout)
  30455. return u = clearTimeout,
  30456. clearTimeout(t);
  30457. try {
  30458. u(t)
  30459. } catch (e) {
  30460. try {
  30461. return u.call(null, t)
  30462. } catch (e) {
  30463. return u.call(this, t)
  30464. }
  30465. }
  30466. }(e)
  30467. }
  30468. }
  30469. function l(e, t) {
  30470. this.fun = e,
  30471. this.array = t
  30472. }
  30473. function c() {}
  30474. var h, u, d = t.exports = {};
  30475. !function() {
  30476. try {
  30477. h = "function" == typeof setTimeout ? setTimeout : n
  30478. } catch (e) {
  30479. h = n
  30480. }
  30481. try {
  30482. u = "function" == typeof clearTimeout ? clearTimeout : r
  30483. } catch (e) {
  30484. u = r
  30485. }
  30486. }();
  30487. var p, f = [], g = !1, m = -1;
  30488. d.nextTick = function(e) {
  30489. var t = new Array(arguments.length - 1);
  30490. if (1 < arguments.length)
  30491. for (var i = 1; i < arguments.length; i++)
  30492. t[i - 1] = arguments[i];
  30493. f.push(new l(e,t)),
  30494. 1 !== f.length || g || o(s)
  30495. }
  30496. ,
  30497. l.prototype.run = function() {
  30498. this.fun.apply(null, this.array)
  30499. }
  30500. ,
  30501. d.title = "browser",
  30502. d.browser = !0,
  30503. d.env = {},
  30504. d.argv = [],
  30505. d.version = "",
  30506. d.versions = {},
  30507. d.on = c,
  30508. d.addListener = c,
  30509. d.once = c,
  30510. d.off = c,
  30511. d.removeListener = c,
  30512. d.removeAllListeners = c,
  30513. d.emit = c,
  30514. d.binding = function(e) {
  30515. throw new Error("process.binding is not supported")
  30516. }
  30517. ,
  30518. d.cwd = function() {
  30519. return "/"
  30520. }
  30521. ,
  30522. d.chdir = function(e) {
  30523. throw new Error("process.chdir is not supported")
  30524. }
  30525. ,
  30526. d.umask = function() {
  30527. return 0
  30528. }
  30529. }
  30530. , {}],
  30531. 204: [function(e, O, L) {
  30532. (function(P) {
  30533. !function(e) {
  30534. function v(e) {
  30535. throw new RangeError(g[e])
  30536. }
  30537. function r(e, t) {
  30538. for (var i = e.length, n = []; i--; )
  30539. n[i] = t(e[i]);
  30540. return n
  30541. }
  30542. function t(e, t) {
  30543. var i = e.split("@")
  30544. , n = "";
  30545. return 1 < i.length && (n = i[0] + "@",
  30546. e = i[1]),
  30547. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  30548. }
  30549. function y(e) {
  30550. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  30551. 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),
  30552. r--) : n.push(t);
  30553. return n
  30554. }
  30555. function A(e) {
  30556. return r(e, function(e) {
  30557. var t = "";
  30558. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  30559. e = 56320 | 1023 & e),
  30560. t + R(e)
  30561. }).join("")
  30562. }
  30563. function C(e, t) {
  30564. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  30565. }
  30566. function I(e, t, i) {
  30567. var n = 0;
  30568. for (e = i ? M(e / u) : e >> 1,
  30569. e += M(e / t); m * w >> 1 < e; n += _)
  30570. e = M(e / m);
  30571. return M(n + (m + 1) * e / (e + h))
  30572. }
  30573. function i(e) {
  30574. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  30575. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  30576. n = 0; n < i; ++n)
  30577. 128 <= e.charCodeAt(n) && v("not-basic"),
  30578. d.push(e.charCodeAt(n));
  30579. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  30580. for (o = f,
  30581. a = 1,
  30582. s = _; p <= r && v("invalid-input"),
  30583. u = e.charCodeAt(r++),
  30584. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  30585. f += l * a,
  30586. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  30587. a > M(E / (h = _ - c)) && v("overflow"),
  30588. a *= h;
  30589. m = I(f - o, t = d.length + 1, 0 == o),
  30590. M(f / t) > E - g && v("overflow"),
  30591. g += M(f / t),
  30592. f %= t,
  30593. d.splice(f++, 0, g)
  30594. }
  30595. return A(d)
  30596. }
  30597. function n(e) {
  30598. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  30599. for (d = (e = y(e)).length,
  30600. t = x,
  30601. o = T,
  30602. a = i = 0; a < d; ++a)
  30603. (u = e[a]) < 128 && m.push(R(u));
  30604. for (n = r = m.length,
  30605. r && m.push(S); n < d; ) {
  30606. for (s = E,
  30607. a = 0; a < d; ++a)
  30608. t <= (u = e[a]) && u < s && (s = u);
  30609. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  30610. i += (s - t) * p,
  30611. t = s,
  30612. a = 0; a < d; ++a)
  30613. if ((u = e[a]) < t && ++i > E && v("overflow"),
  30614. u == t) {
  30615. for (l = i,
  30616. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  30617. g = l - h,
  30618. f = _ - h,
  30619. m.push(R(C(h + g % f, 0))),
  30620. l = M(g / f);
  30621. m.push(R(C(l, 0))),
  30622. o = I(i, p, n == r),
  30623. i = 0,
  30624. ++n
  30625. }
  30626. ++i,
  30627. ++t
  30628. }
  30629. return m.join("")
  30630. }
  30631. var o = "object" == typeof L && L && !L.nodeType && L
  30632. , a = "object" == typeof O && O && !O.nodeType && O
  30633. , s = "object" == typeof P && P;
  30634. s.global !== s && s.window !== s && s.self !== s || (e = s);
  30635. 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 = {
  30636. overflow: "Overflow: input needs wider integers to process",
  30637. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  30638. "invalid-input": "Invalid input"
  30639. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  30640. if (l = {
  30641. version: "1.4.1",
  30642. ucs2: {
  30643. decode: y,
  30644. encode: A
  30645. },
  30646. decode: i,
  30647. encode: n,
  30648. toASCII: function(e) {
  30649. return t(e, function(e) {
  30650. return p.test(e) ? "xn--" + n(e) : e
  30651. })
  30652. },
  30653. toUnicode: function(e) {
  30654. return t(e, function(e) {
  30655. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  30656. })
  30657. }
  30658. },
  30659. "function" == typeof define && "object" == typeof define.amd && define.amd)
  30660. define("punycode", function() {
  30661. return l
  30662. });
  30663. else if (o && a)
  30664. if (O.exports == o)
  30665. a.exports = l;
  30666. else
  30667. for (c in l)
  30668. l.hasOwnProperty(c) && (o[c] = l[c]);
  30669. else
  30670. e.punycode = l
  30671. }(this)
  30672. }
  30673. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30674. }
  30675. , {}],
  30676. 205: [function(e, t, i) {
  30677. "use strict";
  30678. t.exports = function(e, t, i, n) {
  30679. t = t || "&",
  30680. i = i || "=";
  30681. var r = {};
  30682. if ("string" != typeof e || 0 === e.length)
  30683. return r;
  30684. var o = /\+/g;
  30685. e = e.split(t);
  30686. var a = 1e3;
  30687. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  30688. var s, l, c = e.length;
  30689. 0 < a && a < c && (c = a);
  30690. for (var h = 0; h < c; ++h) {
  30691. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  30692. d = 0 <= m ? (u = g.substr(0, m),
  30693. g.substr(m + 1)) : (u = g,
  30694. ""),
  30695. p = decodeURIComponent(u),
  30696. f = decodeURIComponent(d),
  30697. s = r,
  30698. l = p,
  30699. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  30700. }
  30701. return r
  30702. }
  30703. ;
  30704. var v = Array.isArray || function(e) {
  30705. return "[object Array]" === Object.prototype.toString.call(e)
  30706. }
  30707. }
  30708. , {}],
  30709. 206: [function(e, t, i) {
  30710. "use strict";
  30711. function o(e, t) {
  30712. if (e.map)
  30713. return e.map(t);
  30714. for (var i = [], n = 0; n < e.length; n++)
  30715. i.push(t(e[n], n));
  30716. return i
  30717. }
  30718. function a(e) {
  30719. switch (typeof e) {
  30720. case "string":
  30721. return e;
  30722. case "boolean":
  30723. return e ? "true" : "false";
  30724. case "number":
  30725. return isFinite(e) ? e : "";
  30726. default:
  30727. return ""
  30728. }
  30729. }
  30730. t.exports = function(i, n, r, e) {
  30731. return n = n || "&",
  30732. r = r || "=",
  30733. null === i && (i = void 0),
  30734. "object" == typeof i ? o(l(i), function(e) {
  30735. var t = encodeURIComponent(a(e)) + r;
  30736. return s(i[e]) ? o(i[e], function(e) {
  30737. return t + encodeURIComponent(a(e))
  30738. }).join(n) : t + encodeURIComponent(a(i[e]))
  30739. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  30740. }
  30741. ;
  30742. var s = Array.isArray || function(e) {
  30743. return "[object Array]" === Object.prototype.toString.call(e)
  30744. }
  30745. , l = Object.keys || function(e) {
  30746. var t = [];
  30747. for (var i in e)
  30748. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  30749. return t
  30750. }
  30751. }
  30752. , {}],
  30753. 207: [function(e, t, i) {
  30754. "use strict";
  30755. i.decode = i.parse = e("./decode"),
  30756. i.encode = i.stringify = e("./encode")
  30757. }
  30758. , {
  30759. "./decode": 205,
  30760. "./encode": 206
  30761. }],
  30762. 208: [function(e, t, i) {
  30763. "use strict";
  30764. function x() {
  30765. this.protocol = null,
  30766. this.slashes = null,
  30767. this.auth = null,
  30768. this.host = null,
  30769. this.port = null,
  30770. this.hostname = null,
  30771. this.hash = null,
  30772. this.search = null,
  30773. this.query = null,
  30774. this.pathname = null,
  30775. this.path = null,
  30776. this.href = null
  30777. }
  30778. function n(e, t, i) {
  30779. if (e && D.isObject(e) && e instanceof x)
  30780. return e;
  30781. var n = new x;
  30782. return n.parse(e, t, i),
  30783. n
  30784. }
  30785. var L = e("punycode")
  30786. , D = e("./util");
  30787. i.parse = n,
  30788. i.resolve = function(e, t) {
  30789. return n(e, !1, !0).resolve(t)
  30790. }
  30791. ,
  30792. i.resolveObject = function(e, t) {
  30793. return e ? n(e, !1, !0).resolveObject(t) : t
  30794. }
  30795. ,
  30796. i.format = function(e) {
  30797. return D.isString(e) && (e = n(e)),
  30798. e instanceof x ? e.format() : x.prototype.format.call(e)
  30799. }
  30800. ,
  30801. i.Url = x;
  30802. var N = /^([a-z0-9.+-]+:)/i
  30803. , r = /:[0-9]*$/
  30804. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  30805. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  30806. , B = ["'"].concat(o)
  30807. , V = ["%", "/", "?", ";", "#"].concat(B)
  30808. , k = ["/", "?", "#"]
  30809. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  30810. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  30811. , z = {
  30812. javascript: !0,
  30813. "javascript:": !0
  30814. }
  30815. , G = {
  30816. javascript: !0,
  30817. "javascript:": !0
  30818. }
  30819. , W = {
  30820. http: !0,
  30821. https: !0,
  30822. ftp: !0,
  30823. gopher: !0,
  30824. file: !0,
  30825. "http:": !0,
  30826. "https:": !0,
  30827. "ftp:": !0,
  30828. "gopher:": !0,
  30829. "file:": !0
  30830. }
  30831. , j = e("querystring");
  30832. x.prototype.parse = function(e, t, i) {
  30833. if (!D.isString(e))
  30834. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  30835. var n = e.indexOf("?")
  30836. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  30837. , o = e.split(r);
  30838. o[0] = o[0].replace(/\\/g, "/");
  30839. var a = e = o.join(r);
  30840. if (a = a.trim(),
  30841. !i && 1 === e.split("#").length) {
  30842. var s = F.exec(a);
  30843. if (s)
  30844. return this.path = a,
  30845. this.href = a,
  30846. this.pathname = s[1],
  30847. s[2] ? (this.search = s[2],
  30848. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  30849. this.query = {}),
  30850. this
  30851. }
  30852. var l = N.exec(a);
  30853. if (l) {
  30854. var c = (l = l[0]).toLowerCase();
  30855. this.protocol = c,
  30856. a = a.substr(l.length)
  30857. }
  30858. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  30859. var h = "//" === a.substr(0, 2);
  30860. !h || l && G[l] || (a = a.substr(2),
  30861. this.slashes = !0)
  30862. }
  30863. if (!G[l] && (h || l && !W[l])) {
  30864. for (var u = -1, d = 0; d < k.length; d++) {
  30865. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  30866. }
  30867. var p, f;
  30868. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  30869. a = a.slice(f + 1),
  30870. this.auth = decodeURIComponent(p)),
  30871. u = -1;
  30872. for (d = 0; d < V.length; d++) {
  30873. var g;
  30874. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  30875. }
  30876. -1 === u && (u = a.length),
  30877. this.host = a.slice(0, u),
  30878. a = a.slice(u),
  30879. this.parseHost(),
  30880. this.hostname = this.hostname || "";
  30881. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  30882. if (!m)
  30883. for (var v = this.hostname.split(/\./), y = (d = 0,
  30884. v.length); d < y; d++) {
  30885. var A = v[d];
  30886. if (A && !A.match(U)) {
  30887. for (var C = "", I = 0, E = A.length; I < E; I++)
  30888. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  30889. if (!C.match(U)) {
  30890. var _ = v.slice(0, d)
  30891. , b = v.slice(d + 1)
  30892. , w = A.match(H);
  30893. w && (_.push(w[1]),
  30894. b.unshift(w[2])),
  30895. b.length && (a = "/" + b.join(".") + a),
  30896. this.hostname = _.join(".");
  30897. break
  30898. }
  30899. }
  30900. }
  30901. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  30902. m || (this.hostname = L.toASCII(this.hostname));
  30903. var T = this.port ? ":" + this.port : ""
  30904. , x = this.hostname || "";
  30905. this.host = x + T,
  30906. this.href += this.host,
  30907. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  30908. "/" !== a[0] && (a = "/" + a))
  30909. }
  30910. if (!z[c])
  30911. for (d = 0,
  30912. y = B.length; d < y; d++) {
  30913. var S = B[d];
  30914. if (-1 !== a.indexOf(S)) {
  30915. var M = encodeURIComponent(S);
  30916. M === S && (M = escape(S)),
  30917. a = a.split(S).join(M)
  30918. }
  30919. }
  30920. var R = a.indexOf("#");
  30921. -1 !== R && (this.hash = a.substr(R),
  30922. a = a.slice(0, R));
  30923. var P = a.indexOf("?");
  30924. if (-1 !== P ? (this.search = a.substr(P),
  30925. this.query = a.substr(P + 1),
  30926. t && (this.query = j.parse(this.query)),
  30927. a = a.slice(0, P)) : t && (this.search = "",
  30928. this.query = {}),
  30929. a && (this.pathname = a),
  30930. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  30931. this.pathname || this.search) {
  30932. T = this.pathname || "";
  30933. var O = this.search || "";
  30934. this.path = T + O
  30935. }
  30936. return this.href = this.format(),
  30937. this
  30938. }
  30939. ,
  30940. x.prototype.format = function() {
  30941. var e = this.auth || "";
  30942. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  30943. e += "@");
  30944. var t = this.protocol || ""
  30945. , i = this.pathname || ""
  30946. , n = this.hash || ""
  30947. , r = !1
  30948. , o = "";
  30949. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  30950. this.port && (r += ":" + this.port)),
  30951. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  30952. var a = this.search || o && "?" + o || "";
  30953. return t && ":" !== t.substr(-1) && (t += ":"),
  30954. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  30955. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  30956. n && "#" !== n.charAt(0) && (n = "#" + n),
  30957. a && "?" !== a.charAt(0) && (a = "?" + a),
  30958. t + r + (i = i.replace(/[?#]/g, function(e) {
  30959. return encodeURIComponent(e)
  30960. })) + (a = a.replace("#", "%23")) + n
  30961. }
  30962. ,
  30963. x.prototype.resolve = function(e) {
  30964. return this.resolveObject(n(e, !1, !0)).format()
  30965. }
  30966. ,
  30967. x.prototype.resolveObject = function(e) {
  30968. if (D.isString(e)) {
  30969. var t = new x;
  30970. t.parse(e, !1, !0),
  30971. e = t
  30972. }
  30973. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  30974. var o = n[r];
  30975. i[o] = this[o]
  30976. }
  30977. if (i.hash = e.hash,
  30978. "" === e.href)
  30979. return i.href = i.format(),
  30980. i;
  30981. if (e.slashes && !e.protocol) {
  30982. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  30983. var l = a[s];
  30984. "protocol" !== l && (i[l] = e[l])
  30985. }
  30986. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  30987. i.href = i.format(),
  30988. i
  30989. }
  30990. if (e.protocol && e.protocol !== i.protocol) {
  30991. if (!W[e.protocol]) {
  30992. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  30993. var u = c[h];
  30994. i[u] = e[u]
  30995. }
  30996. return i.href = i.format(),
  30997. i
  30998. }
  30999. if (i.protocol = e.protocol,
  31000. e.host || G[e.protocol])
  31001. i.pathname = e.pathname;
  31002. else {
  31003. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31004. ;
  31005. e.host || (e.host = ""),
  31006. e.hostname || (e.hostname = ""),
  31007. "" !== d[0] && d.unshift(""),
  31008. d.length < 2 && d.unshift(""),
  31009. i.pathname = d.join("/")
  31010. }
  31011. if (i.search = e.search,
  31012. i.query = e.query,
  31013. i.host = e.host || "",
  31014. i.auth = e.auth,
  31015. i.hostname = e.hostname || e.host,
  31016. i.port = e.port,
  31017. i.pathname || i.search) {
  31018. var p = i.pathname || ""
  31019. , f = i.search || "";
  31020. i.path = p + f
  31021. }
  31022. return i.slashes = i.slashes || e.slashes,
  31023. i.href = i.format(),
  31024. i
  31025. }
  31026. var g = i.pathname && "/" === i.pathname.charAt(0)
  31027. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31028. , v = m || g || i.host && e.pathname
  31029. , y = v
  31030. , A = i.pathname && i.pathname.split("/") || []
  31031. , C = (d = e.pathname && e.pathname.split("/") || [],
  31032. i.protocol && !W[i.protocol]);
  31033. if (C && (i.hostname = "",
  31034. i.port = null,
  31035. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  31036. i.host = "",
  31037. e.protocol && (e.hostname = null,
  31038. e.port = null,
  31039. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  31040. e.host = null),
  31041. v = v && ("" === d[0] || "" === A[0])),
  31042. m)
  31043. i.host = e.host || "" === e.host ? e.host : i.host,
  31044. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31045. i.search = e.search,
  31046. i.query = e.query,
  31047. A = d;
  31048. else if (d.length)
  31049. (A = A || []).pop(),
  31050. A = A.concat(d),
  31051. i.search = e.search,
  31052. i.query = e.query;
  31053. else if (!D.isNullOrUndefined(e.search)) {
  31054. if (C)
  31055. i.hostname = i.host = A.shift(),
  31056. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31057. i.host = i.hostname = w.shift());
  31058. return i.search = e.search,
  31059. i.query = e.query,
  31060. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31061. i.href = i.format(),
  31062. i
  31063. }
  31064. if (!A.length)
  31065. return i.pathname = null,
  31066. i.search ? i.path = "/" + i.search : i.path = null,
  31067. i.href = i.format(),
  31068. i;
  31069. 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--)
  31070. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  31071. _++) : _ && (A.splice(b, 1),
  31072. _--);
  31073. if (!v && !y)
  31074. for (; _--; )
  31075. A.unshift("..");
  31076. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  31077. E && "/" !== A.join("/").substr(-1) && A.push("");
  31078. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  31079. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  31080. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31081. i.host = i.hostname = w.shift()));
  31082. return (v = v || i.host && A.length) && !T && A.unshift(""),
  31083. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  31084. i.path = null),
  31085. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31086. i.auth = e.auth || i.auth,
  31087. i.slashes = i.slashes || e.slashes,
  31088. i.href = i.format(),
  31089. i
  31090. }
  31091. ,
  31092. x.prototype.parseHost = function() {
  31093. var e = this.host
  31094. , t = r.exec(e);
  31095. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  31096. e = e.substr(0, e.length - t.length)),
  31097. e && (this.hostname = e)
  31098. }
  31099. }
  31100. , {
  31101. "./util": 209,
  31102. punycode: 204,
  31103. querystring: 207
  31104. }],
  31105. 209: [function(e, t, i) {
  31106. "use strict";
  31107. t.exports = {
  31108. isString: function(e) {
  31109. return "string" == typeof e
  31110. },
  31111. isObject: function(e) {
  31112. return "object" == typeof e && null !== e
  31113. },
  31114. isNull: function(e) {
  31115. return null === e
  31116. },
  31117. isNullOrUndefined: function(e) {
  31118. return null == e
  31119. }
  31120. }
  31121. }
  31122. , {}],
  31123. 210: [function(e, t, i) {
  31124. "use strict";
  31125. function r(e) {
  31126. return c + e
  31127. }
  31128. function s(e) {
  31129. if ("string" != typeof e)
  31130. throw new TypeError("key must be a string.")
  31131. }
  31132. var l = Object.prototype.hasOwnProperty
  31133. , c = "~";
  31134. t.exports = function(t) {
  31135. var o = Object.create(null)
  31136. , n = 0
  31137. , a = {};
  31138. return function(e, t) {
  31139. for (var i in t)
  31140. Object.defineProperty(e, i, {
  31141. value: t[i],
  31142. configurable: !0,
  31143. writable: !0
  31144. })
  31145. }(a, {
  31146. get: function(e, t) {
  31147. s(e);
  31148. var i = r(e);
  31149. return i in o ? o[i] : t
  31150. },
  31151. set: function(e, t) {
  31152. s(e);
  31153. var i = r(e);
  31154. return i in o || ++n,
  31155. o[i] = t
  31156. },
  31157. has: function(e) {
  31158. return s(e),
  31159. r(e)in o
  31160. },
  31161. delete: function(e) {
  31162. s(e);
  31163. var t = r(e);
  31164. return t in o && (--n,
  31165. delete o[t],
  31166. !0)
  31167. },
  31168. clear: function() {
  31169. o = Object.create(null),
  31170. n = 0
  31171. },
  31172. forEach: function(e, t) {
  31173. if ("function" != typeof e)
  31174. throw new TypeError("`callback` must be a function");
  31175. for (var i in o)
  31176. if (l.call(o, i)) {
  31177. var n = i.substring(c.length)
  31178. , r = o[i];
  31179. e.call(t, r, n, a)
  31180. }
  31181. }
  31182. }),
  31183. Object.defineProperty(a, "size", {
  31184. get: function() {
  31185. return n
  31186. },
  31187. configurable: !0
  31188. }),
  31189. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  31190. a.set(e, t[e])
  31191. }),
  31192. a
  31193. }
  31194. }
  31195. , {}],
  31196. 211: [function(e, t, i) {
  31197. t.exports = e("./lib/heap")
  31198. }
  31199. , {
  31200. "./lib/heap": 212
  31201. }],
  31202. 212: [function(e, y, A) {
  31203. (function() {
  31204. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  31205. function v(e) {
  31206. this.cmp = null != e ? e : d,
  31207. this.nodes = []
  31208. }
  31209. l = Math.floor,
  31210. m = Math.min,
  31211. d = function(e, t) {
  31212. return e < t ? -1 : t < e ? 1 : 0
  31213. }
  31214. ,
  31215. g = function(e, t, i, n, r) {
  31216. var o;
  31217. if (null == i && (i = 0),
  31218. null == r && (r = d),
  31219. i < 0)
  31220. throw new Error("lo must be non-negative");
  31221. for (null == n && (n = e.length); i < n; )
  31222. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  31223. return [].splice.apply(e, [i, i - i].concat(t)),
  31224. t
  31225. }
  31226. ,
  31227. t = function(e, t, i) {
  31228. return null == i && (i = d),
  31229. e.push(t),
  31230. h(e, 0, e.length - 1, i)
  31231. }
  31232. ,
  31233. f = function(e, t) {
  31234. var i, n;
  31235. return null == t && (t = d),
  31236. i = e.pop(),
  31237. e.length ? (n = e[0],
  31238. e[0] = i,
  31239. u(e, 0, t)) : n = i,
  31240. n
  31241. }
  31242. ,
  31243. i = function(e, t, i) {
  31244. var n;
  31245. return null == i && (i = d),
  31246. n = e[0],
  31247. e[0] = t,
  31248. u(e, 0, i),
  31249. n
  31250. }
  31251. ,
  31252. c = function(e, t, i) {
  31253. var n;
  31254. return null == i && (i = d),
  31255. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  31256. e[0] = n[1],
  31257. u(e, 0, i)),
  31258. t
  31259. }
  31260. ,
  31261. p = function(i, e) {
  31262. var t, n, r, o, a, s;
  31263. for (null == e && (e = d),
  31264. a = [],
  31265. n = 0,
  31266. r = (o = function() {
  31267. s = [];
  31268. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  31269. s.push(e);
  31270. return s
  31271. }
  31272. .apply(this).reverse()).length; n < r; n++)
  31273. t = o[n],
  31274. a.push(u(i, t, e));
  31275. return a
  31276. }
  31277. ,
  31278. o = function(e, t, i) {
  31279. var n;
  31280. if (null == i && (i = d),
  31281. -1 !== (n = e.indexOf(t)))
  31282. return h(e, 0, n, i),
  31283. u(e, n, i)
  31284. }
  31285. ,
  31286. n = function(e, t, i) {
  31287. var n, r, o, a, s;
  31288. if (null == i && (i = d),
  31289. !(r = e.slice(0, t)).length)
  31290. return r;
  31291. for (p(r, i),
  31292. o = 0,
  31293. a = (s = e.slice(t)).length; o < a; o++)
  31294. n = s[o],
  31295. c(r, n, i);
  31296. return r.sort(i).reverse()
  31297. }
  31298. ,
  31299. r = function(e, t, i) {
  31300. var n, r, o, a, s, l, c, h, u;
  31301. if (null == i && (i = d),
  31302. 10 * t <= e.length) {
  31303. if (!(o = e.slice(0, t).sort(i)).length)
  31304. return o;
  31305. for (r = o[o.length - 1],
  31306. a = 0,
  31307. l = (c = e.slice(t)).length; a < l; a++)
  31308. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  31309. o.pop(),
  31310. r = o[o.length - 1]);
  31311. return o
  31312. }
  31313. for (p(e, i),
  31314. u = [],
  31315. s = 0,
  31316. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  31317. u.push(f(e, i));
  31318. return u
  31319. }
  31320. ,
  31321. h = function(e, t, i, n) {
  31322. var r, o, a;
  31323. for (null == n && (n = d),
  31324. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  31325. e[i] = o,
  31326. i = a;
  31327. return e[i] = r
  31328. }
  31329. ,
  31330. u = function(e, t, i) {
  31331. var n, r, o, a, s;
  31332. for (null == i && (i = d),
  31333. r = e.length,
  31334. o = e[s = t],
  31335. n = 2 * t + 1; n < r; )
  31336. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  31337. e[t] = e[n],
  31338. n = 2 * (t = n) + 1;
  31339. return e[t] = o,
  31340. h(e, s, t, i)
  31341. }
  31342. ,
  31343. v.push = t,
  31344. v.pop = f,
  31345. v.replace = i,
  31346. v.pushpop = c,
  31347. v.heapify = p,
  31348. v.updateItem = o,
  31349. v.nlargest = n,
  31350. v.nsmallest = r,
  31351. v.prototype.push = function(e) {
  31352. return t(this.nodes, e, this.cmp)
  31353. }
  31354. ,
  31355. v.prototype.pop = function() {
  31356. return f(this.nodes, this.cmp)
  31357. }
  31358. ,
  31359. v.prototype.peek = function() {
  31360. return this.nodes[0]
  31361. }
  31362. ,
  31363. v.prototype.contains = function(e) {
  31364. return -1 !== this.nodes.indexOf(e)
  31365. }
  31366. ,
  31367. v.prototype.replace = function(e) {
  31368. return i(this.nodes, e, this.cmp)
  31369. }
  31370. ,
  31371. v.prototype.pushpop = function(e) {
  31372. return c(this.nodes, e, this.cmp)
  31373. }
  31374. ,
  31375. v.prototype.heapify = function() {
  31376. return p(this.nodes, this.cmp)
  31377. }
  31378. ,
  31379. v.prototype.updateItem = function(e) {
  31380. return o(this.nodes, e, this.cmp)
  31381. }
  31382. ,
  31383. v.prototype.clear = function() {
  31384. return this.nodes = []
  31385. }
  31386. ,
  31387. v.prototype.empty = function() {
  31388. return 0 === this.nodes.length
  31389. }
  31390. ,
  31391. v.prototype.size = function() {
  31392. return this.nodes.length
  31393. }
  31394. ,
  31395. v.prototype.clone = function() {
  31396. var e;
  31397. return (e = new v).nodes = this.nodes.slice(0),
  31398. e
  31399. }
  31400. ,
  31401. v.prototype.toArray = function() {
  31402. return this.nodes.slice(0)
  31403. }
  31404. ,
  31405. v.prototype.insert = v.prototype.push,
  31406. v.prototype.top = v.prototype.peek,
  31407. v.prototype.front = v.prototype.peek,
  31408. v.prototype.has = v.prototype.contains,
  31409. v.prototype.copy = v.prototype.clone,
  31410. e = v,
  31411. a = this,
  31412. s = function() {
  31413. return e
  31414. }
  31415. ,
  31416. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  31417. }
  31418. ).call(this)
  31419. }
  31420. , {}],
  31421. 213: [function(e, t, i) {
  31422. function n() {}
  31423. function o(e) {
  31424. if ("object" != typeof this)
  31425. throw new TypeError("Promises must be constructed via new");
  31426. if ("function" != typeof e)
  31427. throw new TypeError("not a function");
  31428. this._state = 0,
  31429. this._handled = !1,
  31430. this._value = void 0,
  31431. this._deferreds = [],
  31432. h(e, this)
  31433. }
  31434. function r(i, n) {
  31435. for (; 3 === i._state; )
  31436. i = i._value;
  31437. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  31438. void o._immediateFn(function() {
  31439. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  31440. if (null !== e) {
  31441. var t;
  31442. try {
  31443. t = e(i._value)
  31444. } catch (e) {
  31445. return void s(n.promise, e)
  31446. }
  31447. a(n.promise, t)
  31448. } else
  31449. (1 === i._state ? a : s)(n.promise, i._value)
  31450. }))
  31451. }
  31452. function a(e, t) {
  31453. try {
  31454. if (t === e)
  31455. throw new TypeError("A promise cannot be resolved with itself.");
  31456. if (t && ("object" == typeof t || "function" == typeof t)) {
  31457. var i = t.then;
  31458. if (t instanceof o)
  31459. return e._state = 3,
  31460. e._value = t,
  31461. void l(e);
  31462. if ("function" == typeof i)
  31463. return void h(function(e, t) {
  31464. return function() {
  31465. e.apply(t, arguments)
  31466. }
  31467. }(i, t), e)
  31468. }
  31469. e._state = 1,
  31470. e._value = t,
  31471. l(e)
  31472. } catch (t) {
  31473. s(e, t)
  31474. }
  31475. }
  31476. function s(e, t) {
  31477. e._state = 2,
  31478. e._value = t,
  31479. l(e)
  31480. }
  31481. function l(e) {
  31482. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  31483. e._handled || o._unhandledRejectionFn(e._value)
  31484. });
  31485. for (var t = 0, i = e._deferreds.length; t < i; t++)
  31486. r(e, e._deferreds[t]);
  31487. e._deferreds = null
  31488. }
  31489. function c(e, t, i) {
  31490. this.onFulfilled = "function" == typeof e ? e : null,
  31491. this.onRejected = "function" == typeof t ? t : null,
  31492. this.promise = i
  31493. }
  31494. function h(e, t) {
  31495. var i = !1;
  31496. try {
  31497. e(function(e) {
  31498. i || (i = !0,
  31499. a(t, e))
  31500. }, function(e) {
  31501. i || (i = !0,
  31502. s(t, e))
  31503. })
  31504. } catch (e) {
  31505. if (i)
  31506. return;
  31507. i = !0,
  31508. s(t, e)
  31509. }
  31510. }
  31511. var u, d;
  31512. u = this,
  31513. d = setTimeout,
  31514. o.prototype.catch = function(e) {
  31515. return this.then(null, e)
  31516. }
  31517. ,
  31518. o.prototype.then = function(e, t) {
  31519. var i = new this.constructor(n);
  31520. return r(this, new c(e,t,i)),
  31521. i
  31522. }
  31523. ,
  31524. o.all = function(e) {
  31525. var s = Array.prototype.slice.call(e);
  31526. return new o(function(n, r) {
  31527. function o(t, e) {
  31528. try {
  31529. if (e && ("object" == typeof e || "function" == typeof e)) {
  31530. var i = e.then;
  31531. if ("function" == typeof i)
  31532. return void i.call(e, function(e) {
  31533. o(t, e)
  31534. }, r)
  31535. }
  31536. s[t] = e,
  31537. 0 == --a && n(s)
  31538. } catch (e) {
  31539. r(e)
  31540. }
  31541. }
  31542. if (0 === s.length)
  31543. return n([]);
  31544. for (var a = s.length, e = 0; e < s.length; e++)
  31545. o(e, s[e])
  31546. }
  31547. )
  31548. }
  31549. ,
  31550. o.resolve = function(t) {
  31551. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  31552. e(t)
  31553. }
  31554. )
  31555. }
  31556. ,
  31557. o.reject = function(i) {
  31558. return new o(function(e, t) {
  31559. t(i)
  31560. }
  31561. )
  31562. }
  31563. ,
  31564. o.race = function(r) {
  31565. return new o(function(e, t) {
  31566. for (var i = 0, n = r.length; i < n; i++)
  31567. r[i].then(e, t)
  31568. }
  31569. )
  31570. }
  31571. ,
  31572. o._immediateFn = "function" == typeof setImmediate && function(e) {
  31573. setImmediate(e)
  31574. }
  31575. || function(e) {
  31576. d(e, 0)
  31577. }
  31578. ,
  31579. o._unhandledRejectionFn = function(e) {
  31580. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  31581. }
  31582. ,
  31583. o._setImmediateFn = function(e) {
  31584. o._immediateFn = e
  31585. }
  31586. ,
  31587. o._setUnhandledRejectionFn = function(e) {
  31588. o._unhandledRejectionFn = e
  31589. }
  31590. ,
  31591. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  31592. }
  31593. , {}],
  31594. 214: [function(p, i, e) {
  31595. (function(d) {
  31596. var e, t;
  31597. e = this,
  31598. t = function(I, e) {
  31599. "use strict";
  31600. var a, t, u, i, s, n, r, o = {};
  31601. return o.ByteBuffer = I,
  31602. o.Long = I.Long || null,
  31603. o.VERSION = "5.0.1",
  31604. o.WIRE_TYPES = {},
  31605. o.WIRE_TYPES.VARINT = 0,
  31606. o.WIRE_TYPES.BITS64 = 1,
  31607. o.WIRE_TYPES.LDELIM = 2,
  31608. o.WIRE_TYPES.STARTGROUP = 3,
  31609. o.WIRE_TYPES.ENDGROUP = 4,
  31610. o.WIRE_TYPES.BITS32 = 5,
  31611. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  31612. o.TYPES = {
  31613. int32: {
  31614. name: "int32",
  31615. wireType: o.WIRE_TYPES.VARINT,
  31616. defaultValue: 0
  31617. },
  31618. uint32: {
  31619. name: "uint32",
  31620. wireType: o.WIRE_TYPES.VARINT,
  31621. defaultValue: 0
  31622. },
  31623. sint32: {
  31624. name: "sint32",
  31625. wireType: o.WIRE_TYPES.VARINT,
  31626. defaultValue: 0
  31627. },
  31628. int64: {
  31629. name: "int64",
  31630. wireType: o.WIRE_TYPES.VARINT,
  31631. defaultValue: o.Long ? o.Long.ZERO : void 0
  31632. },
  31633. uint64: {
  31634. name: "uint64",
  31635. wireType: o.WIRE_TYPES.VARINT,
  31636. defaultValue: o.Long ? o.Long.UZERO : void 0
  31637. },
  31638. sint64: {
  31639. name: "sint64",
  31640. wireType: o.WIRE_TYPES.VARINT,
  31641. defaultValue: o.Long ? o.Long.ZERO : void 0
  31642. },
  31643. bool: {
  31644. name: "bool",
  31645. wireType: o.WIRE_TYPES.VARINT,
  31646. defaultValue: !1
  31647. },
  31648. double: {
  31649. name: "double",
  31650. wireType: o.WIRE_TYPES.BITS64,
  31651. defaultValue: 0
  31652. },
  31653. string: {
  31654. name: "string",
  31655. wireType: o.WIRE_TYPES.LDELIM,
  31656. defaultValue: ""
  31657. },
  31658. bytes: {
  31659. name: "bytes",
  31660. wireType: o.WIRE_TYPES.LDELIM,
  31661. defaultValue: null
  31662. },
  31663. fixed32: {
  31664. name: "fixed32",
  31665. wireType: o.WIRE_TYPES.BITS32,
  31666. defaultValue: 0
  31667. },
  31668. sfixed32: {
  31669. name: "sfixed32",
  31670. wireType: o.WIRE_TYPES.BITS32,
  31671. defaultValue: 0
  31672. },
  31673. fixed64: {
  31674. name: "fixed64",
  31675. wireType: o.WIRE_TYPES.BITS64,
  31676. defaultValue: o.Long ? o.Long.UZERO : void 0
  31677. },
  31678. sfixed64: {
  31679. name: "sfixed64",
  31680. wireType: o.WIRE_TYPES.BITS64,
  31681. defaultValue: o.Long ? o.Long.ZERO : void 0
  31682. },
  31683. float: {
  31684. name: "float",
  31685. wireType: o.WIRE_TYPES.BITS32,
  31686. defaultValue: 0
  31687. },
  31688. enum: {
  31689. name: "enum",
  31690. wireType: o.WIRE_TYPES.VARINT,
  31691. defaultValue: 0
  31692. },
  31693. message: {
  31694. name: "message",
  31695. wireType: o.WIRE_TYPES.LDELIM,
  31696. defaultValue: null
  31697. },
  31698. group: {
  31699. name: "group",
  31700. wireType: o.WIRE_TYPES.STARTGROUP,
  31701. defaultValue: null
  31702. }
  31703. },
  31704. 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],
  31705. o.ID_MIN = 1,
  31706. o.ID_MAX = 536870911,
  31707. o.convertFieldsToCamelCase = !1,
  31708. o.populateAccessors = !0,
  31709. o.populateDefaults = !0,
  31710. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  31711. r.XHR = function() {
  31712. for (var e = [function() {
  31713. return new XMLHttpRequest
  31714. }
  31715. , function() {
  31716. return new ActiveXObject("Msxml2.XMLHTTP")
  31717. }
  31718. , function() {
  31719. return new ActiveXObject("Msxml3.XMLHTTP")
  31720. }
  31721. , function() {
  31722. return new ActiveXObject("Microsoft.XMLHTTP")
  31723. }
  31724. ], t = null, i = 0; i < e.length; i++) {
  31725. try {
  31726. t = e[i]()
  31727. } catch (e) {
  31728. continue
  31729. }
  31730. break
  31731. }
  31732. if (!t)
  31733. throw Error("XMLHttpRequest is not supported");
  31734. return t
  31735. }
  31736. ,
  31737. r.fetch = function(e, i) {
  31738. if (i && "function" != typeof i && (i = null),
  31739. r.IS_NODE) {
  31740. var t = p("fs");
  31741. if (i)
  31742. t.readFile(e, function(e, t) {
  31743. i(e ? null : "" + t)
  31744. });
  31745. else
  31746. try {
  31747. return t.readFileSync(e)
  31748. } catch (e) {
  31749. return null
  31750. }
  31751. } else {
  31752. var n = r.XHR();
  31753. if (n.open("GET", e, !!i),
  31754. n.setRequestHeader("Accept", "text/plain"),
  31755. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  31756. !i)
  31757. return n.send(null),
  31758. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  31759. if (n.onreadystatechange = function() {
  31760. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  31761. }
  31762. ,
  31763. 4 == n.readyState)
  31764. return;
  31765. n.send(null)
  31766. }
  31767. }
  31768. ,
  31769. r.toCamelCase = function(e) {
  31770. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  31771. return t.toUpperCase()
  31772. })
  31773. }
  31774. ,
  31775. r),
  31776. o.Lang = {
  31777. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  31778. RULE: /^(?:required|optional|repeated|map)$/,
  31779. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  31780. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  31781. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  31782. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  31783. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  31784. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  31785. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  31786. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  31787. NUMBER_OCT: /^0[0-7]+$/,
  31788. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  31789. BOOL: /^(?:true|false)$/i,
  31790. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  31791. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  31792. WHITESPACE: /\s/,
  31793. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  31794. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  31795. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  31796. },
  31797. o.DotProto = function(r, a) {
  31798. function s(e, t) {
  31799. var i = -1
  31800. , n = 1;
  31801. if ("-" == e.charAt(0) && (n = -1,
  31802. e = e.substring(1)),
  31803. a.NUMBER_DEC.test(e))
  31804. i = parseInt(e);
  31805. else if (a.NUMBER_HEX.test(e))
  31806. i = parseInt(e.substring(2), 16);
  31807. else {
  31808. if (!a.NUMBER_OCT.test(e))
  31809. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  31810. i = parseInt(e.substring(1), 8)
  31811. }
  31812. if (i = n * i | 0,
  31813. !t && i < 0)
  31814. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  31815. return i
  31816. }
  31817. function o(e) {
  31818. var t = 1;
  31819. if ("-" == e.charAt(0) && (t = -1,
  31820. e = e.substring(1)),
  31821. a.NUMBER_DEC.test(e))
  31822. return t * parseInt(e, 10);
  31823. if (a.NUMBER_HEX.test(e))
  31824. return t * parseInt(e.substring(2), 16);
  31825. if (a.NUMBER_OCT.test(e))
  31826. return t * parseInt(e.substring(1), 8);
  31827. if ("inf" === e)
  31828. return t * (1 / 0);
  31829. if ("nan" === e)
  31830. return NaN;
  31831. if (a.NUMBER_FLT.test(e))
  31832. return t * parseFloat(e);
  31833. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  31834. }
  31835. function n(e, t, i) {
  31836. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  31837. e[t].push(i))
  31838. }
  31839. function t(e) {
  31840. this.source = e + "",
  31841. this.index = 0,
  31842. this.line = 1,
  31843. this.stack = [],
  31844. this._stringOpen = null
  31845. }
  31846. var e = {}
  31847. , i = t.prototype;
  31848. i._readString = function() {
  31849. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  31850. e.lastIndex = this.index - 1;
  31851. var t = e.exec(this.source);
  31852. if (!t)
  31853. throw Error("unterminated string");
  31854. return this.index = e.lastIndex,
  31855. this.stack.push(this._stringOpen),
  31856. this._stringOpen = null,
  31857. t[1]
  31858. }
  31859. ,
  31860. i.next = function() {
  31861. if (0 < this.stack.length)
  31862. return this.stack.shift();
  31863. if (this.index >= this.source.length)
  31864. return null;
  31865. if (null !== this._stringOpen)
  31866. return this._readString();
  31867. var e, t, i;
  31868. do {
  31869. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  31870. if ("\n" === i && ++this.line,
  31871. ++this.index === this.source.length)
  31872. return null;
  31873. if ("/" === this.source.charAt(this.index))
  31874. if (++this.index,
  31875. "/" === this.source.charAt(this.index)) {
  31876. for (; "\n" !== this.source.charAt(++this.index); )
  31877. if (this.index == this.source.length)
  31878. return null;
  31879. ++this.index,
  31880. ++this.line,
  31881. e = !0
  31882. } else {
  31883. if ("*" !== (i = this.source.charAt(this.index)))
  31884. return "/";
  31885. do {
  31886. if ("\n" === i && ++this.line,
  31887. ++this.index === this.source.length)
  31888. return null;
  31889. t = i,
  31890. i = this.source.charAt(this.index)
  31891. } while ("*" !== t || "/" !== i);++this.index,
  31892. e = !0
  31893. }
  31894. } while (e);if (this.index === this.source.length)
  31895. return null;
  31896. var n = this.index;
  31897. if (a.DELIM.lastIndex = 0,
  31898. !a.DELIM.test(this.source.charAt(n++)))
  31899. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  31900. ++n;
  31901. var r = this.source.substring(this.index, this.index = n);
  31902. return '"' !== r && "'" !== r || (this._stringOpen = r),
  31903. r
  31904. }
  31905. ,
  31906. i.peek = function() {
  31907. if (0 === this.stack.length) {
  31908. var e = this.next();
  31909. if (null === e)
  31910. return null;
  31911. this.stack.push(e)
  31912. }
  31913. return this.stack[0]
  31914. }
  31915. ,
  31916. i.skip = function(e) {
  31917. var t = this.next();
  31918. if (t !== e)
  31919. throw Error("illegal '" + t + "', '" + e + "' expected")
  31920. }
  31921. ,
  31922. i.omit = function(e) {
  31923. return this.peek() === e && (this.next(),
  31924. !0)
  31925. }
  31926. ,
  31927. i.toString = function() {
  31928. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  31929. }
  31930. ,
  31931. e.Tokenizer = t;
  31932. function l(e) {
  31933. this.tn = new t(e),
  31934. this.proto3 = !1
  31935. }
  31936. var c = l.prototype;
  31937. return c.parse = function() {
  31938. var e, t, i = {
  31939. name: "[ROOT]",
  31940. package: null,
  31941. messages: [],
  31942. enums: [],
  31943. imports: [],
  31944. options: {},
  31945. services: []
  31946. }, n = !0;
  31947. try {
  31948. for (; e = this.tn.next(); )
  31949. switch (e) {
  31950. case "package":
  31951. if (!n || null !== i.package)
  31952. throw Error("unexpected 'package'");
  31953. if (e = this.tn.next(),
  31954. !a.TYPEREF.test(e))
  31955. throw Error("illegal package name: " + e);
  31956. this.tn.skip(";"),
  31957. i.package = e;
  31958. break;
  31959. case "import":
  31960. if (!n)
  31961. throw Error("unexpected 'import'");
  31962. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  31963. e = this._readString(),
  31964. this.tn.skip(";"),
  31965. t || i.imports.push(e);
  31966. break;
  31967. case "syntax":
  31968. if (!n)
  31969. throw Error("unexpected 'syntax'");
  31970. this.tn.skip("="),
  31971. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  31972. this.tn.skip(";");
  31973. break;
  31974. case "message":
  31975. this._parseMessage(i, null),
  31976. n = !1;
  31977. break;
  31978. case "enum":
  31979. this._parseEnum(i),
  31980. n = !1;
  31981. break;
  31982. case "option":
  31983. this._parseOption(i);
  31984. break;
  31985. case "service":
  31986. this._parseService(i);
  31987. break;
  31988. case "extend":
  31989. this._parseExtend(i);
  31990. break;
  31991. default:
  31992. throw Error("unexpected '" + e + "'")
  31993. }
  31994. } catch (e) {
  31995. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  31996. e
  31997. }
  31998. return delete i.name,
  31999. i
  32000. }
  32001. ,
  32002. l.parse = function(e) {
  32003. return new l(e).parse()
  32004. }
  32005. ,
  32006. c._readString = function() {
  32007. var e, t, i = "";
  32008. do {
  32009. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32010. throw Error("illegal string delimiter: " + t);
  32011. i += this.tn.next(),
  32012. this.tn.skip(t),
  32013. e = this.tn.peek()
  32014. } while ('"' === e || '"' === e);return i
  32015. }
  32016. ,
  32017. c._readValue = function(e) {
  32018. var t = this.tn.peek();
  32019. if ('"' === t || "'" === t)
  32020. return this._readString();
  32021. if (this.tn.next(),
  32022. a.NUMBER.test(t))
  32023. return o(t);
  32024. if (a.BOOL.test(t))
  32025. return "true" === t.toLowerCase();
  32026. if (e && a.TYPEREF.test(t))
  32027. return t;
  32028. throw Error("illegal value: " + t)
  32029. }
  32030. ,
  32031. c._parseOption = function(e, t) {
  32032. var i = this.tn.next()
  32033. , n = !1;
  32034. if ("(" === i && (n = !0,
  32035. i = this.tn.next()),
  32036. !a.TYPEREF.test(i))
  32037. throw Error("illegal option name: " + i);
  32038. var r = i;
  32039. n && (this.tn.skip(")"),
  32040. r = "(" + r + ")",
  32041. i = this.tn.peek(),
  32042. a.FQTYPEREF.test(i) && (r += i,
  32043. this.tn.next())),
  32044. this.tn.skip("="),
  32045. this._parseOptionValue(e, r),
  32046. t || this.tn.skip(";")
  32047. }
  32048. ,
  32049. c._parseOptionValue = function(e, t) {
  32050. var i = this.tn.peek();
  32051. if ("{" !== i)
  32052. n(e.options, t, this._readValue(!0));
  32053. else
  32054. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  32055. if (!a.NAME.test(i))
  32056. throw Error("illegal option name: " + t + "." + i);
  32057. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  32058. }
  32059. }
  32060. ,
  32061. c._parseService = function(e) {
  32062. var t = this.tn.next();
  32063. if (!a.NAME.test(t))
  32064. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  32065. var i = {
  32066. name: t,
  32067. rpc: {},
  32068. options: {}
  32069. };
  32070. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32071. if ("option" === t)
  32072. this._parseOption(i);
  32073. else {
  32074. if ("rpc" !== t)
  32075. throw Error("illegal service token: " + t);
  32076. this._parseServiceRPC(i)
  32077. }
  32078. this.tn.omit(";"),
  32079. e.services.push(i)
  32080. }
  32081. ,
  32082. c._parseServiceRPC = function(e) {
  32083. var t = this.tn.next();
  32084. if (!a.NAME.test(t))
  32085. throw Error("illegal rpc service method name: " + t);
  32086. var i = t
  32087. , n = {
  32088. request: null,
  32089. response: null,
  32090. request_stream: !1,
  32091. response_stream: !1,
  32092. options: {}
  32093. };
  32094. if (this.tn.skip("("),
  32095. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  32096. t = this.tn.next()),
  32097. !a.TYPEREF.test(t))
  32098. throw Error("illegal rpc service request type: " + t);
  32099. if (n.request = t,
  32100. this.tn.skip(")"),
  32101. "returns" !== (t = this.tn.next()).toLowerCase())
  32102. throw Error("illegal rpc service request type delimiter: " + t);
  32103. if (this.tn.skip("("),
  32104. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  32105. t = this.tn.next()),
  32106. n.response = t,
  32107. this.tn.skip(")"),
  32108. "{" === (t = this.tn.peek())) {
  32109. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  32110. if ("option" !== t)
  32111. throw Error("illegal rpc service token: " + t);
  32112. this._parseOption(n)
  32113. }
  32114. this.tn.omit(";")
  32115. } else
  32116. this.tn.skip(";");
  32117. void 0 === e.rpc && (e.rpc = {}),
  32118. e.rpc[i] = n
  32119. }
  32120. ,
  32121. c._parseMessage = function(e, t) {
  32122. var i = !!t
  32123. , n = this.tn.next()
  32124. , r = {
  32125. name: "",
  32126. fields: [],
  32127. enums: [],
  32128. messages: [],
  32129. options: {},
  32130. services: [],
  32131. oneofs: {}
  32132. };
  32133. if (!a.NAME.test(n))
  32134. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  32135. for (r.name = n,
  32136. i && (this.tn.skip("="),
  32137. t.id = s(this.tn.next()),
  32138. r.isGroup = !0),
  32139. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  32140. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  32141. if (a.RULE.test(n))
  32142. this._parseMessageField(r, n);
  32143. else if ("oneof" === n)
  32144. this._parseMessageOneOf(r);
  32145. else if ("enum" === n)
  32146. this._parseEnum(r);
  32147. else if ("message" === n)
  32148. this._parseMessage(r);
  32149. else if ("option" === n)
  32150. this._parseOption(r);
  32151. else if ("service" === n)
  32152. this._parseService(r);
  32153. else if ("extensions" === n)
  32154. r.extensions = this._parseExtensionRanges();
  32155. else if ("reserved" === n)
  32156. this._parseIgnored();
  32157. else if ("extend" === n)
  32158. this._parseExtend(r);
  32159. else {
  32160. if (!a.TYPEREF.test(n))
  32161. throw Error("illegal message token: " + n);
  32162. if (!this.proto3)
  32163. throw Error("illegal field rule: " + n);
  32164. this._parseMessageField(r, "optional", n)
  32165. }
  32166. return this.tn.omit(";"),
  32167. e.messages.push(r),
  32168. r
  32169. }
  32170. ,
  32171. c._parseIgnored = function() {
  32172. for (; ";" !== this.tn.peek(); )
  32173. this.tn.next();
  32174. this.tn.skip(";")
  32175. }
  32176. ,
  32177. c._parseMessageField = function(e, t, i) {
  32178. if (!a.RULE.test(t))
  32179. throw Error("illegal message field rule: " + t);
  32180. var n, r = {
  32181. rule: t,
  32182. type: "",
  32183. name: "",
  32184. options: {},
  32185. id: 0
  32186. };
  32187. if ("map" === t) {
  32188. if (i)
  32189. throw Error("illegal type: " + i);
  32190. if (this.tn.skip("<"),
  32191. n = this.tn.next(),
  32192. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32193. throw Error("illegal message field type: " + n);
  32194. if (r.keytype = n,
  32195. this.tn.skip(","),
  32196. n = this.tn.next(),
  32197. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32198. throw Error("illegal message field: " + n);
  32199. if (r.type = n,
  32200. this.tn.skip(">"),
  32201. n = this.tn.next(),
  32202. !a.NAME.test(n))
  32203. throw Error("illegal message field name: " + n);
  32204. r.name = n,
  32205. this.tn.skip("="),
  32206. r.id = s(this.tn.next()),
  32207. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32208. this.tn.skip(";")
  32209. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  32210. var o = this._parseMessage(e, r);
  32211. if (!/^[A-Z]/.test(o.name))
  32212. throw Error("illegal group name: " + o.name);
  32213. r.type = o.name,
  32214. r.name = o.name.toLowerCase(),
  32215. this.tn.omit(";")
  32216. } else {
  32217. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  32218. throw Error("illegal message field type: " + i);
  32219. if (r.type = i,
  32220. n = this.tn.next(),
  32221. !a.NAME.test(n))
  32222. throw Error("illegal message field name: " + n);
  32223. r.name = n,
  32224. this.tn.skip("="),
  32225. r.id = s(this.tn.next()),
  32226. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32227. this.tn.skip(";")
  32228. }
  32229. return e.fields.push(r),
  32230. r
  32231. }
  32232. ,
  32233. c._parseMessageOneOf = function(e) {
  32234. var t = this.tn.next();
  32235. if (!a.NAME.test(t))
  32236. throw Error("illegal oneof name: " + t);
  32237. var i, n = t, r = [];
  32238. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32239. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  32240. r.push(i.id);
  32241. this.tn.omit(";"),
  32242. e.oneofs[n] = r
  32243. }
  32244. ,
  32245. c._parseFieldOptions = function(e) {
  32246. this.tn.skip("[");
  32247. for (var t = !0; "]" !== this.tn.peek(); )
  32248. t || this.tn.skip(","),
  32249. this._parseOption(e, !0),
  32250. t = !1;
  32251. this.tn.next()
  32252. }
  32253. ,
  32254. c._parseEnum = function(e) {
  32255. var t = {
  32256. name: "",
  32257. values: [],
  32258. options: {}
  32259. }
  32260. , i = this.tn.next();
  32261. if (!a.NAME.test(i))
  32262. throw Error("illegal name: " + i);
  32263. for (t.name = i,
  32264. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32265. if ("option" === i)
  32266. this._parseOption(t);
  32267. else {
  32268. if (!a.NAME.test(i))
  32269. throw Error("illegal name: " + i);
  32270. this.tn.skip("=");
  32271. var n = {
  32272. name: i,
  32273. id: s(this.tn.next(), !0)
  32274. };
  32275. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  32276. options: {}
  32277. }),
  32278. this.tn.skip(";"),
  32279. t.values.push(n)
  32280. }
  32281. this.tn.omit(";"),
  32282. e.enums.push(t)
  32283. }
  32284. ,
  32285. c._parseExtensionRanges = function() {
  32286. var e, t, i, n = [];
  32287. do {
  32288. for (t = []; ; ) {
  32289. switch (e = this.tn.next()) {
  32290. case "min":
  32291. i = r.ID_MIN;
  32292. break;
  32293. case "max":
  32294. i = r.ID_MAX;
  32295. break;
  32296. default:
  32297. i = o(e)
  32298. }
  32299. if (t.push(i),
  32300. 2 === t.length)
  32301. break;
  32302. if ("to" !== this.tn.peek()) {
  32303. t.push(i);
  32304. break
  32305. }
  32306. this.tn.next()
  32307. }
  32308. n.push(t)
  32309. } while (this.tn.omit(","));return this.tn.skip(";"),
  32310. n
  32311. }
  32312. ,
  32313. c._parseExtend = function(e) {
  32314. var t = this.tn.next();
  32315. if (!a.TYPEREF.test(t))
  32316. throw Error("illegal extend reference: " + t);
  32317. var i = {
  32318. ref: t,
  32319. fields: []
  32320. };
  32321. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32322. if (a.RULE.test(t))
  32323. this._parseMessageField(i, t);
  32324. else {
  32325. if (!a.TYPEREF.test(t))
  32326. throw Error("illegal extend token: " + t);
  32327. if (!this.proto3)
  32328. throw Error("illegal field rule: " + t);
  32329. this._parseMessageField(i, "optional", t)
  32330. }
  32331. return this.tn.omit(";"),
  32332. e.messages.push(i),
  32333. i
  32334. }
  32335. ,
  32336. c.toString = function() {
  32337. return "Parser at line " + this.tn.line
  32338. }
  32339. ,
  32340. e.Parser = l,
  32341. e
  32342. }(o, o.Lang),
  32343. o.Reflect = function(g) {
  32344. function a(e, t) {
  32345. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  32346. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  32347. if ("string" == typeof e)
  32348. return g.Long.fromString(e, t || !1, 10);
  32349. if ("number" == typeof e)
  32350. return g.Long.fromNumber(e, t || !1);
  32351. throw Error("not convertible to Long")
  32352. }
  32353. function m(e, t) {
  32354. var i = t.readVarint32()
  32355. , n = 7 & i
  32356. , r = i >>> 3;
  32357. switch (n) {
  32358. case g.WIRE_TYPES.VARINT:
  32359. for (; 128 == (128 & (i = t.readUint8())); )
  32360. ;
  32361. break;
  32362. case g.WIRE_TYPES.BITS64:
  32363. t.offset += 8;
  32364. break;
  32365. case g.WIRE_TYPES.LDELIM:
  32366. i = t.readVarint32(),
  32367. t.offset += i;
  32368. break;
  32369. case g.WIRE_TYPES.STARTGROUP:
  32370. m(r, t);
  32371. break;
  32372. case g.WIRE_TYPES.ENDGROUP:
  32373. if (r === e)
  32374. return !1;
  32375. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  32376. case g.WIRE_TYPES.BITS32:
  32377. t.offset += 4;
  32378. break;
  32379. default:
  32380. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  32381. }
  32382. return !0
  32383. }
  32384. function h(e, t, i) {
  32385. this.builder = e,
  32386. this.parent = t,
  32387. this.name = i,
  32388. this.className
  32389. }
  32390. var s = {}
  32391. , e = h.prototype;
  32392. e.fqn = function() {
  32393. for (var e = this.name, t = this; null != (t = t.parent); )
  32394. e = t.name + "." + e;
  32395. return e
  32396. }
  32397. ,
  32398. e.toString = function(e) {
  32399. return (e ? this.className + " " : "") + this.fqn()
  32400. }
  32401. ,
  32402. e.build = function() {
  32403. throw Error(this.toString(!0) + " cannot be built directly")
  32404. }
  32405. ,
  32406. s.T = h;
  32407. function l(e, t, i, n, r) {
  32408. h.call(this, e, t, i),
  32409. this.className = "Namespace",
  32410. this.children = [],
  32411. this.options = n || {},
  32412. this.syntax = r || "proto2"
  32413. }
  32414. var t = l.prototype = Object.create(h.prototype);
  32415. t.getChildren = function(e) {
  32416. if (null == (e = e || null))
  32417. return this.children.slice();
  32418. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32419. this.children[i]instanceof e && t.push(this.children[i]);
  32420. return t
  32421. }
  32422. ,
  32423. t.addChild = function(e) {
  32424. var t;
  32425. if (t = this.getChild(e.name))
  32426. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32427. t.name = t.originalName;
  32428. else {
  32429. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32430. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32431. e.name = e.originalName
  32432. }
  32433. this.children.push(e)
  32434. }
  32435. ,
  32436. t.getChild = function(e) {
  32437. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32438. if (this.children[i][t] === e)
  32439. return this.children[i];
  32440. return null
  32441. }
  32442. ,
  32443. t.resolve = function(e, t) {
  32444. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  32445. if ("" === n[o]) {
  32446. for (; null !== r.parent; )
  32447. r = r.parent;
  32448. o++
  32449. }
  32450. do {
  32451. do {
  32452. if (!(r instanceof s.Namespace)) {
  32453. r = null;
  32454. break
  32455. }
  32456. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  32457. r = null;
  32458. break
  32459. }
  32460. r = i,
  32461. o++
  32462. } while (o < n.length);if (null != r)
  32463. break;
  32464. if (null !== this.parent)
  32465. return this.parent.resolve(e, t)
  32466. } while (null != r);return r
  32467. }
  32468. ,
  32469. t.qn = function(e) {
  32470. for (var t = [], i = e; t.unshift(i.name),
  32471. null !== (i = i.parent); )
  32472. ;
  32473. for (var n = 1; n <= t.length; n++) {
  32474. var r = t.slice(t.length - n);
  32475. if (e === this.resolve(r, e instanceof s.Namespace))
  32476. return r.join(".")
  32477. }
  32478. return e.fqn()
  32479. }
  32480. ,
  32481. t.build = function() {
  32482. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  32483. (e = i[n])instanceof l && (t[e.name] = e.build());
  32484. return Object.defineProperty && Object.defineProperty(t, "$options", {
  32485. value: this.buildOpt()
  32486. }),
  32487. t
  32488. }
  32489. ,
  32490. t.buildOpt = function() {
  32491. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  32492. var r = t[i]
  32493. , o = this.options[t[i]];
  32494. e[r] = o
  32495. }
  32496. return e
  32497. }
  32498. ,
  32499. t.getOption = function(e) {
  32500. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  32501. }
  32502. ,
  32503. s.Namespace = l;
  32504. function u(e, t, i, n) {
  32505. if (this.type = e,
  32506. this.resolvedType = t,
  32507. this.isMapKey = i,
  32508. this.syntax = n,
  32509. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  32510. throw Error("Invalid map key type: " + e.name)
  32511. }
  32512. var i = u.prototype;
  32513. u.defaultFieldValue = function(e) {
  32514. if ("string" == typeof e && (e = g.TYPES[e]),
  32515. void 0 === e.defaultValue)
  32516. throw Error("default value for type " + e.name + " is not supported");
  32517. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  32518. }
  32519. ,
  32520. i.verifyValue = function(t) {
  32521. function i(e, t) {
  32522. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  32523. }
  32524. var n = this;
  32525. switch (this.type) {
  32526. case g.TYPES.int32:
  32527. case g.TYPES.sint32:
  32528. case g.TYPES.sfixed32:
  32529. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32530. 4294967295 < t ? 0 | t : t;
  32531. case g.TYPES.uint32:
  32532. case g.TYPES.fixed32:
  32533. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32534. t < 0 ? t >>> 0 : t;
  32535. case g.TYPES.int64:
  32536. case g.TYPES.sint64:
  32537. case g.TYPES.sfixed64:
  32538. if (g.Long)
  32539. try {
  32540. return a(t, !1)
  32541. } catch (e) {
  32542. i(typeof t, e.message)
  32543. }
  32544. else
  32545. i(typeof t, "requires Long.js");
  32546. case g.TYPES.uint64:
  32547. case g.TYPES.fixed64:
  32548. if (g.Long)
  32549. try {
  32550. return a(t, !0)
  32551. } catch (e) {
  32552. i(typeof t, e.message)
  32553. }
  32554. else
  32555. i(typeof t, "requires Long.js");
  32556. case g.TYPES.bool:
  32557. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  32558. t;
  32559. case g.TYPES.float:
  32560. case g.TYPES.double:
  32561. return "number" != typeof t && i(typeof t, "not a number"),
  32562. t;
  32563. case g.TYPES.string:
  32564. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  32565. "" + t;
  32566. case g.TYPES.bytes:
  32567. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  32568. case g.TYPES.enum:
  32569. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  32570. for (o = 0; o < e.length; o++) {
  32571. if (e[o].name == t)
  32572. return e[o].id;
  32573. if (e[o].id == t)
  32574. return e[o].id
  32575. }
  32576. if ("proto3" === this.syntax)
  32577. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32578. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  32579. t;
  32580. i(t, "not a valid enum value");
  32581. case g.TYPES.group:
  32582. case g.TYPES.message:
  32583. if (t && "object" == typeof t || i(typeof t, "object expected"),
  32584. t instanceof this.resolvedType.clazz)
  32585. return t;
  32586. if (t instanceof g.Builder.Message) {
  32587. var r = {};
  32588. for (var o in t)
  32589. t.hasOwnProperty(o) && (r[o] = t[o]);
  32590. t = r
  32591. }
  32592. return new this.resolvedType.clazz(t)
  32593. }
  32594. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  32595. }
  32596. ,
  32597. i.calculateLength = function(e, t) {
  32598. if (null === t)
  32599. return 0;
  32600. var i;
  32601. switch (this.type) {
  32602. case g.TYPES.int32:
  32603. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  32604. case g.TYPES.uint32:
  32605. return I.calculateVarint32(t);
  32606. case g.TYPES.sint32:
  32607. return I.calculateVarint32(I.zigZagEncode32(t));
  32608. case g.TYPES.fixed32:
  32609. case g.TYPES.sfixed32:
  32610. case g.TYPES.float:
  32611. return 4;
  32612. case g.TYPES.int64:
  32613. case g.TYPES.uint64:
  32614. return I.calculateVarint64(t);
  32615. case g.TYPES.sint64:
  32616. return I.calculateVarint64(I.zigZagEncode64(t));
  32617. case g.TYPES.fixed64:
  32618. case g.TYPES.sfixed64:
  32619. return 8;
  32620. case g.TYPES.bool:
  32621. return 1;
  32622. case g.TYPES.enum:
  32623. return I.calculateVarint32(t);
  32624. case g.TYPES.double:
  32625. return 8;
  32626. case g.TYPES.string:
  32627. return i = I.calculateUTF8Bytes(t),
  32628. I.calculateVarint32(i) + i;
  32629. case g.TYPES.bytes:
  32630. if (t.remaining() < 0)
  32631. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  32632. return I.calculateVarint32(t.remaining()) + t.remaining();
  32633. case g.TYPES.message:
  32634. return i = this.resolvedType.calculate(t),
  32635. I.calculateVarint32(i) + i;
  32636. case g.TYPES.group:
  32637. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  32638. }
  32639. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  32640. }
  32641. ,
  32642. i.encodeValue = function(e, t, i) {
  32643. if (null === t)
  32644. return i;
  32645. switch (this.type) {
  32646. case g.TYPES.int32:
  32647. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  32648. break;
  32649. case g.TYPES.uint32:
  32650. i.writeVarint32(t);
  32651. break;
  32652. case g.TYPES.sint32:
  32653. i.writeVarint32ZigZag(t);
  32654. break;
  32655. case g.TYPES.fixed32:
  32656. i.writeUint32(t);
  32657. break;
  32658. case g.TYPES.sfixed32:
  32659. i.writeInt32(t);
  32660. break;
  32661. case g.TYPES.int64:
  32662. case g.TYPES.uint64:
  32663. i.writeVarint64(t);
  32664. break;
  32665. case g.TYPES.sint64:
  32666. i.writeVarint64ZigZag(t);
  32667. break;
  32668. case g.TYPES.fixed64:
  32669. i.writeUint64(t);
  32670. break;
  32671. case g.TYPES.sfixed64:
  32672. i.writeInt64(t);
  32673. break;
  32674. case g.TYPES.bool:
  32675. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  32676. break;
  32677. case g.TYPES.enum:
  32678. i.writeVarint32(t);
  32679. break;
  32680. case g.TYPES.float:
  32681. i.writeFloat32(t);
  32682. break;
  32683. case g.TYPES.double:
  32684. i.writeFloat64(t);
  32685. break;
  32686. case g.TYPES.string:
  32687. i.writeVString(t);
  32688. break;
  32689. case g.TYPES.bytes:
  32690. if (t.remaining() < 0)
  32691. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  32692. var n = t.offset;
  32693. i.writeVarint32(t.remaining()),
  32694. i.append(t),
  32695. t.offset = n;
  32696. break;
  32697. case g.TYPES.message:
  32698. var r = (new I).LE();
  32699. this.resolvedType.encode(t, r),
  32700. i.writeVarint32(r.offset),
  32701. i.append(r.flip());
  32702. break;
  32703. case g.TYPES.group:
  32704. this.resolvedType.encode(t, i),
  32705. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  32706. break;
  32707. default:
  32708. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  32709. }
  32710. return i
  32711. }
  32712. ,
  32713. i.decode = function(e, t, i) {
  32714. if (t != this.type.wireType)
  32715. throw Error("Unexpected wire type for element");
  32716. var n, r;
  32717. switch (this.type) {
  32718. case g.TYPES.int32:
  32719. return 0 | e.readVarint32();
  32720. case g.TYPES.uint32:
  32721. return e.readVarint32() >>> 0;
  32722. case g.TYPES.sint32:
  32723. return 0 | e.readVarint32ZigZag();
  32724. case g.TYPES.fixed32:
  32725. return e.readUint32() >>> 0;
  32726. case g.TYPES.sfixed32:
  32727. return 0 | e.readInt32();
  32728. case g.TYPES.int64:
  32729. return e.readVarint64();
  32730. case g.TYPES.uint64:
  32731. return e.readVarint64().toUnsigned();
  32732. case g.TYPES.sint64:
  32733. return e.readVarint64ZigZag();
  32734. case g.TYPES.fixed64:
  32735. return e.readUint64();
  32736. case g.TYPES.sfixed64:
  32737. return e.readInt64();
  32738. case g.TYPES.bool:
  32739. return !!e.readVarint32();
  32740. case g.TYPES.enum:
  32741. return e.readVarint32();
  32742. case g.TYPES.float:
  32743. return e.readFloat();
  32744. case g.TYPES.double:
  32745. return e.readDouble();
  32746. case g.TYPES.string:
  32747. return e.readVString();
  32748. case g.TYPES.bytes:
  32749. if (r = e.readVarint32(),
  32750. e.remaining() < r)
  32751. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  32752. return (n = e.clone()).limit = n.offset + r,
  32753. e.offset += r,
  32754. n;
  32755. case g.TYPES.message:
  32756. return r = e.readVarint32(),
  32757. this.resolvedType.decode(e, r);
  32758. case g.TYPES.group:
  32759. return this.resolvedType.decode(e, -1, i)
  32760. }
  32761. throw Error("[INTERNAL] Illegal decode type")
  32762. }
  32763. ,
  32764. i.valueFromString = function(e) {
  32765. if (!this.isMapKey)
  32766. throw Error("valueFromString() called on non-map-key element");
  32767. switch (this.type) {
  32768. case g.TYPES.int32:
  32769. case g.TYPES.sint32:
  32770. case g.TYPES.sfixed32:
  32771. case g.TYPES.uint32:
  32772. case g.TYPES.fixed32:
  32773. return this.verifyValue(parseInt(e));
  32774. case g.TYPES.int64:
  32775. case g.TYPES.sint64:
  32776. case g.TYPES.sfixed64:
  32777. case g.TYPES.uint64:
  32778. case g.TYPES.fixed64:
  32779. return this.verifyValue(e);
  32780. case g.TYPES.bool:
  32781. return "true" === e;
  32782. case g.TYPES.string:
  32783. return this.verifyValue(e);
  32784. case g.TYPES.bytes:
  32785. return I.fromBinary(e)
  32786. }
  32787. }
  32788. ,
  32789. i.valueToString = function(e) {
  32790. if (!this.isMapKey)
  32791. throw Error("valueToString() called on non-map-key element");
  32792. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  32793. }
  32794. ,
  32795. s.Element = u;
  32796. var d = function(e, t, i, n, r, o) {
  32797. l.call(this, e, t, i, n, o),
  32798. this.className = "Message",
  32799. this.extensions = void 0,
  32800. this.clazz = null,
  32801. this.isGroup = !!r,
  32802. this._fields = null,
  32803. this._fieldsById = null,
  32804. this._fieldsByName = null
  32805. }
  32806. , n = d.prototype = Object.create(l.prototype);
  32807. n.build = function(e) {
  32808. if (this.clazz && !e)
  32809. return this.clazz;
  32810. var t = function(u, a) {
  32811. function d(e, i, n, r) {
  32812. if (null === e || "object" != typeof e) {
  32813. if (r && r instanceof u.Reflect.Enum) {
  32814. var t = u.Reflect.Enum.getName(r.object, e);
  32815. if (null !== t)
  32816. return t
  32817. }
  32818. return e
  32819. }
  32820. if (I.isByteBuffer(e))
  32821. return i ? e.toBase64() : e.toBuffer();
  32822. if (u.Long.isLong(e))
  32823. return n ? e.toString() : u.Long.fromValue(e);
  32824. var o;
  32825. if (Array.isArray(e))
  32826. return o = [],
  32827. e.forEach(function(e, t) {
  32828. o[t] = d(e, i, n, r)
  32829. }),
  32830. o;
  32831. if (o = {},
  32832. e instanceof u.Map) {
  32833. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  32834. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  32835. return o
  32836. }
  32837. var l = e.$type
  32838. , c = void 0;
  32839. for (var h in e)
  32840. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  32841. return o
  32842. }
  32843. var s = a.getChildren(u.Reflect.Message.Field)
  32844. , l = a.getChildren(u.Reflect.Message.OneOf)
  32845. , c = function(e, t) {
  32846. u.Builder.Message.call(this);
  32847. for (var i = 0, n = l.length; i < n; ++i)
  32848. this[l[i].name] = null;
  32849. for (i = 0,
  32850. n = s.length; i < n; ++i) {
  32851. var r = s[i];
  32852. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  32853. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  32854. }
  32855. var o;
  32856. if (0 < arguments.length)
  32857. 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)
  32858. for (i = 0,
  32859. n = arguments.length; i < n; ++i)
  32860. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  32861. else
  32862. this.$set(e)
  32863. }
  32864. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  32865. o.add = function(e, t, i) {
  32866. var n = a._fieldsByName[e];
  32867. if (!i) {
  32868. if (!n)
  32869. throw Error(this + "#" + e + " is undefined");
  32870. if (!(n instanceof u.Reflect.Message.Field))
  32871. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  32872. if (!n.repeated)
  32873. throw Error(this + "#" + e + " is not a repeated field");
  32874. t = n.verifyValue(t, !0)
  32875. }
  32876. return null === this[e] && (this[e] = []),
  32877. this[e].push(t),
  32878. this
  32879. }
  32880. ,
  32881. o.$add = o.add,
  32882. o.set = function(e, t, i) {
  32883. if (e && "object" == typeof e) {
  32884. for (var n in i = t,
  32885. e)
  32886. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  32887. return this
  32888. }
  32889. var r = a._fieldsByName[e];
  32890. if (i)
  32891. this[e] = t;
  32892. else {
  32893. if (!r)
  32894. throw Error(this + "#" + e + " is not a field: undefined");
  32895. if (!(r instanceof u.Reflect.Message.Field))
  32896. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  32897. this[r.name] = t = r.verifyValue(t)
  32898. }
  32899. if (r && r.oneof) {
  32900. var o = this[r.oneof.name];
  32901. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  32902. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  32903. }
  32904. return this
  32905. }
  32906. ,
  32907. o.$set = o.set,
  32908. o.get = function(e, t) {
  32909. if (t)
  32910. return this[e];
  32911. var i = a._fieldsByName[e];
  32912. if (!(i && i instanceof u.Reflect.Message.Field))
  32913. throw Error(this + "#" + e + " is not a field: undefined");
  32914. if (!(i instanceof u.Reflect.Message.Field))
  32915. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  32916. return this[i.name]
  32917. }
  32918. ,
  32919. o.$get = o.get;
  32920. for (var e = 0; e < s.length; e++) {
  32921. var t = s[e];
  32922. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  32923. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  32924. return e.toUpperCase().replace("_", "")
  32925. });
  32926. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  32927. function t(e, t) {
  32928. return this[i.name] = t ? e : i.verifyValue(e),
  32929. this
  32930. }
  32931. function n() {
  32932. return this[i.name]
  32933. }
  32934. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  32935. return "_" + e
  32936. });
  32937. null === a.getChild("set" + e) && (o["set" + e] = t),
  32938. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  32939. null === a.getChild("get" + e) && (o["get" + e] = n),
  32940. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  32941. }(t)
  32942. }
  32943. return o.encode = function(t, e) {
  32944. "boolean" == typeof t && (e = t,
  32945. t = void 0);
  32946. var i = !1;
  32947. t || (t = new I,
  32948. i = !0);
  32949. var n = t.littleEndian;
  32950. try {
  32951. return a.encode(this, t.LE(), e),
  32952. (i ? t.flip() : t).LE(n)
  32953. } catch (e) {
  32954. throw t.LE(n),
  32955. e
  32956. }
  32957. }
  32958. ,
  32959. c.encode = function(e, t, i) {
  32960. return new c(e).encode(t, i)
  32961. }
  32962. ,
  32963. o.calculate = function() {
  32964. return a.calculate(this)
  32965. }
  32966. ,
  32967. o.encodeDelimited = function(e, t) {
  32968. var i = !1;
  32969. e || (e = new I,
  32970. i = !0);
  32971. var n = (new I).LE();
  32972. return a.encode(this, n, t).flip(),
  32973. e.writeVarint32(n.remaining()),
  32974. e.append(n),
  32975. i ? e.flip() : e
  32976. }
  32977. ,
  32978. o.encodeAB = function() {
  32979. try {
  32980. return this.encode().toArrayBuffer()
  32981. } catch (e) {
  32982. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  32983. e
  32984. }
  32985. }
  32986. ,
  32987. o.toArrayBuffer = o.encodeAB,
  32988. o.encodeNB = function() {
  32989. try {
  32990. return this.encode().toBuffer()
  32991. } catch (e) {
  32992. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  32993. e
  32994. }
  32995. }
  32996. ,
  32997. o.toBuffer = o.encodeNB,
  32998. o.encode64 = function() {
  32999. try {
  33000. return this.encode().toBase64()
  33001. } catch (e) {
  33002. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33003. e
  33004. }
  33005. }
  33006. ,
  33007. o.toBase64 = o.encode64,
  33008. o.encodeHex = function() {
  33009. try {
  33010. return this.encode().toHex()
  33011. } catch (e) {
  33012. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33013. e
  33014. }
  33015. }
  33016. ,
  33017. o.toHex = o.encodeHex,
  33018. o.toRaw = function(e, t) {
  33019. return d(this, !!e, !!t, this.$type)
  33020. }
  33021. ,
  33022. o.encodeJSON = function() {
  33023. return JSON.stringify(d(this, !0, !0, this.$type))
  33024. }
  33025. ,
  33026. c.decode = function(t, e, i) {
  33027. "string" == typeof e && (i = e,
  33028. e = -1),
  33029. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33030. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33031. try {
  33032. var r = a.decode(t.LE());
  33033. return t.LE(n),
  33034. r
  33035. } catch (e) {
  33036. throw t.LE(n),
  33037. e
  33038. }
  33039. }
  33040. ,
  33041. c.decodeDelimited = function(t, e) {
  33042. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  33043. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  33044. return null;
  33045. var i = t.offset
  33046. , n = t.readVarint32();
  33047. if (t.remaining() < n)
  33048. return t.offset = i,
  33049. null;
  33050. try {
  33051. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  33052. return t.offset += n,
  33053. r
  33054. } catch (e) {
  33055. throw t.offset += n,
  33056. e
  33057. }
  33058. }
  33059. ,
  33060. c.decode64 = function(e) {
  33061. return c.decode(e, "base64")
  33062. }
  33063. ,
  33064. c.decodeHex = function(e) {
  33065. return c.decode(e, "hex")
  33066. }
  33067. ,
  33068. c.decodeJSON = function(e) {
  33069. return new c(JSON.parse(e))
  33070. }
  33071. ,
  33072. o.toString = function() {
  33073. return a.toString()
  33074. }
  33075. ,
  33076. Object.defineProperty && (Object.defineProperty(c, "$options", {
  33077. value: a.buildOpt()
  33078. }),
  33079. Object.defineProperty(o, "$options", {
  33080. value: c.$options
  33081. }),
  33082. Object.defineProperty(c, "$type", {
  33083. value: a
  33084. }),
  33085. Object.defineProperty(o, "$type", {
  33086. value: a
  33087. })),
  33088. c
  33089. }(g, this);
  33090. this._fields = [],
  33091. this._fieldsById = {},
  33092. this._fieldsByName = {};
  33093. for (var i, n = 0, r = this.children.length; n < r; n++)
  33094. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  33095. if (t.hasOwnProperty(i.name))
  33096. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  33097. t[i.name] = i.build()
  33098. } else if (i instanceof d.Field)
  33099. i.build(),
  33100. this._fields.push(i),
  33101. this._fieldsById[i.id] = i,
  33102. this._fieldsByName[i.name] = i;
  33103. else if (!(i instanceof d.OneOf || i instanceof v))
  33104. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  33105. return this.clazz = t
  33106. }
  33107. ,
  33108. n.encode = function(e, t, i) {
  33109. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33110. r = e[(n = this._fields[a]).name],
  33111. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33112. if (null === o)
  33113. return t;
  33114. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33115. throw l.encoded = t,
  33116. l
  33117. }
  33118. ,
  33119. n.calculate = function(e) {
  33120. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33121. if (i = e[(t = this._fields[r]).name],
  33122. t.required && null === i)
  33123. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33124. n += t.calculate(i, e)
  33125. }
  33126. return n
  33127. }
  33128. ,
  33129. n.decode = function(e, t, i) {
  33130. t = "number" == typeof t ? t : -1;
  33131. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  33132. if (o = (n = e.readVarint32()) >>> 3,
  33133. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  33134. if (o !== i)
  33135. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  33136. break
  33137. }
  33138. if (a = this._fieldsById[o]) {
  33139. if (a.repeated && !a.options.packed)
  33140. l[a.name].push(a.decode(r, e));
  33141. else if (a.map) {
  33142. var c = a.decode(r, e);
  33143. l[a.name].set(c[0], c[1])
  33144. } else if (l[a.name] = a.decode(r, e),
  33145. a.oneof) {
  33146. var h = l[a.oneof.name];
  33147. null !== h && h !== a.name && (l[h] = null),
  33148. l[a.oneof.name] = a.name
  33149. }
  33150. } else
  33151. switch (r) {
  33152. case g.WIRE_TYPES.VARINT:
  33153. e.readVarint32();
  33154. break;
  33155. case g.WIRE_TYPES.BITS32:
  33156. e.offset += 4;
  33157. break;
  33158. case g.WIRE_TYPES.BITS64:
  33159. e.offset += 8;
  33160. break;
  33161. case g.WIRE_TYPES.LDELIM:
  33162. var u = e.readVarint32();
  33163. e.offset += u;
  33164. break;
  33165. case g.WIRE_TYPES.STARTGROUP:
  33166. for (; m(o, e); )
  33167. ;
  33168. break;
  33169. default:
  33170. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  33171. }
  33172. }
  33173. for (var d = 0, p = this._fields.length; d < p; ++d)
  33174. if (null === l[(a = this._fields[d]).name])
  33175. if ("proto3" === this.syntax)
  33176. l[a.name] = a.defaultValue;
  33177. else {
  33178. if (a.required) {
  33179. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  33180. throw f.decoded = l,
  33181. f
  33182. }
  33183. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33184. }
  33185. return l
  33186. }
  33187. ,
  33188. s.Message = d;
  33189. function c(e, t, i, n, r, o, a, s, l, c) {
  33190. h.call(this, e, t, o),
  33191. this.className = "Message.Field",
  33192. this.required = "required" === i,
  33193. this.repeated = "repeated" === i,
  33194. this.map = "map" === i,
  33195. this.keyType = n || null,
  33196. this.type = r,
  33197. this.resolvedType = null,
  33198. this.id = a,
  33199. this.options = s || {},
  33200. this.defaultValue = null,
  33201. this.oneof = l || null,
  33202. this.syntax = c || "proto2",
  33203. this.originalName = this.name,
  33204. this.element = null,
  33205. this.keyElement = null,
  33206. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33207. }
  33208. var r = c.prototype = Object.create(h.prototype);
  33209. r.build = function() {
  33210. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  33211. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  33212. "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)
  33213. }
  33214. ,
  33215. r.verifyValue = function(e, t) {
  33216. function i(e, t) {
  33217. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33218. }
  33219. t = t || !1;
  33220. var n, r = this;
  33221. if (null === e)
  33222. return this.required && i(typeof e, "required"),
  33223. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  33224. null;
  33225. if (!this.repeated || t)
  33226. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  33227. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  33228. this.element.verifyValue(e));
  33229. Array.isArray(e) || (e = [e]);
  33230. var o = [];
  33231. for (n = 0; n < e.length; n++)
  33232. o.push(this.element.verifyValue(e[n]));
  33233. return o
  33234. }
  33235. ,
  33236. r.hasWirePresence = function(e, t) {
  33237. if ("proto3" !== this.syntax)
  33238. return null !== e;
  33239. if (this.oneof && t[this.oneof.name] === this.name)
  33240. return !0;
  33241. switch (this.type) {
  33242. case g.TYPES.int32:
  33243. case g.TYPES.sint32:
  33244. case g.TYPES.sfixed32:
  33245. case g.TYPES.uint32:
  33246. case g.TYPES.fixed32:
  33247. return 0 !== e;
  33248. case g.TYPES.int64:
  33249. case g.TYPES.sint64:
  33250. case g.TYPES.sfixed64:
  33251. case g.TYPES.uint64:
  33252. case g.TYPES.fixed64:
  33253. return 0 !== e.low || 0 !== e.high;
  33254. case g.TYPES.bool:
  33255. return e;
  33256. case g.TYPES.float:
  33257. case g.TYPES.double:
  33258. return 0 !== e;
  33259. case g.TYPES.string:
  33260. return 0 < e.length;
  33261. case g.TYPES.bytes:
  33262. return 0 < e.remaining();
  33263. case g.TYPES.enum:
  33264. return 0 !== e;
  33265. case g.TYPES.message:
  33266. return null !== e;
  33267. default:
  33268. return !0
  33269. }
  33270. }
  33271. ,
  33272. r.encode = function(t, r, e) {
  33273. if (null === this.type || "object" != typeof this.type)
  33274. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33275. if (null === t || this.repeated && 0 == t.length)
  33276. return r;
  33277. try {
  33278. var i;
  33279. if (this.repeated)
  33280. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33281. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33282. r.ensureCapacity(r.offset += 1);
  33283. var n = r.offset;
  33284. for (i = 0; i < t.length; i++)
  33285. this.element.encodeValue(this.id, t[i], r);
  33286. var o = r.offset - n
  33287. , a = I.calculateVarint32(o);
  33288. if (1 < a) {
  33289. var s = r.slice(n, r.offset);
  33290. n += a - 1,
  33291. r.offset = n,
  33292. r.append(s)
  33293. }
  33294. r.writeVarint32(o, n - a)
  33295. } else
  33296. for (i = 0; i < t.length; i++)
  33297. r.writeVarint32(this.id << 3 | this.type.wireType),
  33298. this.element.encodeValue(this.id, t[i], r);
  33299. else
  33300. this.map ? t.forEach(function(e, t, i) {
  33301. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33302. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33303. r.writeVarint32(n),
  33304. r.writeVarint32(8 | this.keyType.wireType),
  33305. this.keyElement.encodeValue(1, t, r),
  33306. r.writeVarint32(16 | this.type.wireType),
  33307. this.element.encodeValue(2, e, r)
  33308. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  33309. this.element.encodeValue(this.id, t, r))
  33310. } catch (e) {
  33311. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33312. }
  33313. return r
  33314. }
  33315. ,
  33316. r.calculate = function(t, e) {
  33317. if (t = this.verifyValue(t),
  33318. null === this.type || "object" != typeof this.type)
  33319. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33320. if (null === t || this.repeated && 0 == t.length)
  33321. return 0;
  33322. var r = 0;
  33323. try {
  33324. var i, n;
  33325. if (this.repeated)
  33326. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33327. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33328. i = n = 0; i < t.length; i++)
  33329. n += this.element.calculateLength(this.id, t[i]);
  33330. r += I.calculateVarint32(n),
  33331. r += n
  33332. } else
  33333. for (i = 0; i < t.length; i++)
  33334. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33335. r += this.element.calculateLength(this.id, t[i]);
  33336. else
  33337. this.map ? t.forEach(function(e, t, i) {
  33338. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33339. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33340. r += I.calculateVarint32(n),
  33341. r += n
  33342. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33343. r += this.element.calculateLength(this.id, t))
  33344. } catch (e) {
  33345. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33346. }
  33347. return r
  33348. }
  33349. ,
  33350. r.decode = function(e, t, i) {
  33351. var n, r;
  33352. 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))
  33353. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  33354. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  33355. r = t.readVarint32(),
  33356. r = t.offset + r;
  33357. for (var o = []; t.offset < r; )
  33358. o.push(this.decode(this.type.wireType, t, !0));
  33359. return o
  33360. }
  33361. if (this.map) {
  33362. var a = u.defaultFieldValue(this.keyType);
  33363. if (n = u.defaultFieldValue(this.type),
  33364. r = t.readVarint32(),
  33365. t.remaining() < r)
  33366. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  33367. var s = t.clone();
  33368. for (s.limit = s.offset + r,
  33369. t.offset += r; 0 < s.remaining(); ) {
  33370. var l = s.readVarint32();
  33371. e = 7 & l;
  33372. var c = l >>> 3;
  33373. if (1 == c)
  33374. a = this.keyElement.decode(s, e, c);
  33375. else {
  33376. if (2 != c)
  33377. throw Error("Unexpected tag in map field key/value submessage");
  33378. n = this.element.decode(s, e, c)
  33379. }
  33380. }
  33381. return [a, n]
  33382. }
  33383. return this.element.decode(t, e, this.id)
  33384. }
  33385. ,
  33386. s.Message.Field = c;
  33387. function o(e, t, i, n, r, o, a) {
  33388. c.call(this, e, t, i, null, n, r, o, a),
  33389. this.extension
  33390. }
  33391. o.prototype = Object.create(c.prototype),
  33392. s.Message.ExtensionField = o;
  33393. s.Message.OneOf = function(e, t, i) {
  33394. h.call(this, e, t, i),
  33395. this.fields = []
  33396. }
  33397. ;
  33398. var p = function(e, t, i, n, r) {
  33399. l.call(this, e, t, i, n, r),
  33400. this.className = "Enum",
  33401. this.object = null
  33402. };
  33403. p.getName = function(e, t) {
  33404. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33405. if (e[i = n[r]] === t)
  33406. return i;
  33407. return null
  33408. }
  33409. ,
  33410. (p.prototype = Object.create(l.prototype)).build = function(e) {
  33411. if (this.object && !e)
  33412. return this.object;
  33413. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  33414. t[i[n].name] = i[n].id;
  33415. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33416. value: this.buildOpt(),
  33417. enumerable: !1
  33418. }),
  33419. this.object = t
  33420. }
  33421. ,
  33422. s.Enum = p;
  33423. function f(e, t, i, n) {
  33424. h.call(this, e, t, i),
  33425. this.className = "Enum.Value",
  33426. this.id = n
  33427. }
  33428. f.prototype = Object.create(h.prototype),
  33429. s.Enum.Value = f;
  33430. var v = function(e, t, i, n) {
  33431. h.call(this, e, t, i),
  33432. this.field = n
  33433. };
  33434. v.prototype = Object.create(h.prototype),
  33435. s.Extension = v;
  33436. var y = function(e, t, i, n) {
  33437. l.call(this, e, t, i, n),
  33438. this.className = "Service",
  33439. this.clazz = null
  33440. };
  33441. (y.prototype = Object.create(l.prototype)).build = function(e) {
  33442. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  33443. for (var o = function(e) {
  33444. t.Builder.Service.call(this),
  33445. this.rpcImpl = e || function(e, t, i) {
  33446. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  33447. }
  33448. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  33449. !function(n) {
  33450. e[n.name] = function(e, i) {
  33451. try {
  33452. try {
  33453. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  33454. } catch (e) {
  33455. if (!(e instanceof TypeError))
  33456. throw e
  33457. }
  33458. if (null === e || "object" != typeof e)
  33459. throw Error("Illegal arguments");
  33460. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  33461. this.rpcImpl(n.fqn(), e, function(e, t) {
  33462. if (!e) {
  33463. null === t && (t = "");
  33464. try {
  33465. t = n.resolvedResponseType.clazz.decode(t)
  33466. } catch (e) {}
  33467. 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))
  33468. }
  33469. i(e)
  33470. })
  33471. } catch (e) {
  33472. setTimeout(i.bind(this, e), 0)
  33473. }
  33474. }
  33475. ,
  33476. o[n.name] = function(e, t, i) {
  33477. new o(e)[n.name](t, i)
  33478. }
  33479. ,
  33480. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  33481. value: n.buildOpt()
  33482. }),
  33483. Object.defineProperty(e[n.name], "$options", {
  33484. value: o[n.name].$options
  33485. }))
  33486. }(i[n]);
  33487. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  33488. value: r.buildOpt()
  33489. }),
  33490. Object.defineProperty(e, "$options", {
  33491. value: o.$options
  33492. }),
  33493. Object.defineProperty(o, "$type", {
  33494. value: r
  33495. }),
  33496. Object.defineProperty(e, "$type", {
  33497. value: r
  33498. })),
  33499. o
  33500. }(g, this)
  33501. }
  33502. ,
  33503. s.Service = y;
  33504. function A(e, t, i, n) {
  33505. h.call(this, e, t, i),
  33506. this.className = "Service.Method",
  33507. this.options = n || {}
  33508. }
  33509. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  33510. s.Service.Method = A;
  33511. function C(e, t, i, n, r, o, a, s) {
  33512. A.call(this, e, t, i, s),
  33513. this.className = "Service.RPCMethod",
  33514. this.requestName = n,
  33515. this.responseName = r,
  33516. this.requestStream = o,
  33517. this.responseStream = a,
  33518. this.resolvedRequestType = null,
  33519. this.resolvedResponseType = null
  33520. }
  33521. return C.prototype = Object.create(A.prototype),
  33522. s.Service.RPCMethod = C,
  33523. s
  33524. }(o),
  33525. o.Builder = (i = (u = o).Lang,
  33526. s = o.Reflect,
  33527. n = h.prototype,
  33528. h.isMessage = function(e) {
  33529. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  33530. }
  33531. ,
  33532. h.isMessageField = function(e) {
  33533. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  33534. }
  33535. ,
  33536. h.isEnum = function(e) {
  33537. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  33538. }
  33539. ,
  33540. h.isService = function(e) {
  33541. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  33542. }
  33543. ,
  33544. h.isExtend = function(e) {
  33545. return "string" == typeof e.ref
  33546. }
  33547. ,
  33548. n.reset = function() {
  33549. return this.ptr = this.ns,
  33550. this
  33551. }
  33552. ,
  33553. n.define = function(e) {
  33554. if ("string" != typeof e || !i.TYPEREF.test(e))
  33555. throw Error("illegal namespace: " + e);
  33556. return e.split(".").forEach(function(e) {
  33557. var t = this.ptr.getChild(e);
  33558. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  33559. this.ptr = t
  33560. }, this),
  33561. this
  33562. }
  33563. ,
  33564. n.create = function(e) {
  33565. if (!e)
  33566. return this;
  33567. if (Array.isArray(e)) {
  33568. if (0 === e.length)
  33569. return this;
  33570. e = e.slice()
  33571. } else
  33572. e = [e];
  33573. for (var t = [e]; 0 < t.length; ) {
  33574. if (e = t.pop(),
  33575. !Array.isArray(e))
  33576. throw Error("not a valid namespace: " + JSON.stringify(e));
  33577. for (; 0 < e.length; ) {
  33578. var i = e.shift();
  33579. if (h.isMessage(i)) {
  33580. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  33581. , n = {};
  33582. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  33583. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  33584. }, this),
  33585. i.fields && i.fields.forEach(function(e) {
  33586. if (null !== o.getChild(0 | e.id))
  33587. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  33588. if (e.options && "object" != typeof e.options)
  33589. throw Error("illegal field options in " + o.name + "#" + e.name);
  33590. var t = null;
  33591. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  33592. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  33593. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  33594. t && t.fields.push(e),
  33595. o.addChild(e)
  33596. }, this);
  33597. var r = [];
  33598. if (i.enums && i.enums.forEach(function(e) {
  33599. r.push(e)
  33600. }),
  33601. i.messages && i.messages.forEach(function(e) {
  33602. r.push(e)
  33603. }),
  33604. i.services && i.services.forEach(function(e) {
  33605. r.push(e)
  33606. }),
  33607. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  33608. this.ptr.addChild(o),
  33609. 0 < r.length) {
  33610. t.push(e),
  33611. e = r,
  33612. r = null,
  33613. this.ptr = o,
  33614. o = null;
  33615. continue
  33616. }
  33617. r = null
  33618. } else if (h.isEnum(i))
  33619. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  33620. i.values.forEach(function(e) {
  33621. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  33622. }, this),
  33623. this.ptr.addChild(o);
  33624. else if (h.isService(i))
  33625. o = new s.Service(this,this.ptr,i.name,i.options),
  33626. Object.keys(i.rpc).forEach(function(e) {
  33627. var t = i.rpc[e];
  33628. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  33629. }, this),
  33630. this.ptr.addChild(o);
  33631. else {
  33632. if (!h.isExtend(i))
  33633. throw Error("not a valid definition: " + JSON.stringify(i));
  33634. if (o = this.ptr.resolve(i.ref, !0))
  33635. i.fields.forEach(function(t) {
  33636. if (null !== o.getChild(0 | t.id))
  33637. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  33638. if (o.extensions) {
  33639. var i = !1;
  33640. if (o.extensions.forEach(function(e) {
  33641. t.id >= e[0] && t.id <= e[1] && (i = !0)
  33642. }),
  33643. !i)
  33644. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  33645. }
  33646. var e = t.name;
  33647. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  33648. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  33649. , r = new s.Extension(this,this.ptr,t.name,n);
  33650. n.extension = r,
  33651. this.ptr.addChild(r),
  33652. o.addChild(n)
  33653. }, this);
  33654. else if (!/\.?google\.protobuf\./.test(i.ref))
  33655. throw Error("extended message " + i.ref + " is not defined")
  33656. }
  33657. o = i = null
  33658. }
  33659. e = null,
  33660. this.ptr = this.ptr.parent
  33661. }
  33662. return this.resolved = !1,
  33663. this.result = null,
  33664. this
  33665. }
  33666. ,
  33667. n.import = function(t, e) {
  33668. var i = "/";
  33669. if ("string" == typeof e) {
  33670. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  33671. !0 === this.files[e])
  33672. return this.reset();
  33673. this.files[e] = !0
  33674. } else if ("object" == typeof e) {
  33675. var n = e.root;
  33676. u.Util.IS_NODE && (n = p("path").resolve(n)),
  33677. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  33678. var r = n + i + e.file;
  33679. if (!0 === this.files[r])
  33680. return this.reset();
  33681. this.files[r] = !0
  33682. }
  33683. if (t.imports && 0 < t.imports.length) {
  33684. var o, a = !1;
  33685. "object" == typeof e ? (this.importRoot = e.root,
  33686. a = !0,
  33687. o = this.importRoot,
  33688. e = e.file,
  33689. (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(/\\[^\\]*$/, ""),
  33690. i = "\\") : o = "." : o = null;
  33691. for (var s = 0; s < t.imports.length; s++)
  33692. if ("string" == typeof t.imports[s]) {
  33693. if (!o)
  33694. throw Error("cannot determine import root");
  33695. var l = t.imports[s];
  33696. if ("google/protobuf/descriptor.proto" === l)
  33697. continue;
  33698. if (l = o + i + l,
  33699. !0 === this.files[l])
  33700. continue;
  33701. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  33702. var c = u.Util.fetch(l);
  33703. if (null === c)
  33704. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  33705. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  33706. } else
  33707. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  33708. return t + "_import" + s + "." + i
  33709. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  33710. a && (this.importRoot = null)
  33711. }
  33712. t.package && this.define(t.package),
  33713. t.syntax && function t(i) {
  33714. i.messages && i.messages.forEach(function(e) {
  33715. e.syntax = i.syntax,
  33716. t(e)
  33717. }),
  33718. i.enums && i.enums.forEach(function(e) {
  33719. e.syntax = i.syntax
  33720. })
  33721. }(t);
  33722. var h = this.ptr;
  33723. return t.options && Object.keys(t.options).forEach(function(e) {
  33724. h.options[e] = t.options[e]
  33725. }),
  33726. t.messages && (this.create(t.messages),
  33727. this.ptr = h),
  33728. t.enums && (this.create(t.enums),
  33729. this.ptr = h),
  33730. t.services && (this.create(t.services),
  33731. this.ptr = h),
  33732. t.extends && this.create(t.extends),
  33733. this.reset()
  33734. }
  33735. ,
  33736. n.resolveAll = function() {
  33737. var e;
  33738. if (null == this.ptr || "object" == typeof this.ptr.type)
  33739. return this;
  33740. if (this.ptr instanceof s.Namespace)
  33741. this.ptr.children.forEach(function(e) {
  33742. this.ptr = e,
  33743. this.resolveAll()
  33744. }, this);
  33745. else if (this.ptr instanceof s.Message.Field) {
  33746. if (i.TYPE.test(this.ptr.type))
  33747. this.ptr.type = u.TYPES[this.ptr.type];
  33748. else {
  33749. if (!i.TYPEREF.test(this.ptr.type))
  33750. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  33751. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  33752. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  33753. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  33754. if (this.ptr.type = u.TYPES.enum,
  33755. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  33756. throw Error("proto3 message cannot reference proto2 enum")
  33757. } else {
  33758. if (!(e instanceof s.Message))
  33759. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  33760. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  33761. }
  33762. }
  33763. if (this.ptr.map) {
  33764. if (!i.TYPE.test(this.ptr.keyType))
  33765. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  33766. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  33767. }
  33768. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  33769. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  33770. throw Error("illegal service type in " + this.ptr.toString(!0));
  33771. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  33772. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  33773. if (this.ptr.resolvedRequestType = e,
  33774. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  33775. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  33776. this.ptr.resolvedResponseType = e
  33777. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  33778. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  33779. return this.reset()
  33780. }
  33781. ,
  33782. n.build = function(e) {
  33783. if (this.reset(),
  33784. this.resolved || (this.resolveAll(),
  33785. this.resolved = !0,
  33786. this.result = null),
  33787. null === this.result && (this.result = this.ns.build()),
  33788. !e)
  33789. return this.result;
  33790. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  33791. if (!i[t[n]]) {
  33792. i = null;
  33793. break
  33794. }
  33795. i = i[t[n]]
  33796. }
  33797. return i
  33798. }
  33799. ,
  33800. n.lookup = function(e, t) {
  33801. return e ? this.ns.resolve(e, t) : this.ns
  33802. }
  33803. ,
  33804. n.toString = function() {
  33805. return "Builder"
  33806. }
  33807. ,
  33808. h.Message = function() {}
  33809. ,
  33810. h.Enum = function() {}
  33811. ,
  33812. h.Service = function() {}
  33813. ,
  33814. h),
  33815. o.Map = (a = o.Reflect,
  33816. (t = c.prototype).clear = function() {
  33817. this.map = {}
  33818. }
  33819. ,
  33820. t.delete = function(e) {
  33821. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  33822. , i = t in this.map;
  33823. return delete this.map[t],
  33824. i
  33825. }
  33826. ,
  33827. t.entries = function() {
  33828. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  33829. t.push([(e = this.map[i[n]]).key, e.value]);
  33830. return l(t)
  33831. }
  33832. ,
  33833. t.keys = function() {
  33834. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  33835. e.push(this.map[t[i]].key);
  33836. return l(e)
  33837. }
  33838. ,
  33839. t.values = function() {
  33840. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  33841. e.push(this.map[t[i]].value);
  33842. return l(e)
  33843. }
  33844. ,
  33845. t.forEach = function(e, t) {
  33846. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  33847. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  33848. }
  33849. ,
  33850. t.set = function(e, t) {
  33851. var i = this.keyElem.verifyValue(e)
  33852. , n = this.valueElem.verifyValue(t);
  33853. return this.map[this.keyElem.valueToString(i)] = {
  33854. key: i,
  33855. value: n
  33856. },
  33857. this
  33858. }
  33859. ,
  33860. t.get = function(e) {
  33861. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  33862. if (t in this.map)
  33863. return this.map[t].value
  33864. }
  33865. ,
  33866. t.has = function(e) {
  33867. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  33868. }
  33869. ,
  33870. c),
  33871. o.loadProto = function(e, t, i) {
  33872. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  33873. t = void 0),
  33874. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  33875. }
  33876. ,
  33877. o.protoFromString = o.loadProto,
  33878. o.loadProtoFile = function(t, i, n) {
  33879. if (i && "object" == typeof i ? (n = i,
  33880. i = null) : i && "function" == typeof i || (i = null),
  33881. i)
  33882. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  33883. if (null !== e)
  33884. try {
  33885. i(null, o.loadProto(e, n, t))
  33886. } catch (e) {
  33887. i(e)
  33888. }
  33889. else
  33890. i(Error("Failed to fetch file"))
  33891. });
  33892. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  33893. return null === e ? null : o.loadProto(e, n, t)
  33894. }
  33895. ,
  33896. o.protoFromFile = o.loadProtoFile,
  33897. o.newBuilder = function(e) {
  33898. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  33899. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  33900. new o.Builder(e)
  33901. }
  33902. ,
  33903. o.loadJson = function(e, t, i) {
  33904. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  33905. t = null),
  33906. t && "object" == typeof t || (t = o.newBuilder()),
  33907. "string" == typeof e && (e = JSON.parse(e)),
  33908. t.import(e, i),
  33909. t.resolveAll(),
  33910. t
  33911. }
  33912. ,
  33913. o.loadJsonFile = function(t, i, n) {
  33914. if (i && "object" == typeof i ? (n = i,
  33915. i = null) : i && "function" == typeof i || (i = null),
  33916. i)
  33917. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  33918. if (null !== e)
  33919. try {
  33920. i(null, o.loadJson(JSON.parse(e), n, t))
  33921. } catch (e) {
  33922. i(e)
  33923. }
  33924. else
  33925. i(Error("Failed to fetch file"))
  33926. });
  33927. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  33928. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  33929. }
  33930. ,
  33931. o;
  33932. function l(e) {
  33933. var t = 0;
  33934. return {
  33935. next: function() {
  33936. return t < e.length ? {
  33937. done: !1,
  33938. value: e[t++]
  33939. } : {
  33940. done: !0
  33941. }
  33942. }
  33943. }
  33944. }
  33945. function c(e, t) {
  33946. if (!e.map)
  33947. throw Error("field is not a map");
  33948. if (this.field = e,
  33949. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  33950. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  33951. this.map = {},
  33952. Object.defineProperty(this, "size", {
  33953. get: function() {
  33954. return Object.keys(this.map).length
  33955. }
  33956. }),
  33957. t)
  33958. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  33959. var r = this.keyElem.valueFromString(i[n])
  33960. , o = this.valueElem.verifyValue(t[i[n]]);
  33961. this.map[this.keyElem.valueToString(r)] = {
  33962. key: r,
  33963. value: o
  33964. }
  33965. }
  33966. }
  33967. function h(e) {
  33968. this.ns = new s.Namespace(this,null,""),
  33969. this.ptr = this.ns,
  33970. this.resolved = !1,
  33971. this.result = null,
  33972. this.files = {},
  33973. this.importRoot = null,
  33974. this.options = e || {}
  33975. }
  33976. }
  33977. ,
  33978. "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)
  33979. }
  33980. ).call(this, p("_process"))
  33981. }
  33982. , {
  33983. _process: 203,
  33984. bytebuffer: 215,
  33985. fs: 197,
  33986. path: 197
  33987. }],
  33988. 215: [function(t, e, i) {
  33989. var n, r;
  33990. n = this,
  33991. r = function(l) {
  33992. "use strict";
  33993. function s(e) {
  33994. var t = 0;
  33995. return function() {
  33996. return t < e.length ? e.charCodeAt(t++) : null
  33997. }
  33998. }
  33999. function c() {
  34000. var e = []
  34001. , t = [];
  34002. return function() {
  34003. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34004. e.length = 0),
  34005. void Array.prototype.push.apply(e, arguments))
  34006. }
  34007. }
  34008. function n(e, t, i, n, r) {
  34009. 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];
  34010. for (u += d,
  34011. o = p & (1 << -h) - 1,
  34012. p >>= -h,
  34013. h += s; 0 < h; o = 256 * o + e[t + u],
  34014. u += d,
  34015. h -= 8)
  34016. ;
  34017. for (a = o & (1 << -h) - 1,
  34018. o >>= -h,
  34019. h += n; 0 < h; a = 256 * a + e[t + u],
  34020. u += d,
  34021. h -= 8)
  34022. ;
  34023. if (0 === o)
  34024. o = 1 - c;
  34025. else {
  34026. if (o === l)
  34027. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34028. a += Math.pow(2, n),
  34029. o -= c
  34030. }
  34031. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34032. }
  34033. function r(e, t, i, n, r, o) {
  34034. 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;
  34035. for (t = Math.abs(t),
  34036. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34037. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34038. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34039. l *= 2),
  34040. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  34041. l /= 2),
  34042. h <= a + u ? (s = 0,
  34043. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  34044. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34045. a = 0)); 8 <= r; e[i + p] = 255 & s,
  34046. p += f,
  34047. s /= 256,
  34048. r -= 8)
  34049. ;
  34050. for (a = a << r | s,
  34051. c += r; 0 < c; e[i + p] = 255 & a,
  34052. p += f,
  34053. a /= 256,
  34054. c -= 8)
  34055. ;
  34056. e[i + p - f] |= 128 * g
  34057. }
  34058. var f = function(e, t, i) {
  34059. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  34060. void 0 === t && (t = f.DEFAULT_ENDIAN),
  34061. void 0 === i && (i = f.DEFAULT_NOASSERT),
  34062. !i) {
  34063. if ((e |= 0) < 0)
  34064. throw RangeError("Illegal capacity");
  34065. t = !!t,
  34066. i = !!i
  34067. }
  34068. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  34069. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34070. this.offset = 0,
  34071. this.markedOffset = -1,
  34072. this.limit = e,
  34073. this.littleEndian = t,
  34074. this.noAssert = i
  34075. };
  34076. f.VERSION = "5.0.1",
  34077. f.LITTLE_ENDIAN = !0,
  34078. f.BIG_ENDIAN = !1,
  34079. f.DEFAULT_CAPACITY = 16,
  34080. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  34081. f.DEFAULT_NOASSERT = !1,
  34082. f.Long = l || null;
  34083. var a = f.prototype;
  34084. a.__isByteBuffer__,
  34085. Object.defineProperty(a, "__isByteBuffer__", {
  34086. value: !0,
  34087. enumerable: !1,
  34088. configurable: !1
  34089. });
  34090. var o = new ArrayBuffer(0)
  34091. , i = String.fromCharCode;
  34092. f.accessor = function() {
  34093. return Uint8Array
  34094. }
  34095. ,
  34096. f.allocate = function(e, t, i) {
  34097. return new f(e,t,i)
  34098. }
  34099. ,
  34100. f.concat = function(e, t, i, n) {
  34101. "boolean" != typeof t && "string" == typeof t || (n = i,
  34102. i = t,
  34103. t = void 0);
  34104. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  34105. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  34106. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  34107. if (0 === o)
  34108. return new f(0,i,n);
  34109. var l, c = new f(o,i,n);
  34110. for (a = 0; a < s; )
  34111. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  34112. c.offset += r);
  34113. return c.limit = c.offset,
  34114. c.offset = 0,
  34115. c
  34116. }
  34117. ,
  34118. f.isByteBuffer = function(e) {
  34119. return !0 === (e && e.__isByteBuffer__)
  34120. }
  34121. ,
  34122. f.type = function() {
  34123. return ArrayBuffer
  34124. }
  34125. ,
  34126. f.wrap = function(e, t, i, n) {
  34127. if ("string" != typeof t && (n = i,
  34128. i = t,
  34129. t = void 0),
  34130. "string" == typeof e)
  34131. switch (void 0 === t && (t = "utf8"),
  34132. t) {
  34133. case "base64":
  34134. return f.fromBase64(e, i);
  34135. case "hex":
  34136. return f.fromHex(e, i);
  34137. case "binary":
  34138. return f.fromBinary(e, i);
  34139. case "utf8":
  34140. return f.fromUTF8(e, i);
  34141. case "debug":
  34142. return f.fromDebug(e, i);
  34143. default:
  34144. throw Error("Unsupported encoding: " + t)
  34145. }
  34146. if (null === e || "object" != typeof e)
  34147. throw TypeError("Illegal buffer");
  34148. var r;
  34149. if (f.isByteBuffer(e))
  34150. return (r = a.clone.call(e)).markedOffset = -1,
  34151. r;
  34152. if (e instanceof Uint8Array)
  34153. r = new f(0,i,n),
  34154. 0 < e.length && (r.buffer = e.buffer,
  34155. r.offset = e.byteOffset,
  34156. r.limit = e.byteOffset + e.byteLength,
  34157. r.view = new Uint8Array(e.buffer));
  34158. else if (e instanceof ArrayBuffer)
  34159. r = new f(0,i,n),
  34160. 0 < e.byteLength && (r.buffer = e,
  34161. r.offset = 0,
  34162. r.limit = e.byteLength,
  34163. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  34164. else {
  34165. if ("[object Array]" !== Object.prototype.toString.call(e))
  34166. throw TypeError("Illegal buffer");
  34167. (r = new f(e.length,i,n)).limit = e.length;
  34168. for (var o = 0; o < e.length; ++o)
  34169. r.view[o] = e[o]
  34170. }
  34171. return r
  34172. }
  34173. ,
  34174. a.writeBitSet = function(e, t) {
  34175. var i = void 0 === t;
  34176. if (i && (t = this.offset),
  34177. !this.noAssert) {
  34178. if (!(e instanceof Array))
  34179. throw TypeError("Illegal BitSet: Not an array");
  34180. if ("number" != typeof t || t % 1 != 0)
  34181. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34182. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34183. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34184. }
  34185. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34186. for (t += this.writeVarint32(o, t); a--; )
  34187. 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,
  34188. this.writeByte(n, t++);
  34189. if (s < o) {
  34190. var l = 0;
  34191. for (n = 0; s < o; )
  34192. n |= (1 & !!e[s++]) << l++;
  34193. this.writeByte(n, t++)
  34194. }
  34195. return i ? (this.offset = t,
  34196. this) : t - r
  34197. }
  34198. ,
  34199. a.readBitSet = function(e) {
  34200. var t = void 0 === e;
  34201. t && (e = this.offset);
  34202. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34203. for (e += n.length; o--; )
  34204. i = this.readByte(e++),
  34205. s[a++] = !!(1 & i),
  34206. s[a++] = !!(2 & i),
  34207. s[a++] = !!(4 & i),
  34208. s[a++] = !!(8 & i),
  34209. s[a++] = !!(16 & i),
  34210. s[a++] = !!(32 & i),
  34211. s[a++] = !!(64 & i),
  34212. s[a++] = !!(128 & i);
  34213. if (a < r) {
  34214. var l = 0;
  34215. for (i = this.readByte(e++); a < r; )
  34216. s[a++] = !!(i >> l++ & 1)
  34217. }
  34218. return t && (this.offset = e),
  34219. s
  34220. }
  34221. ,
  34222. a.readBytes = function(e, t) {
  34223. var i = void 0 === t;
  34224. if (i && (t = this.offset),
  34225. !this.noAssert) {
  34226. if ("number" != typeof t || t % 1 != 0)
  34227. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34228. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  34229. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34230. }
  34231. var n = this.slice(t, t + e);
  34232. return i && (this.offset += e),
  34233. n
  34234. }
  34235. ,
  34236. a.writeBytes = a.append,
  34237. a.writeInt8 = function(e, t) {
  34238. var i = void 0 === t;
  34239. if (i && (t = this.offset),
  34240. !this.noAssert) {
  34241. if ("number" != typeof e || e % 1 != 0)
  34242. throw TypeError("Illegal value: " + e + " (not an integer)");
  34243. if (e |= 0,
  34244. "number" != typeof t || t % 1 != 0)
  34245. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34246. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34247. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34248. }
  34249. t += 1;
  34250. var n = this.buffer.byteLength;
  34251. return n < t && this.resize((n *= 2) > t ? n : t),
  34252. t -= 1,
  34253. this.view[t] = e,
  34254. i && (this.offset += 1),
  34255. this
  34256. }
  34257. ,
  34258. a.writeByte = a.writeInt8,
  34259. a.readInt8 = function(e) {
  34260. var t = void 0 === e;
  34261. if (t && (e = this.offset),
  34262. !this.noAssert) {
  34263. if ("number" != typeof e || e % 1 != 0)
  34264. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34265. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34266. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34267. }
  34268. var i = this.view[e];
  34269. return 128 == (128 & i) && (i = -(255 - i + 1)),
  34270. t && (this.offset += 1),
  34271. i
  34272. }
  34273. ,
  34274. a.readByte = a.readInt8,
  34275. a.writeUint8 = function(e, t) {
  34276. var i = void 0 === t;
  34277. if (i && (t = this.offset),
  34278. !this.noAssert) {
  34279. if ("number" != typeof e || e % 1 != 0)
  34280. throw TypeError("Illegal value: " + e + " (not an integer)");
  34281. if (e >>>= 0,
  34282. "number" != typeof t || t % 1 != 0)
  34283. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34284. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34285. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34286. }
  34287. t += 1;
  34288. var n = this.buffer.byteLength;
  34289. return n < t && this.resize((n *= 2) > t ? n : t),
  34290. t -= 1,
  34291. this.view[t] = e,
  34292. i && (this.offset += 1),
  34293. this
  34294. }
  34295. ,
  34296. a.writeUInt8 = a.writeUint8,
  34297. a.readUint8 = function(e) {
  34298. var t = void 0 === e;
  34299. if (t && (e = this.offset),
  34300. !this.noAssert) {
  34301. if ("number" != typeof e || e % 1 != 0)
  34302. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34303. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34304. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34305. }
  34306. var i = this.view[e];
  34307. return t && (this.offset += 1),
  34308. i
  34309. }
  34310. ,
  34311. a.readUInt8 = a.readUint8,
  34312. a.writeInt16 = function(e, t) {
  34313. var i = void 0 === t;
  34314. if (i && (t = this.offset),
  34315. !this.noAssert) {
  34316. if ("number" != typeof e || e % 1 != 0)
  34317. throw TypeError("Illegal value: " + e + " (not an integer)");
  34318. if (e |= 0,
  34319. "number" != typeof t || t % 1 != 0)
  34320. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34321. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34322. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34323. }
  34324. t += 2;
  34325. var n = this.buffer.byteLength;
  34326. return n < t && this.resize((n *= 2) > t ? n : t),
  34327. t -= 2,
  34328. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34329. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34330. this.view[t + 1] = 255 & e),
  34331. i && (this.offset += 2),
  34332. this
  34333. }
  34334. ,
  34335. a.writeShort = a.writeInt16,
  34336. a.readInt16 = function(e) {
  34337. var t = void 0 === e;
  34338. if (t && (e = this.offset),
  34339. !this.noAssert) {
  34340. if ("number" != typeof e || e % 1 != 0)
  34341. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34342. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34343. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34344. }
  34345. var i = 0;
  34346. return this.littleEndian ? (i = this.view[e],
  34347. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34348. i |= this.view[e + 1]),
  34349. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  34350. t && (this.offset += 2),
  34351. i
  34352. }
  34353. ,
  34354. a.readShort = a.readInt16,
  34355. a.writeUint16 = function(e, t) {
  34356. var i = void 0 === t;
  34357. if (i && (t = this.offset),
  34358. !this.noAssert) {
  34359. if ("number" != typeof e || e % 1 != 0)
  34360. throw TypeError("Illegal value: " + e + " (not an integer)");
  34361. if (e >>>= 0,
  34362. "number" != typeof t || t % 1 != 0)
  34363. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34364. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34365. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34366. }
  34367. t += 2;
  34368. var n = this.buffer.byteLength;
  34369. return n < t && this.resize((n *= 2) > t ? n : t),
  34370. t -= 2,
  34371. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34372. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34373. this.view[t + 1] = 255 & e),
  34374. i && (this.offset += 2),
  34375. this
  34376. }
  34377. ,
  34378. a.writeUInt16 = a.writeUint16,
  34379. a.readUint16 = function(e) {
  34380. var t = void 0 === e;
  34381. if (t && (e = this.offset),
  34382. !this.noAssert) {
  34383. if ("number" != typeof e || e % 1 != 0)
  34384. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34385. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34386. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34387. }
  34388. var i = 0;
  34389. return this.littleEndian ? (i = this.view[e],
  34390. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34391. i |= this.view[e + 1]),
  34392. t && (this.offset += 2),
  34393. i
  34394. }
  34395. ,
  34396. a.readUInt16 = a.readUint16,
  34397. a.writeInt32 = function(e, t) {
  34398. var i = void 0 === t;
  34399. if (i && (t = this.offset),
  34400. !this.noAssert) {
  34401. if ("number" != typeof e || e % 1 != 0)
  34402. throw TypeError("Illegal value: " + e + " (not an integer)");
  34403. if (e |= 0,
  34404. "number" != typeof t || t % 1 != 0)
  34405. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34406. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34407. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34408. }
  34409. t += 4;
  34410. var n = this.buffer.byteLength;
  34411. return n < t && this.resize((n *= 2) > t ? n : t),
  34412. t -= 4,
  34413. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34414. this.view[t + 2] = e >>> 16 & 255,
  34415. this.view[t + 1] = e >>> 8 & 255,
  34416. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34417. this.view[t + 1] = e >>> 16 & 255,
  34418. this.view[t + 2] = e >>> 8 & 255,
  34419. this.view[t + 3] = 255 & e),
  34420. i && (this.offset += 4),
  34421. this
  34422. }
  34423. ,
  34424. a.writeInt = a.writeInt32,
  34425. a.readInt32 = function(e) {
  34426. var t = void 0 === e;
  34427. if (t && (e = this.offset),
  34428. !this.noAssert) {
  34429. if ("number" != typeof e || e % 1 != 0)
  34430. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34431. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34432. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34433. }
  34434. var i = 0;
  34435. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34436. i |= this.view[e + 1] << 8,
  34437. i |= this.view[e],
  34438. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34439. i |= this.view[e + 2] << 8,
  34440. i |= this.view[e + 3],
  34441. i += this.view[e] << 24 >>> 0),
  34442. i |= 0,
  34443. t && (this.offset += 4),
  34444. i
  34445. }
  34446. ,
  34447. a.readInt = a.readInt32,
  34448. a.writeUint32 = function(e, t) {
  34449. var i = void 0 === t;
  34450. if (i && (t = this.offset),
  34451. !this.noAssert) {
  34452. if ("number" != typeof e || e % 1 != 0)
  34453. throw TypeError("Illegal value: " + e + " (not an integer)");
  34454. if (e >>>= 0,
  34455. "number" != typeof t || t % 1 != 0)
  34456. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34457. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34458. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34459. }
  34460. t += 4;
  34461. var n = this.buffer.byteLength;
  34462. return n < t && this.resize((n *= 2) > t ? n : t),
  34463. t -= 4,
  34464. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34465. this.view[t + 2] = e >>> 16 & 255,
  34466. this.view[t + 1] = e >>> 8 & 255,
  34467. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34468. this.view[t + 1] = e >>> 16 & 255,
  34469. this.view[t + 2] = e >>> 8 & 255,
  34470. this.view[t + 3] = 255 & e),
  34471. i && (this.offset += 4),
  34472. this
  34473. }
  34474. ,
  34475. a.writeUInt32 = a.writeUint32,
  34476. a.readUint32 = function(e) {
  34477. var t = void 0 === e;
  34478. if (t && (e = this.offset),
  34479. !this.noAssert) {
  34480. if ("number" != typeof e || e % 1 != 0)
  34481. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34482. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34483. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34484. }
  34485. var i = 0;
  34486. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34487. i |= this.view[e + 1] << 8,
  34488. i |= this.view[e],
  34489. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34490. i |= this.view[e + 2] << 8,
  34491. i |= this.view[e + 3],
  34492. i += this.view[e] << 24 >>> 0),
  34493. t && (this.offset += 4),
  34494. i
  34495. }
  34496. ,
  34497. a.readUInt32 = a.readUint32,
  34498. l && (a.writeInt64 = function(e, t) {
  34499. var i = void 0 === t;
  34500. if (i && (t = this.offset),
  34501. !this.noAssert) {
  34502. if ("number" == typeof e)
  34503. e = l.fromNumber(e);
  34504. else if ("string" == typeof e)
  34505. e = l.fromString(e);
  34506. else if (!(e && e instanceof l))
  34507. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34508. if ("number" != typeof t || t % 1 != 0)
  34509. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34510. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34511. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34512. }
  34513. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34514. t += 8;
  34515. var n = this.buffer.byteLength;
  34516. n < t && this.resize((n *= 2) > t ? n : t),
  34517. t -= 8;
  34518. var r = e.low
  34519. , o = e.high;
  34520. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  34521. this.view[t + 2] = r >>> 16 & 255,
  34522. this.view[t + 1] = r >>> 8 & 255,
  34523. this.view[t] = 255 & r,
  34524. t += 4,
  34525. this.view[t + 3] = o >>> 24 & 255,
  34526. this.view[t + 2] = o >>> 16 & 255,
  34527. this.view[t + 1] = o >>> 8 & 255,
  34528. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  34529. this.view[t + 1] = o >>> 16 & 255,
  34530. this.view[t + 2] = o >>> 8 & 255,
  34531. this.view[t + 3] = 255 & o,
  34532. t += 4,
  34533. this.view[t] = r >>> 24 & 255,
  34534. this.view[t + 1] = r >>> 16 & 255,
  34535. this.view[t + 2] = r >>> 8 & 255,
  34536. this.view[t + 3] = 255 & r),
  34537. i && (this.offset += 8),
  34538. this
  34539. }
  34540. ,
  34541. a.writeLong = a.writeInt64,
  34542. a.readInt64 = function(e) {
  34543. var t = void 0 === e;
  34544. if (t && (e = this.offset),
  34545. !this.noAssert) {
  34546. if ("number" != typeof e || e % 1 != 0)
  34547. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34548. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34549. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34550. }
  34551. var i = 0
  34552. , n = 0;
  34553. this.littleEndian ? (i = this.view[e + 2] << 16,
  34554. i |= this.view[e + 1] << 8,
  34555. i |= this.view[e],
  34556. i += this.view[e + 3] << 24 >>> 0,
  34557. e += 4,
  34558. n = this.view[e + 2] << 16,
  34559. n |= this.view[e + 1] << 8,
  34560. n |= this.view[e],
  34561. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  34562. n |= this.view[e + 2] << 8,
  34563. n |= this.view[e + 3],
  34564. n += this.view[e] << 24 >>> 0,
  34565. e += 4,
  34566. i = this.view[e + 1] << 16,
  34567. i |= this.view[e + 2] << 8,
  34568. i |= this.view[e + 3],
  34569. i += this.view[e] << 24 >>> 0);
  34570. var r = new l(i,n,!1);
  34571. return t && (this.offset += 8),
  34572. r
  34573. }
  34574. ,
  34575. a.readLong = a.readInt64,
  34576. a.writeUint64 = function(e, t) {
  34577. var i = void 0 === t;
  34578. if (i && (t = this.offset),
  34579. !this.noAssert) {
  34580. if ("number" == typeof e)
  34581. e = l.fromNumber(e);
  34582. else if ("string" == typeof e)
  34583. e = l.fromString(e);
  34584. else if (!(e && e instanceof l))
  34585. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34586. if ("number" != typeof t || t % 1 != 0)
  34587. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34588. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34589. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34590. }
  34591. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34592. t += 8;
  34593. var n = this.buffer.byteLength;
  34594. n < t && this.resize((n *= 2) > t ? n : t),
  34595. t -= 8;
  34596. var r = e.low
  34597. , o = e.high;
  34598. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  34599. this.view[t + 2] = r >>> 16 & 255,
  34600. this.view[t + 1] = r >>> 8 & 255,
  34601. this.view[t] = 255 & r,
  34602. t += 4,
  34603. this.view[t + 3] = o >>> 24 & 255,
  34604. this.view[t + 2] = o >>> 16 & 255,
  34605. this.view[t + 1] = o >>> 8 & 255,
  34606. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  34607. this.view[t + 1] = o >>> 16 & 255,
  34608. this.view[t + 2] = o >>> 8 & 255,
  34609. this.view[t + 3] = 255 & o,
  34610. t += 4,
  34611. this.view[t] = r >>> 24 & 255,
  34612. this.view[t + 1] = r >>> 16 & 255,
  34613. this.view[t + 2] = r >>> 8 & 255,
  34614. this.view[t + 3] = 255 & r),
  34615. i && (this.offset += 8),
  34616. this
  34617. }
  34618. ,
  34619. a.writeUInt64 = a.writeUint64,
  34620. a.readUint64 = function(e) {
  34621. var t = void 0 === e;
  34622. if (t && (e = this.offset),
  34623. !this.noAssert) {
  34624. if ("number" != typeof e || e % 1 != 0)
  34625. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34626. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34627. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34628. }
  34629. var i = 0
  34630. , n = 0;
  34631. this.littleEndian ? (i = this.view[e + 2] << 16,
  34632. i |= this.view[e + 1] << 8,
  34633. i |= this.view[e],
  34634. i += this.view[e + 3] << 24 >>> 0,
  34635. e += 4,
  34636. n = this.view[e + 2] << 16,
  34637. n |= this.view[e + 1] << 8,
  34638. n |= this.view[e],
  34639. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  34640. n |= this.view[e + 2] << 8,
  34641. n |= this.view[e + 3],
  34642. n += this.view[e] << 24 >>> 0,
  34643. e += 4,
  34644. i = this.view[e + 1] << 16,
  34645. i |= this.view[e + 2] << 8,
  34646. i |= this.view[e + 3],
  34647. i += this.view[e] << 24 >>> 0);
  34648. var r = new l(i,n,!0);
  34649. return t && (this.offset += 8),
  34650. r
  34651. }
  34652. ,
  34653. a.readUInt64 = a.readUint64),
  34654. a.writeFloat32 = function(e, t) {
  34655. var i = void 0 === t;
  34656. if (i && (t = this.offset),
  34657. !this.noAssert) {
  34658. if ("number" != typeof e)
  34659. throw TypeError("Illegal value: " + e + " (not a number)");
  34660. if ("number" != typeof t || t % 1 != 0)
  34661. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34662. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34663. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34664. }
  34665. t += 4;
  34666. var n = this.buffer.byteLength;
  34667. return n < t && this.resize((n *= 2) > t ? n : t),
  34668. t -= 4,
  34669. r(this.view, e, t, this.littleEndian, 23, 4),
  34670. i && (this.offset += 4),
  34671. this
  34672. }
  34673. ,
  34674. a.writeFloat = a.writeFloat32,
  34675. a.readFloat32 = function(e) {
  34676. var t = void 0 === e;
  34677. if (t && (e = this.offset),
  34678. !this.noAssert) {
  34679. if ("number" != typeof e || e % 1 != 0)
  34680. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34681. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34682. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34683. }
  34684. var i = n(this.view, e, this.littleEndian, 23, 4);
  34685. return t && (this.offset += 4),
  34686. i
  34687. }
  34688. ,
  34689. a.readFloat = a.readFloat32,
  34690. a.writeFloat64 = function(e, t) {
  34691. var i = void 0 === t;
  34692. if (i && (t = this.offset),
  34693. !this.noAssert) {
  34694. if ("number" != typeof e)
  34695. throw TypeError("Illegal value: " + e + " (not a number)");
  34696. if ("number" != typeof t || t % 1 != 0)
  34697. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34698. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34699. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34700. }
  34701. t += 8;
  34702. var n = this.buffer.byteLength;
  34703. return n < t && this.resize((n *= 2) > t ? n : t),
  34704. t -= 8,
  34705. r(this.view, e, t, this.littleEndian, 52, 8),
  34706. i && (this.offset += 8),
  34707. this
  34708. }
  34709. ,
  34710. a.writeDouble = a.writeFloat64,
  34711. a.readFloat64 = function(e) {
  34712. var t = void 0 === e;
  34713. if (t && (e = this.offset),
  34714. !this.noAssert) {
  34715. if ("number" != typeof e || e % 1 != 0)
  34716. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34717. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34718. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34719. }
  34720. var i = n(this.view, e, this.littleEndian, 52, 8);
  34721. return t && (this.offset += 8),
  34722. i
  34723. }
  34724. ,
  34725. a.readDouble = a.readFloat64,
  34726. f.MAX_VARINT32_BYTES = 5,
  34727. f.calculateVarint32 = function(e) {
  34728. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  34729. }
  34730. ,
  34731. f.zigZagEncode32 = function(e) {
  34732. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  34733. }
  34734. ,
  34735. f.zigZagDecode32 = function(e) {
  34736. return e >>> 1 ^ -(1 & e) | 0
  34737. }
  34738. ,
  34739. a.writeVarint32 = function(e, t) {
  34740. var i = void 0 === t;
  34741. if (i && (t = this.offset),
  34742. !this.noAssert) {
  34743. if ("number" != typeof e || e % 1 != 0)
  34744. throw TypeError("Illegal value: " + e + " (not an integer)");
  34745. if (e |= 0,
  34746. "number" != typeof t || t % 1 != 0)
  34747. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34748. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34749. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34750. }
  34751. var n, r = f.calculateVarint32(e);
  34752. t += r;
  34753. var o = this.buffer.byteLength;
  34754. for (o < t && this.resize((o *= 2) > t ? o : t),
  34755. t -= r,
  34756. e >>>= 0; 128 <= e; )
  34757. n = 127 & e | 128,
  34758. this.view[t++] = n,
  34759. e >>>= 7;
  34760. return this.view[t++] = e,
  34761. i ? (this.offset = t,
  34762. this) : r
  34763. }
  34764. ,
  34765. a.writeVarint32ZigZag = function(e, t) {
  34766. return this.writeVarint32(f.zigZagEncode32(e), t)
  34767. }
  34768. ,
  34769. a.readVarint32 = function(e) {
  34770. var t = void 0 === e;
  34771. if (t && (e = this.offset),
  34772. !this.noAssert) {
  34773. if ("number" != typeof e || e % 1 != 0)
  34774. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34775. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34776. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34777. }
  34778. var i, n = 0, r = 0;
  34779. do {
  34780. if (!this.noAssert && e > this.limit) {
  34781. var o = Error("Truncated");
  34782. throw o.truncated = !0,
  34783. o
  34784. }
  34785. i = this.view[e++],
  34786. n < 5 && (r |= (127 & i) << 7 * n),
  34787. ++n
  34788. } while (0 != (128 & i));return r |= 0,
  34789. t ? (this.offset = e,
  34790. r) : {
  34791. value: r,
  34792. length: n
  34793. }
  34794. }
  34795. ,
  34796. a.readVarint32ZigZag = function(e) {
  34797. var t = this.readVarint32(e);
  34798. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  34799. t
  34800. }
  34801. ,
  34802. l && (f.MAX_VARINT64_BYTES = 10,
  34803. f.calculateVarint64 = function(e) {
  34804. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  34805. var t = e.toInt() >>> 0
  34806. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  34807. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  34808. 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
  34809. }
  34810. ,
  34811. f.zigZagEncode64 = function(e) {
  34812. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  34813. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  34814. }
  34815. ,
  34816. f.zigZagDecode64 = function(e) {
  34817. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  34818. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  34819. }
  34820. ,
  34821. a.writeVarint64 = function(e, t) {
  34822. var i = void 0 === t;
  34823. if (i && (t = this.offset),
  34824. !this.noAssert) {
  34825. if ("number" == typeof e)
  34826. e = l.fromNumber(e);
  34827. else if ("string" == typeof e)
  34828. e = l.fromString(e);
  34829. else if (!(e && e instanceof l))
  34830. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34831. if ("number" != typeof t || t % 1 != 0)
  34832. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34833. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34834. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34835. }
  34836. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  34837. var n = f.calculateVarint64(e)
  34838. , r = e.toInt() >>> 0
  34839. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  34840. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  34841. t += n;
  34842. var s = this.buffer.byteLength;
  34843. switch (s < t && this.resize((s *= 2) > t ? s : t),
  34844. t -= n,
  34845. n) {
  34846. case 10:
  34847. this.view[t + 9] = a >>> 7 & 1;
  34848. case 9:
  34849. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  34850. case 8:
  34851. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  34852. case 7:
  34853. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  34854. case 6:
  34855. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  34856. case 5:
  34857. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  34858. case 4:
  34859. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  34860. case 3:
  34861. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  34862. case 2:
  34863. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  34864. case 1:
  34865. this.view[t] = 1 !== n ? 128 | r : 127 & r
  34866. }
  34867. return i ? (this.offset += n,
  34868. this) : n
  34869. }
  34870. ,
  34871. a.writeVarint64ZigZag = function(e, t) {
  34872. return this.writeVarint64(f.zigZagEncode64(e), t)
  34873. }
  34874. ,
  34875. a.readVarint64 = function(e) {
  34876. var t = void 0 === e;
  34877. if (t && (e = this.offset),
  34878. !this.noAssert) {
  34879. if ("number" != typeof e || e % 1 != 0)
  34880. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34881. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34882. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34883. }
  34884. var i = e
  34885. , n = 0
  34886. , r = 0
  34887. , o = 0
  34888. , a = 0;
  34889. if (n = 127 & (a = this.view[e++]),
  34890. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  34891. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  34892. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  34893. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  34894. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  34895. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  34896. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  34897. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  34898. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  34899. 128 & a || this.noAssert && void 0 === a))))))))))
  34900. throw Error("Buffer overrun");
  34901. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  34902. return t ? (this.offset = e,
  34903. s) : {
  34904. value: s,
  34905. length: e - i
  34906. }
  34907. }
  34908. ,
  34909. a.readVarint64ZigZag = function(e) {
  34910. var t = this.readVarint64(e);
  34911. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  34912. t
  34913. }
  34914. ),
  34915. a.writeCString = function(e, t) {
  34916. var i = void 0 === t;
  34917. i && (t = this.offset);
  34918. var n, r = e.length;
  34919. if (!this.noAssert) {
  34920. if ("string" != typeof e)
  34921. throw TypeError("Illegal str: Not a string");
  34922. for (n = 0; n < r; ++n)
  34923. if (0 === e.charCodeAt(n))
  34924. throw RangeError("Illegal str: Contains NULL-characters");
  34925. if ("number" != typeof t || t % 1 != 0)
  34926. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34927. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34928. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34929. }
  34930. r = d.calculateUTF16asUTF8(s(e))[1],
  34931. t += r + 1;
  34932. var o = this.buffer.byteLength;
  34933. return o < t && this.resize((o *= 2) > t ? o : t),
  34934. t -= r + 1,
  34935. d.encodeUTF16toUTF8(s(e), function(e) {
  34936. this.view[t++] = e
  34937. }
  34938. .bind(this)),
  34939. this.view[t++] = 0,
  34940. i ? (this.offset = t,
  34941. this) : r
  34942. }
  34943. ,
  34944. a.readCString = function(e) {
  34945. var t = void 0 === e;
  34946. if (t && (e = this.offset),
  34947. !this.noAssert) {
  34948. if ("number" != typeof e || e % 1 != 0)
  34949. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34950. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34951. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34952. }
  34953. var i, n = e, r = -1;
  34954. return d.decodeUTF8toUTF16(function() {
  34955. if (0 === r)
  34956. return null;
  34957. if (e >= this.limit)
  34958. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  34959. return 0 === (r = this.view[e++]) ? null : r
  34960. }
  34961. .bind(this), i = c(), !0),
  34962. t ? (this.offset = e,
  34963. i()) : {
  34964. string: i(),
  34965. length: e - n
  34966. }
  34967. }
  34968. ,
  34969. a.writeIString = function(e, t) {
  34970. var i = void 0 === t;
  34971. if (i && (t = this.offset),
  34972. !this.noAssert) {
  34973. if ("string" != typeof e)
  34974. throw TypeError("Illegal str: Not a string");
  34975. if ("number" != typeof t || t % 1 != 0)
  34976. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34977. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34978. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34979. }
  34980. var n, r = t;
  34981. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  34982. t += 4 + n;
  34983. var o = this.buffer.byteLength;
  34984. if (o < t && this.resize((o *= 2) > t ? o : t),
  34985. t -= 4 + n,
  34986. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  34987. this.view[t + 2] = n >>> 16 & 255,
  34988. this.view[t + 1] = n >>> 8 & 255,
  34989. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  34990. this.view[t + 1] = n >>> 16 & 255,
  34991. this.view[t + 2] = n >>> 8 & 255,
  34992. this.view[t + 3] = 255 & n),
  34993. t += 4,
  34994. d.encodeUTF16toUTF8(s(e), function(e) {
  34995. this.view[t++] = e
  34996. }
  34997. .bind(this)),
  34998. t !== r + 4 + n)
  34999. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35000. return i ? (this.offset = t,
  35001. this) : t - r
  35002. }
  35003. ,
  35004. a.readIString = function(e) {
  35005. var t = void 0 === e;
  35006. if (t && (e = this.offset),
  35007. !this.noAssert) {
  35008. if ("number" != typeof e || e % 1 != 0)
  35009. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35010. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35011. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35012. }
  35013. var i = e
  35014. , n = this.readUint32(e)
  35015. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35016. return e += r.length,
  35017. t ? (this.offset = e,
  35018. r.string) : {
  35019. string: r.string,
  35020. length: e - i
  35021. }
  35022. }
  35023. ,
  35024. f.METRICS_CHARS = "c",
  35025. f.METRICS_BYTES = "b",
  35026. a.writeUTF8String = function(e, t) {
  35027. var i = void 0 === t;
  35028. if (i && (t = this.offset),
  35029. !this.noAssert) {
  35030. if ("number" != typeof t || t % 1 != 0)
  35031. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35032. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35033. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35034. }
  35035. var n, r = t;
  35036. n = d.calculateUTF16asUTF8(s(e))[1],
  35037. t += n;
  35038. var o = this.buffer.byteLength;
  35039. return o < t && this.resize((o *= 2) > t ? o : t),
  35040. t -= n,
  35041. d.encodeUTF16toUTF8(s(e), function(e) {
  35042. this.view[t++] = e
  35043. }
  35044. .bind(this)),
  35045. i ? (this.offset = t,
  35046. this) : t - r
  35047. }
  35048. ,
  35049. a.writeString = a.writeUTF8String,
  35050. f.calculateUTF8Chars = function(e) {
  35051. return d.calculateUTF16asUTF8(s(e))[0]
  35052. }
  35053. ,
  35054. f.calculateUTF8Bytes = function(e) {
  35055. return d.calculateUTF16asUTF8(s(e))[1]
  35056. }
  35057. ,
  35058. f.calculateString = f.calculateUTF8Bytes,
  35059. a.readUTF8String = function(e, t, i) {
  35060. "number" == typeof t && (i = t,
  35061. t = void 0);
  35062. var n = void 0 === i;
  35063. if (n && (i = this.offset),
  35064. void 0 === t && (t = f.METRICS_CHARS),
  35065. !this.noAssert) {
  35066. if ("number" != typeof e || e % 1 != 0)
  35067. throw TypeError("Illegal length: " + e + " (not an integer)");
  35068. if (e |= 0,
  35069. "number" != typeof i || i % 1 != 0)
  35070. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35071. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35072. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35073. }
  35074. var r, o = 0, a = i;
  35075. if (t === f.METRICS_CHARS) {
  35076. if (r = c(),
  35077. d.decodeUTF8(function() {
  35078. return o < e && i < this.limit ? this.view[i++] : null
  35079. }
  35080. .bind(this), function(e) {
  35081. ++o,
  35082. d.UTF8toUTF16(e, r)
  35083. }),
  35084. o !== e)
  35085. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  35086. return n ? (this.offset = i,
  35087. r()) : {
  35088. string: r(),
  35089. length: i - a
  35090. }
  35091. }
  35092. if (t !== f.METRICS_BYTES)
  35093. throw TypeError("Unsupported metrics: " + t);
  35094. if (!this.noAssert) {
  35095. if ("number" != typeof i || i % 1 != 0)
  35096. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35097. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  35098. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  35099. }
  35100. var s = i + e;
  35101. if (d.decodeUTF8toUTF16(function() {
  35102. return i < s ? this.view[i++] : null
  35103. }
  35104. .bind(this), r = c(), this.noAssert),
  35105. i !== s)
  35106. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  35107. return n ? (this.offset = i,
  35108. r()) : {
  35109. string: r(),
  35110. length: i - a
  35111. }
  35112. }
  35113. ,
  35114. a.readString = a.readUTF8String,
  35115. a.writeVString = function(e, t) {
  35116. var i = void 0 === t;
  35117. if (i && (t = this.offset),
  35118. !this.noAssert) {
  35119. if ("string" != typeof e)
  35120. throw TypeError("Illegal str: Not a string");
  35121. if ("number" != typeof t || t % 1 != 0)
  35122. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35123. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35124. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35125. }
  35126. var n, r, o = t;
  35127. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35128. r = f.calculateVarint32(n),
  35129. t += r + n;
  35130. var a = this.buffer.byteLength;
  35131. if (a < t && this.resize((a *= 2) > t ? a : t),
  35132. t -= r + n,
  35133. t += this.writeVarint32(n, t),
  35134. d.encodeUTF16toUTF8(s(e), function(e) {
  35135. this.view[t++] = e
  35136. }
  35137. .bind(this)),
  35138. t !== o + n + r)
  35139. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  35140. return i ? (this.offset = t,
  35141. this) : t - o
  35142. }
  35143. ,
  35144. a.readVString = function(e) {
  35145. var t = void 0 === e;
  35146. if (t && (e = this.offset),
  35147. !this.noAssert) {
  35148. if ("number" != typeof e || e % 1 != 0)
  35149. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35150. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35151. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35152. }
  35153. var i = e
  35154. , n = this.readVarint32(e)
  35155. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  35156. return e += r.length,
  35157. t ? (this.offset = e,
  35158. r.string) : {
  35159. string: r.string,
  35160. length: e - i
  35161. }
  35162. }
  35163. ,
  35164. a.append = function(e, t, i) {
  35165. "number" != typeof t && "string" == typeof t || (i = t,
  35166. t = void 0);
  35167. var n = void 0 === i;
  35168. if (n && (i = this.offset),
  35169. !this.noAssert) {
  35170. if ("number" != typeof i || i % 1 != 0)
  35171. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35172. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35173. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35174. }
  35175. e instanceof f || (e = f.wrap(e, t));
  35176. var r = e.limit - e.offset;
  35177. if (r <= 0)
  35178. return this;
  35179. i += r;
  35180. var o = this.buffer.byteLength;
  35181. return o < i && this.resize((o *= 2) > i ? o : i),
  35182. i -= r,
  35183. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35184. e.offset += r,
  35185. n && (this.offset += r),
  35186. this
  35187. }
  35188. ,
  35189. a.appendTo = function(e, t) {
  35190. return e.append(this, t),
  35191. this
  35192. }
  35193. ,
  35194. a.assert = function(e) {
  35195. return this.noAssert = !e,
  35196. this
  35197. }
  35198. ,
  35199. a.capacity = function() {
  35200. return this.buffer.byteLength
  35201. }
  35202. ,
  35203. a.clear = function() {
  35204. return this.offset = 0,
  35205. this.limit = this.buffer.byteLength,
  35206. this.markedOffset = -1,
  35207. this
  35208. }
  35209. ,
  35210. a.clone = function(e) {
  35211. var t = new f(0,this.littleEndian,this.noAssert);
  35212. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35213. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35214. t.view = this.view),
  35215. t.offset = this.offset,
  35216. t.markedOffset = this.markedOffset,
  35217. t.limit = this.limit,
  35218. t
  35219. }
  35220. ,
  35221. a.compact = function(e, t) {
  35222. if (void 0 === e && (e = this.offset),
  35223. void 0 === t && (t = this.limit),
  35224. !this.noAssert) {
  35225. if ("number" != typeof e || e % 1 != 0)
  35226. throw TypeError("Illegal begin: Not an integer");
  35227. if (e >>>= 0,
  35228. "number" != typeof t || t % 1 != 0)
  35229. throw TypeError("Illegal end: Not an integer");
  35230. if (t >>>= 0,
  35231. e < 0 || t < e || t > this.buffer.byteLength)
  35232. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35233. }
  35234. if (0 === e && t === this.buffer.byteLength)
  35235. return this;
  35236. var i = t - e;
  35237. if (0 == i)
  35238. return this.buffer = o,
  35239. this.view = null,
  35240. 0 <= this.markedOffset && (this.markedOffset -= e),
  35241. this.offset = 0,
  35242. this.limit = 0,
  35243. this;
  35244. var n = new ArrayBuffer(i)
  35245. , r = new Uint8Array(n);
  35246. return r.set(this.view.subarray(e, t)),
  35247. this.buffer = n,
  35248. this.view = r,
  35249. 0 <= this.markedOffset && (this.markedOffset -= e),
  35250. this.offset = 0,
  35251. this.limit = i,
  35252. this
  35253. }
  35254. ,
  35255. a.copy = function(e, t) {
  35256. if (void 0 === e && (e = this.offset),
  35257. void 0 === t && (t = this.limit),
  35258. !this.noAssert) {
  35259. if ("number" != typeof e || e % 1 != 0)
  35260. throw TypeError("Illegal begin: Not an integer");
  35261. if (e >>>= 0,
  35262. "number" != typeof t || t % 1 != 0)
  35263. throw TypeError("Illegal end: Not an integer");
  35264. if (t >>>= 0,
  35265. e < 0 || t < e || t > this.buffer.byteLength)
  35266. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35267. }
  35268. if (e === t)
  35269. return new f(0,this.littleEndian,this.noAssert);
  35270. var i = t - e
  35271. , n = new f(i,this.littleEndian,this.noAssert);
  35272. return n.offset = 0,
  35273. n.limit = i,
  35274. 0 <= n.markedOffset && (n.markedOffset -= e),
  35275. this.copyTo(n, 0, e, t),
  35276. n
  35277. }
  35278. ,
  35279. a.copyTo = function(e, t, i, n) {
  35280. var r, o;
  35281. if (!this.noAssert && !f.isByteBuffer(e))
  35282. throw TypeError("Illegal target: Not a ByteBuffer");
  35283. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  35284. i = (r = void 0 === i) ? this.offset : 0 | i,
  35285. n = void 0 === n ? this.limit : 0 | n,
  35286. t < 0 || t > e.buffer.byteLength)
  35287. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35288. if (i < 0 || n > this.buffer.byteLength)
  35289. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35290. var a = n - i;
  35291. return 0 == a ? e : (e.ensureCapacity(t + a),
  35292. e.view.set(this.view.subarray(i, n), t),
  35293. r && (this.offset += a),
  35294. o && (e.offset += a),
  35295. this)
  35296. }
  35297. ,
  35298. a.ensureCapacity = function(e) {
  35299. var t = this.buffer.byteLength;
  35300. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35301. }
  35302. ,
  35303. a.fill = function(e, t, i) {
  35304. var n = void 0 === t;
  35305. if (n && (t = this.offset),
  35306. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  35307. void 0 === t && (t = this.offset),
  35308. void 0 === i && (i = this.limit),
  35309. !this.noAssert) {
  35310. if ("number" != typeof e || e % 1 != 0)
  35311. throw TypeError("Illegal value: " + e + " (not an integer)");
  35312. if (e |= 0,
  35313. "number" != typeof t || t % 1 != 0)
  35314. throw TypeError("Illegal begin: Not an integer");
  35315. if (t >>>= 0,
  35316. "number" != typeof i || i % 1 != 0)
  35317. throw TypeError("Illegal end: Not an integer");
  35318. if (i >>>= 0,
  35319. t < 0 || i < t || i > this.buffer.byteLength)
  35320. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35321. }
  35322. if (i <= t)
  35323. return this;
  35324. for (; t < i; )
  35325. this.view[t++] = e;
  35326. return n && (this.offset = t),
  35327. this
  35328. }
  35329. ,
  35330. a.flip = function() {
  35331. return this.limit = this.offset,
  35332. this.offset = 0,
  35333. this
  35334. }
  35335. ,
  35336. a.mark = function(e) {
  35337. if (e = void 0 === e ? this.offset : e,
  35338. !this.noAssert) {
  35339. if ("number" != typeof e || e % 1 != 0)
  35340. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35341. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  35342. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35343. }
  35344. return this.markedOffset = e,
  35345. this
  35346. }
  35347. ,
  35348. a.order = function(e) {
  35349. if (!this.noAssert && "boolean" != typeof e)
  35350. throw TypeError("Illegal littleEndian: Not a boolean");
  35351. return this.littleEndian = !!e,
  35352. this
  35353. }
  35354. ,
  35355. a.LE = function(e) {
  35356. return this.littleEndian = void 0 === e || !!e,
  35357. this
  35358. }
  35359. ,
  35360. a.BE = function(e) {
  35361. return this.littleEndian = void 0 !== e && !e,
  35362. this
  35363. }
  35364. ,
  35365. a.prepend = function(e, t, i) {
  35366. "number" != typeof t && "string" == typeof t || (i = t,
  35367. t = void 0);
  35368. var n = void 0 === i;
  35369. if (n && (i = this.offset),
  35370. !this.noAssert) {
  35371. if ("number" != typeof i || i % 1 != 0)
  35372. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35373. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35374. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35375. }
  35376. e instanceof f || (e = f.wrap(e, t));
  35377. var r = e.limit - e.offset;
  35378. if (r <= 0)
  35379. return this;
  35380. var o = r - i;
  35381. if (0 < o) {
  35382. var a = new ArrayBuffer(this.buffer.byteLength + o)
  35383. , s = new Uint8Array(a);
  35384. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  35385. this.buffer = a,
  35386. this.view = s,
  35387. this.offset += o,
  35388. 0 <= this.markedOffset && (this.markedOffset += o),
  35389. this.limit += o,
  35390. i += o
  35391. } else
  35392. new Uint8Array(this.buffer);
  35393. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35394. e.offset = e.limit,
  35395. n && (this.offset -= r),
  35396. this
  35397. }
  35398. ,
  35399. a.prependTo = function(e, t) {
  35400. return e.prepend(this, t),
  35401. this
  35402. }
  35403. ,
  35404. a.printDebug = function(e) {
  35405. "function" != typeof e && (e = console.log.bind(console)),
  35406. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  35407. }
  35408. ,
  35409. a.remaining = function() {
  35410. return this.limit - this.offset
  35411. }
  35412. ,
  35413. a.reset = function() {
  35414. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  35415. this.markedOffset = -1) : this.offset = 0,
  35416. this
  35417. }
  35418. ,
  35419. a.resize = function(e) {
  35420. if (!this.noAssert) {
  35421. if ("number" != typeof e || e % 1 != 0)
  35422. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  35423. if ((e |= 0) < 0)
  35424. throw RangeError("Illegal capacity: 0 <= " + e)
  35425. }
  35426. if (this.buffer.byteLength < e) {
  35427. var t = new ArrayBuffer(e)
  35428. , i = new Uint8Array(t);
  35429. i.set(this.view),
  35430. this.buffer = t,
  35431. this.view = i
  35432. }
  35433. return this
  35434. }
  35435. ,
  35436. a.reverse = function(e, t) {
  35437. if (void 0 === e && (e = this.offset),
  35438. void 0 === t && (t = this.limit),
  35439. !this.noAssert) {
  35440. if ("number" != typeof e || e % 1 != 0)
  35441. throw TypeError("Illegal begin: Not an integer");
  35442. if (e >>>= 0,
  35443. "number" != typeof t || t % 1 != 0)
  35444. throw TypeError("Illegal end: Not an integer");
  35445. if (t >>>= 0,
  35446. e < 0 || t < e || t > this.buffer.byteLength)
  35447. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35448. }
  35449. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  35450. this
  35451. }
  35452. ,
  35453. a.skip = function(e) {
  35454. if (!this.noAssert) {
  35455. if ("number" != typeof e || e % 1 != 0)
  35456. throw TypeError("Illegal length: " + e + " (not an integer)");
  35457. e |= 0
  35458. }
  35459. var t = this.offset + e;
  35460. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  35461. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  35462. return this.offset = t,
  35463. this
  35464. }
  35465. ,
  35466. a.slice = function(e, t) {
  35467. if (void 0 === e && (e = this.offset),
  35468. void 0 === t && (t = this.limit),
  35469. !this.noAssert) {
  35470. if ("number" != typeof e || e % 1 != 0)
  35471. throw TypeError("Illegal begin: Not an integer");
  35472. if (e >>>= 0,
  35473. "number" != typeof t || t % 1 != 0)
  35474. throw TypeError("Illegal end: Not an integer");
  35475. if (t >>>= 0,
  35476. e < 0 || t < e || t > this.buffer.byteLength)
  35477. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35478. }
  35479. var i = this.clone();
  35480. return i.offset = e,
  35481. i.limit = t,
  35482. i
  35483. }
  35484. ,
  35485. a.toBuffer = function(e) {
  35486. var t = this.offset
  35487. , i = this.limit;
  35488. if (!this.noAssert) {
  35489. if ("number" != typeof t || t % 1 != 0)
  35490. throw TypeError("Illegal offset: Not an integer");
  35491. if (t >>>= 0,
  35492. "number" != typeof i || i % 1 != 0)
  35493. throw TypeError("Illegal limit: Not an integer");
  35494. if (i >>>= 0,
  35495. t < 0 || i < t || i > this.buffer.byteLength)
  35496. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35497. }
  35498. if (!e && 0 === t && i === this.buffer.byteLength)
  35499. return this.buffer;
  35500. if (t === i)
  35501. return o;
  35502. var n = new ArrayBuffer(i - t);
  35503. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  35504. n
  35505. }
  35506. ,
  35507. a.toArrayBuffer = a.toBuffer,
  35508. a.toString = function(e, t, i) {
  35509. if (void 0 === e)
  35510. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  35511. switch ("number" == typeof e && (i = t = e = "utf8"),
  35512. e) {
  35513. case "utf8":
  35514. return this.toUTF8(t, i);
  35515. case "base64":
  35516. return this.toBase64(t, i);
  35517. case "hex":
  35518. return this.toHex(t, i);
  35519. case "binary":
  35520. return this.toBinary(t, i);
  35521. case "debug":
  35522. return this.toDebug();
  35523. case "columns":
  35524. return this.toColumns();
  35525. default:
  35526. throw Error("Unsupported encoding: " + e)
  35527. }
  35528. }
  35529. ;
  35530. var h = function() {
  35531. 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)
  35532. a[r[t]] = t;
  35533. return e.encode = function(e, t) {
  35534. for (var i, n; null !== (i = e()); )
  35535. t(r[i >> 2 & 63]),
  35536. n = (3 & i) << 4,
  35537. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  35538. n = (15 & i) << 2,
  35539. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  35540. t(r[63 & i])) : (t(r[63 & n]),
  35541. t(61))) : (t(r[63 & n]),
  35542. t(61),
  35543. t(61))
  35544. }
  35545. ,
  35546. e.decode = function(e, t) {
  35547. function i(e) {
  35548. throw Error("Illegal character code: " + e)
  35549. }
  35550. for (var n, r, o; null !== (n = e()); )
  35551. if (void 0 === (r = a[n]) && i(n),
  35552. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  35553. t(r << 2 >>> 0 | (48 & o) >> 4),
  35554. null !== (n = e()))) {
  35555. if (void 0 === (r = a[n])) {
  35556. if (61 === n)
  35557. break;
  35558. i(n)
  35559. }
  35560. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  35561. null !== (n = e())) {
  35562. if (void 0 === (o = a[n])) {
  35563. if (61 === n)
  35564. break;
  35565. i(n)
  35566. }
  35567. t((3 & r) << 6 >>> 0 | o)
  35568. }
  35569. }
  35570. }
  35571. ,
  35572. e.test = function(e) {
  35573. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  35574. }
  35575. ,
  35576. e
  35577. }();
  35578. a.toBase64 = function(e, t) {
  35579. if (void 0 === e && (e = this.offset),
  35580. void 0 === t && (t = this.limit),
  35581. t |= 0,
  35582. (e |= 0) < 0 || t > this.capacity || t < e)
  35583. throw RangeError("begin, end");
  35584. var i;
  35585. return h.encode(function() {
  35586. return e < t ? this.view[e++] : null
  35587. }
  35588. .bind(this), i = c()),
  35589. i()
  35590. }
  35591. ,
  35592. f.fromBase64 = function(e, t) {
  35593. if ("string" != typeof e)
  35594. throw TypeError("str");
  35595. var i = new f(e.length / 4 * 3,t)
  35596. , n = 0;
  35597. return h.decode(s(e), function(e) {
  35598. i.view[n++] = e
  35599. }),
  35600. i.limit = n,
  35601. i
  35602. }
  35603. ,
  35604. f.btoa = function(e) {
  35605. return f.fromBinary(e).toBase64()
  35606. }
  35607. ,
  35608. f.atob = function(e) {
  35609. return f.fromBase64(e).toBinary()
  35610. }
  35611. ,
  35612. a.toBinary = function(e, t) {
  35613. if (void 0 === e && (e = this.offset),
  35614. void 0 === t && (t = this.limit),
  35615. t |= 0,
  35616. (e |= 0) < 0 || t > this.capacity() || t < e)
  35617. throw RangeError("begin, end");
  35618. if (e === t)
  35619. return "";
  35620. for (var i = [], n = []; e < t; )
  35621. i.push(this.view[e++]),
  35622. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  35623. i = []);
  35624. return n.join("") + String.fromCharCode.apply(String, i)
  35625. }
  35626. ,
  35627. f.fromBinary = function(e, t) {
  35628. if ("string" != typeof e)
  35629. throw TypeError("str");
  35630. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  35631. if (255 < (i = e.charCodeAt(n)))
  35632. throw RangeError("illegal char code: " + i);
  35633. o.view[n++] = i
  35634. }
  35635. return o.limit = r,
  35636. o
  35637. }
  35638. ,
  35639. a.toDebug = function(e) {
  35640. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  35641. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  35642. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  35643. ++i,
  35644. e && 0 < i && i % 16 == 0 && i !== n) {
  35645. for (; r.length < 51; )
  35646. r += " ";
  35647. a += r + o + "\n",
  35648. r = o = ""
  35649. }
  35650. 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 ? " " : ""
  35651. }
  35652. if (e && " " !== r) {
  35653. for (; r.length < 51; )
  35654. r += " ";
  35655. a += r + o + "\n"
  35656. }
  35657. return e ? a : r
  35658. }
  35659. ,
  35660. f.fromDebug = function(e, t, i) {
  35661. 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; ) {
  35662. switch (n = e.charAt(s++)) {
  35663. case "!":
  35664. if (!i) {
  35665. if (h || u || d) {
  35666. p = !0;
  35667. break
  35668. }
  35669. h = u = d = !0
  35670. }
  35671. a.offset = a.markedOffset = a.limit = l,
  35672. c = !1;
  35673. break;
  35674. case "|":
  35675. if (!i) {
  35676. if (h || d) {
  35677. p = !0;
  35678. break
  35679. }
  35680. h = d = !0
  35681. }
  35682. a.offset = a.limit = l,
  35683. c = !1;
  35684. break;
  35685. case "[":
  35686. if (!i) {
  35687. if (h || u) {
  35688. p = !0;
  35689. break
  35690. }
  35691. h = u = !0
  35692. }
  35693. a.offset = a.markedOffset = l,
  35694. c = !1;
  35695. break;
  35696. case "<":
  35697. if (!i) {
  35698. if (h) {
  35699. p = !0;
  35700. break
  35701. }
  35702. h = !0
  35703. }
  35704. a.offset = l,
  35705. c = !1;
  35706. break;
  35707. case "]":
  35708. if (!i) {
  35709. if (d || u) {
  35710. p = !0;
  35711. break
  35712. }
  35713. d = u = !0
  35714. }
  35715. a.limit = a.markedOffset = l,
  35716. c = !1;
  35717. break;
  35718. case ">":
  35719. if (!i) {
  35720. if (d) {
  35721. p = !0;
  35722. break
  35723. }
  35724. d = !0
  35725. }
  35726. a.limit = l,
  35727. c = !1;
  35728. break;
  35729. case "'":
  35730. if (!i) {
  35731. if (u) {
  35732. p = !0;
  35733. break
  35734. }
  35735. u = !0
  35736. }
  35737. a.markedOffset = l,
  35738. c = !1;
  35739. break;
  35740. case " ":
  35741. c = !1;
  35742. break;
  35743. default:
  35744. if (!i && c) {
  35745. p = !0;
  35746. break
  35747. }
  35748. if (r = parseInt(n + e.charAt(s++), 16),
  35749. !i && (isNaN(r) || r < 0 || 255 < r))
  35750. throw TypeError("Illegal str: Not a debug encoded string");
  35751. a.view[l++] = r,
  35752. c = !0
  35753. }
  35754. if (p)
  35755. throw TypeError("Illegal str: Invalid symbol at " + s)
  35756. }
  35757. if (!i) {
  35758. if (!h || !d)
  35759. throw TypeError("Illegal str: Missing offset or limit");
  35760. if (l < a.buffer.byteLength)
  35761. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  35762. }
  35763. return a
  35764. }
  35765. ,
  35766. a.toHex = function(e, t) {
  35767. if (e = void 0 === e ? this.offset : e,
  35768. t = void 0 === t ? this.limit : t,
  35769. !this.noAssert) {
  35770. if ("number" != typeof e || e % 1 != 0)
  35771. throw TypeError("Illegal begin: Not an integer");
  35772. if (e >>>= 0,
  35773. "number" != typeof t || t % 1 != 0)
  35774. throw TypeError("Illegal end: Not an integer");
  35775. if (t >>>= 0,
  35776. e < 0 || t < e || t > this.buffer.byteLength)
  35777. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35778. }
  35779. for (var i, n = new Array(t - e); e < t; )
  35780. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  35781. return n.join("")
  35782. }
  35783. ,
  35784. f.fromHex = function(e, t, i) {
  35785. if (!i) {
  35786. if ("string" != typeof e)
  35787. throw TypeError("Illegal str: Not a string");
  35788. if (e.length % 2 != 0)
  35789. throw TypeError("Illegal str: Length not a multiple of 2")
  35790. }
  35791. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  35792. if (n = parseInt(e.substring(a, a + 2), 16),
  35793. !i && (!isFinite(n) || n < 0 || 255 < n))
  35794. throw TypeError("Illegal str: Contains non-hex characters");
  35795. o.view[s++] = n
  35796. }
  35797. return o.limit = s,
  35798. o
  35799. }
  35800. ;
  35801. var u, d = u = {
  35802. MAX_CODEPOINT: 1114111,
  35803. encodeUTF8: function(e, t) {
  35804. var i = null;
  35805. for ("number" == typeof e && (i = e,
  35806. e = function() {
  35807. return null
  35808. }
  35809. ); null !== i || null !== (i = e()); )
  35810. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  35811. t(i >> 12 & 63 | 128)),
  35812. t(i >> 6 & 63 | 128)),
  35813. t(63 & i | 128)),
  35814. i = null
  35815. },
  35816. decodeUTF8: function(e, t) {
  35817. for (var i, n, r, o, a = function(e) {
  35818. e = e.slice(0, e.indexOf(null));
  35819. var t = Error(e.toString());
  35820. throw t.name = "TruncatedError",
  35821. t.bytes = e,
  35822. t
  35823. }; null !== (i = e()); )
  35824. if (0 == (128 & i))
  35825. t(i);
  35826. else if (192 == (224 & i))
  35827. null === (n = e()) && a([i, n]),
  35828. t((31 & i) << 6 | 63 & n);
  35829. else if (224 == (240 & i))
  35830. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  35831. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  35832. else {
  35833. if (240 != (248 & i))
  35834. throw RangeError("Illegal starting byte: " + i);
  35835. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  35836. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  35837. }
  35838. },
  35839. UTF16toUTF8: function(e, t) {
  35840. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  35841. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  35842. n = null) : t(i);
  35843. null !== n && t(n)
  35844. },
  35845. UTF8toUTF16: function(e, t) {
  35846. var i = null;
  35847. for ("number" == typeof e && (i = e,
  35848. e = function() {
  35849. return null
  35850. }
  35851. ); null !== i || null !== (i = e()); )
  35852. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  35853. t(i % 1024 + 56320)),
  35854. i = null
  35855. },
  35856. encodeUTF16toUTF8: function(e, t) {
  35857. u.UTF16toUTF8(e, function(e) {
  35858. u.encodeUTF8(e, t)
  35859. })
  35860. },
  35861. decodeUTF8toUTF16: function(e, t) {
  35862. u.decodeUTF8(e, function(e) {
  35863. u.UTF8toUTF16(e, t)
  35864. })
  35865. },
  35866. calculateCodePoint: function(e) {
  35867. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  35868. },
  35869. calculateUTF8: function(e) {
  35870. for (var t, i = 0; null !== (t = e()); )
  35871. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  35872. return i
  35873. },
  35874. calculateUTF16asUTF8: function(e) {
  35875. var t = 0
  35876. , i = 0;
  35877. return u.UTF16toUTF8(e, function(e) {
  35878. ++t,
  35879. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  35880. }),
  35881. [t, i]
  35882. }
  35883. };
  35884. return a.toUTF8 = function(t, i) {
  35885. if (void 0 === t && (t = this.offset),
  35886. void 0 === i && (i = this.limit),
  35887. !this.noAssert) {
  35888. if ("number" != typeof t || t % 1 != 0)
  35889. throw TypeError("Illegal begin: Not an integer");
  35890. if (t >>>= 0,
  35891. "number" != typeof i || i % 1 != 0)
  35892. throw TypeError("Illegal end: Not an integer");
  35893. if (i >>>= 0,
  35894. t < 0 || i < t || i > this.buffer.byteLength)
  35895. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35896. }
  35897. var e;
  35898. try {
  35899. d.decodeUTF8toUTF16(function() {
  35900. return t < i ? this.view[t++] : null
  35901. }
  35902. .bind(this), e = c())
  35903. } catch (e) {
  35904. if (t !== i)
  35905. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  35906. }
  35907. return e()
  35908. }
  35909. ,
  35910. f.fromUTF8 = function(e, t, i) {
  35911. if (!i && "string" != typeof e)
  35912. throw TypeError("Illegal str: Not a string");
  35913. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  35914. , r = 0;
  35915. return d.encodeUTF16toUTF8(s(e), function(e) {
  35916. n.view[r++] = e
  35917. }),
  35918. n.limit = r,
  35919. n
  35920. }
  35921. ,
  35922. f
  35923. }
  35924. ,
  35925. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  35926. var e;
  35927. try {
  35928. e = t("long")
  35929. } catch (e) {}
  35930. return r(e)
  35931. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  35932. }
  35933. , {
  35934. long: 216
  35935. }],
  35936. 216: [function(e, t, i) {
  35937. var n, r;
  35938. n = this,
  35939. r = function() {
  35940. "use strict";
  35941. function n(e, t, i) {
  35942. this.low = 0 | e,
  35943. this.high = 0 | t,
  35944. this.unsigned = !!i
  35945. }
  35946. function p(e) {
  35947. return !0 === (e && e.__isLong__)
  35948. }
  35949. function e(e, t) {
  35950. var i, n, r;
  35951. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  35952. r && (a[e] = i),
  35953. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  35954. r && (o[e] = i),
  35955. i)
  35956. }
  35957. function f(e, t) {
  35958. if (isNaN(e) || !isFinite(e))
  35959. return t ? l : y;
  35960. if (t) {
  35961. if (e < 0)
  35962. return l;
  35963. if (r <= e)
  35964. return I
  35965. } else {
  35966. if (e <= -s)
  35967. return E;
  35968. if (s <= e + 1)
  35969. return C
  35970. }
  35971. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  35972. }
  35973. function g(e, t, i) {
  35974. return new n(e,t,i)
  35975. }
  35976. function h(e, t, i) {
  35977. if (0 === e.length)
  35978. throw Error("empty string");
  35979. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  35980. return y;
  35981. if (t = "number" == typeof t ? (i = t,
  35982. !1) : !!t,
  35983. (i = i || 10) < 2 || 36 < i)
  35984. throw RangeError("radix");
  35985. var n;
  35986. if (0 < (n = e.indexOf("-")))
  35987. throw Error("interior hyphen");
  35988. if (0 === n)
  35989. return h(e.substring(1), t, i).neg();
  35990. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  35991. var s = Math.min(8, e.length - a)
  35992. , l = parseInt(e.substring(a, a + s), i);
  35993. if (s < 8) {
  35994. var c = f(u(i, s));
  35995. o = o.mul(c).add(f(l))
  35996. } else
  35997. o = (o = o.mul(r)).add(f(l))
  35998. }
  35999. return o.unsigned = t,
  36000. o
  36001. }
  36002. function m(e) {
  36003. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36004. }
  36005. Object.defineProperty(n.prototype, "__isLong__", {
  36006. value: !0,
  36007. enumerable: !1,
  36008. configurable: !1
  36009. }),
  36010. n.isLong = p;
  36011. var o = {}
  36012. , a = {};
  36013. n.fromInt = e,
  36014. n.fromNumber = f,
  36015. n.fromBits = g;
  36016. var u = Math.pow;
  36017. n.fromString = h,
  36018. n.fromValue = m;
  36019. var i = 4294967296
  36020. , r = 0x10000000000000000
  36021. , s = r / 2
  36022. , v = e(1 << 24)
  36023. , y = e(0);
  36024. n.ZERO = y;
  36025. var l = e(0, !0);
  36026. n.UZERO = l;
  36027. var c = e(1);
  36028. n.ONE = c;
  36029. var d = e(1, !0);
  36030. n.UONE = d;
  36031. var A = e(-1);
  36032. n.NEG_ONE = A;
  36033. var C = g(-1, 2147483647, !1);
  36034. n.MAX_VALUE = C;
  36035. var I = g(-1, -1, !0);
  36036. n.MAX_UNSIGNED_VALUE = I;
  36037. var E = g(0, -2147483648, !1);
  36038. n.MIN_VALUE = E;
  36039. var t = n.prototype;
  36040. return t.toInt = function() {
  36041. return this.unsigned ? this.low >>> 0 : this.low
  36042. }
  36043. ,
  36044. t.toNumber = function() {
  36045. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  36046. }
  36047. ,
  36048. t.toString = function(e) {
  36049. if ((e = e || 10) < 2 || 36 < e)
  36050. throw RangeError("radix");
  36051. if (this.isZero())
  36052. return "0";
  36053. if (this.isNegative()) {
  36054. if (this.eq(E)) {
  36055. var t = f(e)
  36056. , i = this.div(t)
  36057. , n = i.mul(t).sub(this);
  36058. return i.toString(e) + n.toInt().toString(e)
  36059. }
  36060. return "-" + this.neg().toString(e)
  36061. }
  36062. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  36063. var s = o.div(r)
  36064. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  36065. if ((o = s).isZero())
  36066. return l + a;
  36067. for (; l.length < 6; )
  36068. l = "0" + l;
  36069. a = "" + l + a
  36070. }
  36071. }
  36072. ,
  36073. t.getHighBits = function() {
  36074. return this.high
  36075. }
  36076. ,
  36077. t.getHighBitsUnsigned = function() {
  36078. return this.high >>> 0
  36079. }
  36080. ,
  36081. t.getLowBits = function() {
  36082. return this.low
  36083. }
  36084. ,
  36085. t.getLowBitsUnsigned = function() {
  36086. return this.low >>> 0
  36087. }
  36088. ,
  36089. t.getNumBitsAbs = function() {
  36090. if (this.isNegative())
  36091. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36092. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  36093. ;
  36094. return 0 != this.high ? t + 33 : t + 1
  36095. }
  36096. ,
  36097. t.isZero = function() {
  36098. return 0 === this.high && 0 === this.low
  36099. }
  36100. ,
  36101. t.isNegative = function() {
  36102. return !this.unsigned && this.high < 0
  36103. }
  36104. ,
  36105. t.isPositive = function() {
  36106. return this.unsigned || 0 <= this.high
  36107. }
  36108. ,
  36109. t.isOdd = function() {
  36110. return 1 == (1 & this.low)
  36111. }
  36112. ,
  36113. t.isEven = function() {
  36114. return 0 == (1 & this.low)
  36115. }
  36116. ,
  36117. t.equals = function(e) {
  36118. return p(e) || (e = m(e)),
  36119. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  36120. }
  36121. ,
  36122. t.eq = t.equals,
  36123. t.notEquals = function(e) {
  36124. return !this.eq(e)
  36125. }
  36126. ,
  36127. t.neq = t.notEquals,
  36128. t.lessThan = function(e) {
  36129. return this.comp(e) < 0
  36130. }
  36131. ,
  36132. t.lt = t.lessThan,
  36133. t.lessThanOrEqual = function(e) {
  36134. return this.comp(e) <= 0
  36135. }
  36136. ,
  36137. t.lte = t.lessThanOrEqual,
  36138. t.greaterThan = function(e) {
  36139. return 0 < this.comp(e)
  36140. }
  36141. ,
  36142. t.gt = t.greaterThan,
  36143. t.greaterThanOrEqual = function(e) {
  36144. return 0 <= this.comp(e)
  36145. }
  36146. ,
  36147. t.gte = t.greaterThanOrEqual,
  36148. t.compare = function(e) {
  36149. if (p(e) || (e = m(e)),
  36150. this.eq(e))
  36151. return 0;
  36152. var t = this.isNegative()
  36153. , i = e.isNegative();
  36154. 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
  36155. }
  36156. ,
  36157. t.comp = t.compare,
  36158. t.negate = function() {
  36159. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  36160. }
  36161. ,
  36162. t.neg = t.negate,
  36163. t.add = function(e) {
  36164. p(e) || (e = m(e));
  36165. var t = this.high >>> 16
  36166. , i = 65535 & this.high
  36167. , n = this.low >>> 16
  36168. , r = 65535 & this.low
  36169. , o = e.high >>> 16
  36170. , a = 65535 & e.high
  36171. , s = e.low >>> 16
  36172. , l = 0
  36173. , c = 0
  36174. , h = 0
  36175. , u = 0;
  36176. return h += (u += r + (65535 & e.low)) >>> 16,
  36177. c += (h += n + s) >>> 16,
  36178. l += (c += i + a) >>> 16,
  36179. l += t + o,
  36180. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  36181. }
  36182. ,
  36183. t.subtract = function(e) {
  36184. return p(e) || (e = m(e)),
  36185. this.add(e.neg())
  36186. }
  36187. ,
  36188. t.sub = t.subtract,
  36189. t.multiply = function(e) {
  36190. if (this.isZero())
  36191. return y;
  36192. if (p(e) || (e = m(e)),
  36193. e.isZero())
  36194. return y;
  36195. if (this.eq(E))
  36196. return e.isOdd() ? E : y;
  36197. if (e.eq(E))
  36198. return this.isOdd() ? E : y;
  36199. if (this.isNegative())
  36200. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36201. if (e.isNegative())
  36202. return this.mul(e.neg()).neg();
  36203. if (this.lt(v) && e.lt(v))
  36204. return f(this.toNumber() * e.toNumber(), this.unsigned);
  36205. var t = this.high >>> 16
  36206. , i = 65535 & this.high
  36207. , n = this.low >>> 16
  36208. , r = 65535 & this.low
  36209. , o = e.high >>> 16
  36210. , a = 65535 & e.high
  36211. , s = e.low >>> 16
  36212. , l = 65535 & e.low
  36213. , c = 0
  36214. , h = 0
  36215. , u = 0
  36216. , d = 0;
  36217. return u += (d += r * l) >>> 16,
  36218. h += (u += n * l) >>> 16,
  36219. u &= 65535,
  36220. h += (u += r * s) >>> 16,
  36221. c += (h += i * l) >>> 16,
  36222. h &= 65535,
  36223. c += (h += n * s) >>> 16,
  36224. h &= 65535,
  36225. c += (h += r * a) >>> 16,
  36226. c += t * l + i * s + n * a + r * o,
  36227. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  36228. }
  36229. ,
  36230. t.mul = t.multiply,
  36231. t.divide = function(e) {
  36232. if (p(e) || (e = m(e)),
  36233. e.isZero())
  36234. throw Error("division by zero");
  36235. if (this.isZero())
  36236. return this.unsigned ? l : y;
  36237. var t, i, n;
  36238. if (this.unsigned) {
  36239. if (e.unsigned || (e = e.toUnsigned()),
  36240. e.gt(this))
  36241. return l;
  36242. if (e.gt(this.shru(1)))
  36243. return d;
  36244. n = l
  36245. } else {
  36246. if (this.eq(E))
  36247. 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)),
  36248. n = t.add(i.div(e)));
  36249. if (e.eq(E))
  36250. return this.unsigned ? l : y;
  36251. if (this.isNegative())
  36252. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36253. if (e.isNegative())
  36254. return this.div(e.neg()).neg();
  36255. n = y
  36256. }
  36257. for (i = this; i.gte(e); ) {
  36258. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  36259. 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); )
  36260. s = (a = f(t -= o, this.unsigned)).mul(e);
  36261. a.isZero() && (a = c),
  36262. n = n.add(a),
  36263. i = i.sub(s)
  36264. }
  36265. return n
  36266. }
  36267. ,
  36268. t.div = t.divide,
  36269. t.modulo = function(e) {
  36270. return p(e) || (e = m(e)),
  36271. this.sub(this.div(e).mul(e))
  36272. }
  36273. ,
  36274. t.mod = t.modulo,
  36275. t.not = function() {
  36276. return g(~this.low, ~this.high, this.unsigned)
  36277. }
  36278. ,
  36279. t.and = function(e) {
  36280. return p(e) || (e = m(e)),
  36281. g(this.low & e.low, this.high & e.high, this.unsigned)
  36282. }
  36283. ,
  36284. t.or = function(e) {
  36285. return p(e) || (e = m(e)),
  36286. g(this.low | e.low, this.high | e.high, this.unsigned)
  36287. }
  36288. ,
  36289. t.xor = function(e) {
  36290. return p(e) || (e = m(e)),
  36291. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36292. }
  36293. ,
  36294. t.shiftLeft = function(e) {
  36295. return p(e) && (e = e.toInt()),
  36296. 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)
  36297. }
  36298. ,
  36299. t.shl = t.shiftLeft,
  36300. t.shiftRight = function(e) {
  36301. return p(e) && (e = e.toInt()),
  36302. 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)
  36303. }
  36304. ,
  36305. t.shr = t.shiftRight,
  36306. t.shiftRightUnsigned = function(e) {
  36307. if (p(e) && (e = e.toInt()),
  36308. 0 === (e &= 63))
  36309. return this;
  36310. var t = this.high;
  36311. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  36312. }
  36313. ,
  36314. t.shru = t.shiftRightUnsigned,
  36315. t.toSigned = function() {
  36316. return this.unsigned ? g(this.low, this.high, !1) : this
  36317. }
  36318. ,
  36319. t.toUnsigned = function() {
  36320. return this.unsigned ? this : g(this.low, this.high, !0)
  36321. }
  36322. ,
  36323. t.toBytes = function(e) {
  36324. return e ? this.toBytesLE() : this.toBytesBE()
  36325. }
  36326. ,
  36327. t.toBytesLE = function() {
  36328. var e = this.high
  36329. , t = this.low;
  36330. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36331. }
  36332. ,
  36333. t.toBytesBE = function() {
  36334. var e = this.high
  36335. , t = this.low;
  36336. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36337. }
  36338. ,
  36339. n
  36340. }
  36341. ,
  36342. "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()
  36343. }
  36344. , {}],
  36345. 217: [function(e, t, i) {
  36346. 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 = {
  36347. REVISION: "75"
  36348. };
  36349. function Ii(e, t) {
  36350. return e.distance - t.distance
  36351. }
  36352. function Ei(e, t, i, n) {
  36353. if (!1 !== e.visible && (e.raycast(t, i),
  36354. !0 === n))
  36355. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  36356. Ei(r[o], t, i, !0)
  36357. }
  36358. function _i(e, t, i) {
  36359. return i < 0 && (i += 1),
  36360. 1 < i && (i -= 1),
  36361. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  36362. }
  36363. function bi(e, t, i, n, r, o, a) {
  36364. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  36365. r.multiplyScalar(Vt.x),
  36366. o.multiplyScalar(Vt.y),
  36367. a.multiplyScalar(Vt.z),
  36368. r.add(o).add(a),
  36369. r.clone()
  36370. }
  36371. function wi(e, t, i, n, r, o, a) {
  36372. var s = e.material;
  36373. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  36374. return null;
  36375. Ut.copy(a),
  36376. Ut.applyMatrix4(e.matrixWorld);
  36377. var l = t.ray.origin.distanceTo(Ut);
  36378. return l < t.near || l > t.far ? null : {
  36379. distance: l,
  36380. point: Ut.clone(),
  36381. object: e
  36382. }
  36383. }
  36384. function Ti(e, t, i, n, r, o, a, s) {
  36385. Mt.fromArray(n, 3 * o),
  36386. Rt.fromArray(n, 3 * a),
  36387. Pt.fromArray(n, 3 * s);
  36388. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  36389. return l && (r && (Nt.fromArray(r, 2 * o),
  36390. Ft.fromArray(r, 2 * a),
  36391. Bt.fromArray(r, 2 * s),
  36392. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  36393. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  36394. l.faceIndex = o),
  36395. l
  36396. }
  36397. function xi() {}
  36398. function Si(e, t, i, n, r, o) {
  36399. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  36400. if (s = e[o[t]].x,
  36401. l = e[o[t]].y,
  36402. c = e[o[i]].x,
  36403. h = e[o[i]].y,
  36404. u = e[o[n]].x,
  36405. d = e[o[n]].y,
  36406. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  36407. return !1;
  36408. for (g = u - c,
  36409. m = d - h,
  36410. v = s - u,
  36411. y = l - d,
  36412. A = c - s,
  36413. C = h - l,
  36414. a = 0; a < r; a++)
  36415. if (p = e[o[a]].x,
  36416. f = e[o[a]].y,
  36417. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  36418. E = v * (f - d) - y * (p - u),
  36419. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  36420. return !1;
  36421. return !0
  36422. }
  36423. function Mi(e) {
  36424. switch (e) {
  36425. case Ci.LinearEncoding:
  36426. return ["Linear", "( value )"];
  36427. case Ci.sRGBEncoding:
  36428. return ["sRGB", "( value )"];
  36429. case Ci.RGBEEncoding:
  36430. return ["RGBE", "( value )"];
  36431. case Ci.RGBM7Encoding:
  36432. return ["RGBM", "( value, 7.0 )"];
  36433. case Ci.RGBM16Encoding:
  36434. return ["RGBM", "( value, 16.0 )"];
  36435. case Ci.RGBDEncoding:
  36436. return ["RGBD", "( value, 256.0 )"];
  36437. case Ci.GammaEncoding:
  36438. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  36439. default:
  36440. throw new Error("unsupported encoding: " + e)
  36441. }
  36442. }
  36443. function Ri(e, t) {
  36444. var i = Mi(t);
  36445. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  36446. }
  36447. function Pi(e) {
  36448. return "" !== e
  36449. }
  36450. function Oi(e, t) {
  36451. 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)
  36452. }
  36453. function Li(e) {
  36454. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  36455. var i = Ci.ShaderChunk[t];
  36456. if (void 0 === i)
  36457. throw new Error("Can not resolve #include <" + t + ">");
  36458. return Li(i)
  36459. })
  36460. }
  36461. function Di(e) {
  36462. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  36463. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  36464. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  36465. return r
  36466. })
  36467. }
  36468. function Ni(e, t, i, n) {
  36469. gi.set(t, i, n).unproject(mi);
  36470. var r = fi[e];
  36471. if (void 0 !== r)
  36472. for (var o = 0, a = r.length; o < a; o++)
  36473. pi.vertices[r[o]].copy(gi)
  36474. }
  36475. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  36476. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  36477. void 0 === Math.sign && (Math.sign = function(e) {
  36478. return e < 0 ? -1 : 0 < e ? 1 : +e
  36479. }
  36480. ),
  36481. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  36482. get: function() {
  36483. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  36484. }
  36485. }),
  36486. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  36487. writable: !0,
  36488. configurable: !0,
  36489. value: function(e) {
  36490. "use strict";
  36491. if (null == e)
  36492. throw new TypeError("Cannot convert first argument to object");
  36493. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  36494. var r = arguments[i];
  36495. if (null != r) {
  36496. r = Object(r);
  36497. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  36498. var l = o[a]
  36499. , c = Object.getOwnPropertyDescriptor(r, l);
  36500. void 0 !== c && c.enumerable && (t[l] = r[l])
  36501. }
  36502. }
  36503. }
  36504. return t
  36505. }
  36506. }),
  36507. Ci.MOUSE = {
  36508. LEFT: 0,
  36509. MIDDLE: 1,
  36510. RIGHT: 2
  36511. },
  36512. Ci.CullFaceNone = 0,
  36513. Ci.CullFaceBack = 1,
  36514. Ci.CullFaceFront = 2,
  36515. Ci.CullFaceFrontBack = 3,
  36516. Ci.FrontFaceDirectionCW = 0,
  36517. Ci.FrontFaceDirectionCCW = 1,
  36518. Ci.BasicShadowMap = 0,
  36519. Ci.PCFShadowMap = 1,
  36520. Ci.PCFSoftShadowMap = 2,
  36521. Ci.FrontSide = 0,
  36522. Ci.BackSide = 1,
  36523. Ci.DoubleSide = 2,
  36524. Ci.FlatShading = 1,
  36525. Ci.SmoothShading = 2,
  36526. Ci.NoColors = 0,
  36527. Ci.FaceColors = 1,
  36528. Ci.VertexColors = 2,
  36529. Ci.NoBlending = 0,
  36530. Ci.NormalBlending = 1,
  36531. Ci.AdditiveBlending = 2,
  36532. Ci.SubtractiveBlending = 3,
  36533. Ci.MultiplyBlending = 4,
  36534. Ci.CustomBlending = 5,
  36535. Ci.AddEquation = 100,
  36536. Ci.SubtractEquation = 101,
  36537. Ci.ReverseSubtractEquation = 102,
  36538. Ci.MinEquation = 103,
  36539. Ci.MaxEquation = 104,
  36540. Ci.ZeroFactor = 200,
  36541. Ci.OneFactor = 201,
  36542. Ci.SrcColorFactor = 202,
  36543. Ci.OneMinusSrcColorFactor = 203,
  36544. Ci.SrcAlphaFactor = 204,
  36545. Ci.OneMinusSrcAlphaFactor = 205,
  36546. Ci.DstAlphaFactor = 206,
  36547. Ci.OneMinusDstAlphaFactor = 207,
  36548. Ci.DstColorFactor = 208,
  36549. Ci.OneMinusDstColorFactor = 209,
  36550. Ci.SrcAlphaSaturateFactor = 210,
  36551. Ci.NeverDepth = 0,
  36552. Ci.AlwaysDepth = 1,
  36553. Ci.LessDepth = 2,
  36554. Ci.LessEqualDepth = 3,
  36555. Ci.EqualDepth = 4,
  36556. Ci.GreaterEqualDepth = 5,
  36557. Ci.GreaterDepth = 6,
  36558. Ci.NotEqualDepth = 7,
  36559. Ci.MultiplyOperation = 0,
  36560. Ci.MixOperation = 1,
  36561. Ci.AddOperation = 2,
  36562. Ci.NoToneMapping = 0,
  36563. Ci.LinearToneMapping = 1,
  36564. Ci.ReinhardToneMapping = 2,
  36565. Ci.Uncharted2ToneMapping = 3,
  36566. Ci.CineonToneMapping = 4,
  36567. Ci.UVMapping = 300,
  36568. Ci.CubeReflectionMapping = 301,
  36569. Ci.CubeRefractionMapping = 302,
  36570. Ci.EquirectangularReflectionMapping = 303,
  36571. Ci.EquirectangularRefractionMapping = 304,
  36572. Ci.SphericalReflectionMapping = 305,
  36573. Ci.CubeUVReflectionMapping = 306,
  36574. Ci.CubeUVRefractionMapping = 307,
  36575. Ci.RepeatWrapping = 1e3,
  36576. Ci.ClampToEdgeWrapping = 1001,
  36577. Ci.MirroredRepeatWrapping = 1002,
  36578. Ci.NearestFilter = 1003,
  36579. Ci.NearestMipMapNearestFilter = 1004,
  36580. Ci.NearestMipMapLinearFilter = 1005,
  36581. Ci.LinearFilter = 1006,
  36582. Ci.LinearMipMapNearestFilter = 1007,
  36583. Ci.LinearMipMapLinearFilter = 1008,
  36584. Ci.UnsignedByteType = 1009,
  36585. Ci.ByteType = 1010,
  36586. Ci.ShortType = 1011,
  36587. Ci.UnsignedShortType = 1012,
  36588. Ci.IntType = 1013,
  36589. Ci.UnsignedIntType = 1014,
  36590. Ci.FloatType = 1015,
  36591. Ci.HalfFloatType = 1025,
  36592. Ci.UnsignedShort4444Type = 1016,
  36593. Ci.UnsignedShort5551Type = 1017,
  36594. Ci.UnsignedShort565Type = 1018,
  36595. Ci.AlphaFormat = 1019,
  36596. Ci.RGBFormat = 1020,
  36597. Ci.RGBAFormat = 1021,
  36598. Ci.LuminanceFormat = 1022,
  36599. Ci.LuminanceAlphaFormat = 1023,
  36600. Ci.RGBEFormat = Ci.RGBAFormat,
  36601. Ci.RGB_S3TC_DXT1_Format = 2001,
  36602. Ci.RGBA_S3TC_DXT1_Format = 2002,
  36603. Ci.RGBA_S3TC_DXT3_Format = 2003,
  36604. Ci.RGBA_S3TC_DXT5_Format = 2004,
  36605. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  36606. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  36607. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  36608. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  36609. Ci.RGB_ETC1_Format = 2151,
  36610. Ci.LoopOnce = 2200,
  36611. Ci.LoopRepeat = 2201,
  36612. Ci.LoopPingPong = 2202,
  36613. Ci.InterpolateDiscrete = 2300,
  36614. Ci.InterpolateLinear = 2301,
  36615. Ci.InterpolateSmooth = 2302,
  36616. Ci.ZeroCurvatureEnding = 2400,
  36617. Ci.ZeroSlopeEnding = 2401,
  36618. Ci.WrapAroundEnding = 2402,
  36619. Ci.TrianglesDrawMode = 0,
  36620. Ci.TriangleStripDrawMode = 1,
  36621. Ci.TriangleFanDrawMode = 2,
  36622. Ci.LinearEncoding = 3e3,
  36623. Ci.sRGBEncoding = 3001,
  36624. Ci.GammaEncoding = 3007,
  36625. Ci.RGBEEncoding = 3002,
  36626. Ci.LogLuvEncoding = 3003,
  36627. Ci.RGBM7Encoding = 3004,
  36628. Ci.RGBM16Encoding = 3005,
  36629. Ci.RGBDEncoding = 3006,
  36630. Ci.Color = function(e) {
  36631. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  36632. }
  36633. ,
  36634. Ci.Color.prototype = {
  36635. constructor: Ci.Color,
  36636. r: 1,
  36637. g: 1,
  36638. b: 1,
  36639. set: function(e) {
  36640. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  36641. this
  36642. },
  36643. setScalar: function(e) {
  36644. this.r = e,
  36645. this.g = e,
  36646. this.b = e
  36647. },
  36648. setHex: function(e) {
  36649. return e = Math.floor(e),
  36650. this.r = (e >> 16 & 255) / 255,
  36651. this.g = (e >> 8 & 255) / 255,
  36652. this.b = (255 & e) / 255,
  36653. this
  36654. },
  36655. setRGB: function(e, t, i) {
  36656. return this.r = e,
  36657. this.g = t,
  36658. this.b = i,
  36659. this
  36660. },
  36661. setHSL: function(e, t, i) {
  36662. if (e = Ci.Math.euclideanModulo(e, 1),
  36663. t = Ci.Math.clamp(t, 0, 1),
  36664. i = Ci.Math.clamp(i, 0, 1),
  36665. 0 === t)
  36666. this.r = this.g = this.b = i;
  36667. else {
  36668. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  36669. , r = 2 * i - n;
  36670. this.r = _i(r, n, e + 1 / 3),
  36671. this.g = _i(r, n, e),
  36672. this.b = _i(r, n, e - 1 / 3)
  36673. }
  36674. return this
  36675. },
  36676. setStyle: function(t) {
  36677. function e(e) {
  36678. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  36679. }
  36680. var i;
  36681. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  36682. var n, r = i[1], o = i[2];
  36683. switch (r) {
  36684. case "rgb":
  36685. case "rgba":
  36686. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  36687. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  36688. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  36689. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  36690. e(n[5]),
  36691. this;
  36692. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  36693. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  36694. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  36695. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  36696. e(n[5]),
  36697. this;
  36698. break;
  36699. case "hsl":
  36700. case "hsla":
  36701. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  36702. var a = parseFloat(n[1]) / 360
  36703. , s = parseInt(n[2], 10) / 100
  36704. , l = parseInt(n[3], 10) / 100;
  36705. return e(n[5]),
  36706. this.setHSL(a, s, l)
  36707. }
  36708. }
  36709. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  36710. var c, h = (c = i[1]).length;
  36711. if (3 === h)
  36712. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  36713. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  36714. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  36715. this;
  36716. if (6 === h)
  36717. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  36718. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  36719. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  36720. this
  36721. }
  36722. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  36723. return this
  36724. },
  36725. clone: function() {
  36726. return new this.constructor(this.r,this.g,this.b)
  36727. },
  36728. copy: function(e) {
  36729. return this.r = e.r,
  36730. this.g = e.g,
  36731. this.b = e.b,
  36732. this
  36733. },
  36734. copyGammaToLinear: function(e, t) {
  36735. return void 0 === t && (t = 2),
  36736. this.r = Math.pow(e.r, t),
  36737. this.g = Math.pow(e.g, t),
  36738. this.b = Math.pow(e.b, t),
  36739. this
  36740. },
  36741. copyLinearToGamma: function(e, t) {
  36742. void 0 === t && (t = 2);
  36743. var i = 0 < t ? 1 / t : 1;
  36744. return this.r = Math.pow(e.r, i),
  36745. this.g = Math.pow(e.g, i),
  36746. this.b = Math.pow(e.b, i),
  36747. this
  36748. },
  36749. convertGammaToLinear: function() {
  36750. var e = this.r
  36751. , t = this.g
  36752. , i = this.b;
  36753. return this.r = e * e,
  36754. this.g = t * t,
  36755. this.b = i * i,
  36756. this
  36757. },
  36758. convertLinearToGamma: function() {
  36759. return this.r = Math.sqrt(this.r),
  36760. this.g = Math.sqrt(this.g),
  36761. this.b = Math.sqrt(this.b),
  36762. this
  36763. },
  36764. getHex: function() {
  36765. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  36766. },
  36767. getHexString: function() {
  36768. return ("000000" + this.getHex().toString(16)).slice(-6)
  36769. },
  36770. getHSL: function(e) {
  36771. var t, i, n = e || {
  36772. h: 0,
  36773. s: 0,
  36774. l: 0
  36775. }, 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;
  36776. if (l === s)
  36777. i = t = 0;
  36778. else {
  36779. var h = s - l;
  36780. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  36781. s) {
  36782. case r:
  36783. t = (o - a) / h + (o < a ? 6 : 0);
  36784. break;
  36785. case o:
  36786. t = (a - r) / h + 2;
  36787. break;
  36788. case a:
  36789. t = (r - o) / h + 4
  36790. }
  36791. t /= 6
  36792. }
  36793. return n.h = t,
  36794. n.s = i,
  36795. n.l = c,
  36796. n
  36797. },
  36798. getStyle: function() {
  36799. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  36800. },
  36801. offsetHSL: function(e, t, i) {
  36802. var n = this.getHSL();
  36803. return n.h += e,
  36804. n.s += t,
  36805. n.l += i,
  36806. this.setHSL(n.h, n.s, n.l),
  36807. this
  36808. },
  36809. add: function(e) {
  36810. return this.r += e.r,
  36811. this.g += e.g,
  36812. this.b += e.b,
  36813. this
  36814. },
  36815. addColors: function(e, t) {
  36816. return this.r = e.r + t.r,
  36817. this.g = e.g + t.g,
  36818. this.b = e.b + t.b,
  36819. this
  36820. },
  36821. addScalar: function(e) {
  36822. return this.r += e,
  36823. this.g += e,
  36824. this.b += e,
  36825. this
  36826. },
  36827. multiply: function(e) {
  36828. return this.r *= e.r,
  36829. this.g *= e.g,
  36830. this.b *= e.b,
  36831. this
  36832. },
  36833. multiplyScalar: function(e) {
  36834. return this.r *= e,
  36835. this.g *= e,
  36836. this.b *= e,
  36837. this
  36838. },
  36839. lerp: function(e, t) {
  36840. return this.r += (e.r - this.r) * t,
  36841. this.g += (e.g - this.g) * t,
  36842. this.b += (e.b - this.b) * t,
  36843. this
  36844. },
  36845. equals: function(e) {
  36846. return e.r === this.r && e.g === this.g && e.b === this.b
  36847. },
  36848. fromArray: function(e, t) {
  36849. return void 0 === t && (t = 0),
  36850. this.r = e[t],
  36851. this.g = e[t + 1],
  36852. this.b = e[t + 2],
  36853. this
  36854. },
  36855. toArray: function(e, t) {
  36856. return void 0 === e && (e = []),
  36857. void 0 === t && (t = 0),
  36858. e[t] = this.r,
  36859. e[t + 1] = this.g,
  36860. e[t + 2] = this.b,
  36861. e
  36862. }
  36863. },
  36864. Ci.ColorKeywords = {
  36865. aliceblue: 15792383,
  36866. antiquewhite: 16444375,
  36867. aqua: 65535,
  36868. aquamarine: 8388564,
  36869. azure: 15794175,
  36870. beige: 16119260,
  36871. bisque: 16770244,
  36872. black: 0,
  36873. blanchedalmond: 16772045,
  36874. blue: 255,
  36875. blueviolet: 9055202,
  36876. brown: 10824234,
  36877. burlywood: 14596231,
  36878. cadetblue: 6266528,
  36879. chartreuse: 8388352,
  36880. chocolate: 13789470,
  36881. coral: 16744272,
  36882. cornflowerblue: 6591981,
  36883. cornsilk: 16775388,
  36884. crimson: 14423100,
  36885. cyan: 65535,
  36886. darkblue: 139,
  36887. darkcyan: 35723,
  36888. darkgoldenrod: 12092939,
  36889. darkgray: 11119017,
  36890. darkgreen: 25600,
  36891. darkgrey: 11119017,
  36892. darkkhaki: 12433259,
  36893. darkmagenta: 9109643,
  36894. darkolivegreen: 5597999,
  36895. darkorange: 16747520,
  36896. darkorchid: 10040012,
  36897. darkred: 9109504,
  36898. darksalmon: 15308410,
  36899. darkseagreen: 9419919,
  36900. darkslateblue: 4734347,
  36901. darkslategray: 3100495,
  36902. darkslategrey: 3100495,
  36903. darkturquoise: 52945,
  36904. darkviolet: 9699539,
  36905. deeppink: 16716947,
  36906. deepskyblue: 49151,
  36907. dimgray: 6908265,
  36908. dimgrey: 6908265,
  36909. dodgerblue: 2003199,
  36910. firebrick: 11674146,
  36911. floralwhite: 16775920,
  36912. forestgreen: 2263842,
  36913. fuchsia: 16711935,
  36914. gainsboro: 14474460,
  36915. ghostwhite: 16316671,
  36916. gold: 16766720,
  36917. goldenrod: 14329120,
  36918. gray: 8421504,
  36919. green: 32768,
  36920. greenyellow: 11403055,
  36921. grey: 8421504,
  36922. honeydew: 15794160,
  36923. hotpink: 16738740,
  36924. indianred: 13458524,
  36925. indigo: 4915330,
  36926. ivory: 16777200,
  36927. khaki: 15787660,
  36928. lavender: 15132410,
  36929. lavenderblush: 16773365,
  36930. lawngreen: 8190976,
  36931. lemonchiffon: 16775885,
  36932. lightblue: 11393254,
  36933. lightcoral: 15761536,
  36934. lightcyan: 14745599,
  36935. lightgoldenrodyellow: 16448210,
  36936. lightgray: 13882323,
  36937. lightgreen: 9498256,
  36938. lightgrey: 13882323,
  36939. lightpink: 16758465,
  36940. lightsalmon: 16752762,
  36941. lightseagreen: 2142890,
  36942. lightskyblue: 8900346,
  36943. lightslategray: 7833753,
  36944. lightslategrey: 7833753,
  36945. lightsteelblue: 11584734,
  36946. lightyellow: 16777184,
  36947. lime: 65280,
  36948. limegreen: 3329330,
  36949. linen: 16445670,
  36950. magenta: 16711935,
  36951. maroon: 8388608,
  36952. mediumaquamarine: 6737322,
  36953. mediumblue: 205,
  36954. mediumorchid: 12211667,
  36955. mediumpurple: 9662683,
  36956. mediumseagreen: 3978097,
  36957. mediumslateblue: 8087790,
  36958. mediumspringgreen: 64154,
  36959. mediumturquoise: 4772300,
  36960. mediumvioletred: 13047173,
  36961. midnightblue: 1644912,
  36962. mintcream: 16121850,
  36963. mistyrose: 16770273,
  36964. moccasin: 16770229,
  36965. navajowhite: 16768685,
  36966. navy: 128,
  36967. oldlace: 16643558,
  36968. olive: 8421376,
  36969. olivedrab: 7048739,
  36970. orange: 16753920,
  36971. orangered: 16729344,
  36972. orchid: 14315734,
  36973. palegoldenrod: 15657130,
  36974. palegreen: 10025880,
  36975. paleturquoise: 11529966,
  36976. palevioletred: 14381203,
  36977. papayawhip: 16773077,
  36978. peachpuff: 16767673,
  36979. peru: 13468991,
  36980. pink: 16761035,
  36981. plum: 14524637,
  36982. powderblue: 11591910,
  36983. purple: 8388736,
  36984. red: 16711680,
  36985. rosybrown: 12357519,
  36986. royalblue: 4286945,
  36987. saddlebrown: 9127187,
  36988. salmon: 16416882,
  36989. sandybrown: 16032864,
  36990. seagreen: 3050327,
  36991. seashell: 16774638,
  36992. sienna: 10506797,
  36993. silver: 12632256,
  36994. skyblue: 8900331,
  36995. slateblue: 6970061,
  36996. slategray: 7372944,
  36997. slategrey: 7372944,
  36998. snow: 16775930,
  36999. springgreen: 65407,
  37000. steelblue: 4620980,
  37001. tan: 13808780,
  37002. teal: 32896,
  37003. thistle: 14204888,
  37004. tomato: 16737095,
  37005. turquoise: 4251856,
  37006. violet: 15631086,
  37007. wheat: 16113331,
  37008. white: 16777215,
  37009. whitesmoke: 16119285,
  37010. yellow: 16776960,
  37011. yellowgreen: 10145074
  37012. },
  37013. Ci.Quaternion = function(e, t, i, n) {
  37014. this._x = e || 0,
  37015. this._y = t || 0,
  37016. this._z = i || 0,
  37017. this._w = void 0 !== n ? n : 1
  37018. }
  37019. ,
  37020. Ci.Quaternion.prototype = {
  37021. constructor: Ci.Quaternion,
  37022. get x() {
  37023. return this._x
  37024. },
  37025. set x(e) {
  37026. this._x = e,
  37027. this.onChangeCallback()
  37028. },
  37029. get y() {
  37030. return this._y
  37031. },
  37032. set y(e) {
  37033. this._y = e,
  37034. this.onChangeCallback()
  37035. },
  37036. get z() {
  37037. return this._z
  37038. },
  37039. set z(e) {
  37040. this._z = e,
  37041. this.onChangeCallback()
  37042. },
  37043. get w() {
  37044. return this._w
  37045. },
  37046. set w(e) {
  37047. this._w = e,
  37048. this.onChangeCallback()
  37049. },
  37050. set: function(e, t, i, n) {
  37051. return this._x = e,
  37052. this._y = t,
  37053. this._z = i,
  37054. this._w = n,
  37055. this.onChangeCallback(),
  37056. this
  37057. },
  37058. clone: function() {
  37059. return new this.constructor(this._x,this._y,this._z,this._w)
  37060. },
  37061. copy: function(e) {
  37062. return this._x = e.x,
  37063. this._y = e.y,
  37064. this._z = e.z,
  37065. this._w = e.w,
  37066. this.onChangeCallback(),
  37067. this
  37068. },
  37069. setFromEuler: function(e, t) {
  37070. if (e instanceof Ci.Euler == 0)
  37071. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37072. var i = Math.cos(e._x / 2)
  37073. , n = Math.cos(e._y / 2)
  37074. , r = Math.cos(e._z / 2)
  37075. , o = Math.sin(e._x / 2)
  37076. , a = Math.sin(e._y / 2)
  37077. , s = Math.sin(e._z / 2)
  37078. , l = e.order;
  37079. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  37080. this._y = i * a * r - o * n * s,
  37081. this._z = i * n * s + o * a * r,
  37082. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  37083. this._y = i * a * r - o * n * s,
  37084. this._z = i * n * s - o * a * r,
  37085. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  37086. this._y = i * a * r + o * n * s,
  37087. this._z = i * n * s + o * a * r,
  37088. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  37089. this._y = i * a * r + o * n * s,
  37090. this._z = i * n * s - o * a * r,
  37091. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  37092. this._y = i * a * r + o * n * s,
  37093. this._z = i * n * s - o * a * r,
  37094. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  37095. this._y = i * a * r - o * n * s,
  37096. this._z = i * n * s + o * a * r,
  37097. this._w = i * n * r + o * a * s),
  37098. !1 !== t && this.onChangeCallback(),
  37099. this
  37100. },
  37101. setFromAxisAngle: function(e, t) {
  37102. var i = t / 2
  37103. , n = Math.sin(i);
  37104. return this._x = e.x * n,
  37105. this._y = e.y * n,
  37106. this._z = e.z * n,
  37107. this._w = Math.cos(i),
  37108. this.onChangeCallback(),
  37109. this
  37110. },
  37111. setFromRotationMatrix: function(e) {
  37112. 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;
  37113. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  37114. this._w = .25 / t,
  37115. this._x = (h - l) * t,
  37116. this._y = (o - c) * t,
  37117. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  37118. this._w = (h - l) / t,
  37119. this._x = .25 * t,
  37120. this._y = (r + a) / t,
  37121. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  37122. this._w = (o - c) / t,
  37123. this._x = (r + a) / t,
  37124. this._y = .25 * t,
  37125. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37126. this._w = (a - r) / t,
  37127. this._x = (o + c) / t,
  37128. this._y = (l + h) / t,
  37129. this._z = .25 * t),
  37130. this.onChangeCallback(),
  37131. this
  37132. },
  37133. setFromUnitVectors: function(e, t) {
  37134. return void 0 === Be && (Be = new Ci.Vector3),
  37135. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  37136. 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),
  37137. this._x = Be.x,
  37138. this._y = Be.y,
  37139. this._z = Be.z,
  37140. this._w = Ve,
  37141. this.normalize(),
  37142. this
  37143. },
  37144. inverse: function() {
  37145. return this.conjugate().normalize(),
  37146. this
  37147. },
  37148. conjugate: function() {
  37149. return this._x *= -1,
  37150. this._y *= -1,
  37151. this._z *= -1,
  37152. this.onChangeCallback(),
  37153. this
  37154. },
  37155. dot: function(e) {
  37156. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37157. },
  37158. lengthSq: function() {
  37159. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37160. },
  37161. length: function() {
  37162. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37163. },
  37164. normalize: function() {
  37165. var e = this.length();
  37166. return 0 === e ? (this._x = 0,
  37167. this._y = 0,
  37168. this._z = 0,
  37169. this._w = 1) : (e = 1 / e,
  37170. this._x = this._x * e,
  37171. this._y = this._y * e,
  37172. this._z = this._z * e,
  37173. this._w = this._w * e),
  37174. this.onChangeCallback(),
  37175. this
  37176. },
  37177. multiply: function(e, t) {
  37178. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37179. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37180. },
  37181. multiplyQuaternions: function(e, t) {
  37182. var i = e._x
  37183. , n = e._y
  37184. , r = e._z
  37185. , o = e._w
  37186. , a = t._x
  37187. , s = t._y
  37188. , l = t._z
  37189. , c = t._w;
  37190. return this._x = i * c + o * a + n * l - r * s,
  37191. this._y = n * c + o * s + r * a - i * l,
  37192. this._z = r * c + o * l + i * s - n * a,
  37193. this._w = o * c - i * a - n * s - r * l,
  37194. this.onChangeCallback(),
  37195. this
  37196. },
  37197. slerp: function(e, t) {
  37198. if (0 === t)
  37199. return this;
  37200. if (1 === t)
  37201. return this.copy(e);
  37202. var i = this._x
  37203. , n = this._y
  37204. , r = this._z
  37205. , o = this._w
  37206. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37207. if (a < 0 ? (this._w = -e._w,
  37208. this._x = -e._x,
  37209. this._y = -e._y,
  37210. this._z = -e._z,
  37211. a = -a) : this.copy(e),
  37212. 1 <= a)
  37213. return this._w = o,
  37214. this._x = i,
  37215. this._y = n,
  37216. this._z = r,
  37217. this;
  37218. var s = Math.sqrt(1 - a * a);
  37219. if (Math.abs(s) < .001)
  37220. return this._w = .5 * (o + this._w),
  37221. this._x = .5 * (i + this._x),
  37222. this._y = .5 * (n + this._y),
  37223. this._z = .5 * (r + this._z),
  37224. this;
  37225. var l = Math.atan2(s, a)
  37226. , c = Math.sin((1 - t) * l) / s
  37227. , h = Math.sin(t * l) / s;
  37228. return this._w = o * c + this._w * h,
  37229. this._x = i * c + this._x * h,
  37230. this._y = n * c + this._y * h,
  37231. this._z = r * c + this._z * h,
  37232. this.onChangeCallback(),
  37233. this
  37234. },
  37235. equals: function(e) {
  37236. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37237. },
  37238. fromArray: function(e, t) {
  37239. return void 0 === t && (t = 0),
  37240. this._x = e[t],
  37241. this._y = e[t + 1],
  37242. this._z = e[t + 2],
  37243. this._w = e[t + 3],
  37244. this.onChangeCallback(),
  37245. this
  37246. },
  37247. toArray: function(e, t) {
  37248. return void 0 === e && (e = []),
  37249. void 0 === t && (t = 0),
  37250. e[t] = this._x,
  37251. e[t + 1] = this._y,
  37252. e[t + 2] = this._z,
  37253. e[t + 3] = this._w,
  37254. e
  37255. },
  37256. onChange: function(e) {
  37257. return this.onChangeCallback = e,
  37258. this
  37259. },
  37260. onChangeCallback: function() {}
  37261. },
  37262. Object.assign(Ci.Quaternion, {
  37263. slerp: function(e, t, i, n) {
  37264. return i.copy(e).slerp(t, n)
  37265. },
  37266. slerpFlat: function(e, t, i, n, r, o, a) {
  37267. var s = i[n + 0]
  37268. , l = i[n + 1]
  37269. , c = i[n + 2]
  37270. , h = i[n + 3]
  37271. , u = r[o + 0]
  37272. , d = r[o + 1]
  37273. , p = r[o + 2]
  37274. , f = r[o + 3];
  37275. if (h !== f || s !== u || l !== d || c !== p) {
  37276. var g = 1 - a
  37277. , m = s * u + l * d + c * p + h * f
  37278. , v = 0 <= m ? 1 : -1
  37279. , y = 1 - m * m;
  37280. if (y > Number.EPSILON) {
  37281. var A = Math.sqrt(y)
  37282. , C = Math.atan2(A, m * v);
  37283. g = Math.sin(g * C) / A,
  37284. a = Math.sin(a * C) / A
  37285. }
  37286. var I = a * v;
  37287. if (s = s * g + u * I,
  37288. l = l * g + d * I,
  37289. c = c * g + p * I,
  37290. h = h * g + f * I,
  37291. g === 1 - a) {
  37292. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37293. s *= E,
  37294. l *= E,
  37295. c *= E,
  37296. h *= E
  37297. }
  37298. }
  37299. e[t] = s,
  37300. e[t + 1] = l,
  37301. e[t + 2] = c,
  37302. e[t + 3] = h
  37303. }
  37304. }),
  37305. Ci.Vector2 = function(e, t) {
  37306. this.x = e || 0,
  37307. this.y = t || 0
  37308. }
  37309. ,
  37310. Ci.Vector2.prototype = {
  37311. constructor: Ci.Vector2,
  37312. get width() {
  37313. return this.x
  37314. },
  37315. set width(e) {
  37316. this.x = e
  37317. },
  37318. get height() {
  37319. return this.y
  37320. },
  37321. set height(e) {
  37322. this.y = e
  37323. },
  37324. set: function(e, t) {
  37325. return this.x = e,
  37326. this.y = t,
  37327. this
  37328. },
  37329. setScalar: function(e) {
  37330. return this.x = e,
  37331. this.y = e,
  37332. this
  37333. },
  37334. setX: function(e) {
  37335. return this.x = e,
  37336. this
  37337. },
  37338. setY: function(e) {
  37339. return this.y = e,
  37340. this
  37341. },
  37342. setComponent: function(e, t) {
  37343. switch (e) {
  37344. case 0:
  37345. this.x = t;
  37346. break;
  37347. case 1:
  37348. this.y = t;
  37349. break;
  37350. default:
  37351. throw new Error("index is out of range: " + e)
  37352. }
  37353. },
  37354. getComponent: function(e) {
  37355. switch (e) {
  37356. case 0:
  37357. return this.x;
  37358. case 1:
  37359. return this.y;
  37360. default:
  37361. throw new Error("index is out of range: " + e)
  37362. }
  37363. },
  37364. clone: function() {
  37365. return new this.constructor(this.x,this.y)
  37366. },
  37367. copy: function(e) {
  37368. return this.x = e.x,
  37369. this.y = e.y,
  37370. this
  37371. },
  37372. add: function(e, t) {
  37373. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37374. this.addVectors(e, t)) : (this.x += e.x,
  37375. this.y += e.y,
  37376. this)
  37377. },
  37378. addScalar: function(e) {
  37379. return this.x += e,
  37380. this.y += e,
  37381. this
  37382. },
  37383. addVectors: function(e, t) {
  37384. return this.x = e.x + t.x,
  37385. this.y = e.y + t.y,
  37386. this
  37387. },
  37388. addScaledVector: function(e, t) {
  37389. return this.x += e.x * t,
  37390. this.y += e.y * t,
  37391. this
  37392. },
  37393. sub: function(e, t) {
  37394. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37395. this.subVectors(e, t)) : (this.x -= e.x,
  37396. this.y -= e.y,
  37397. this)
  37398. },
  37399. subScalar: function(e) {
  37400. return this.x -= e,
  37401. this.y -= e,
  37402. this
  37403. },
  37404. subVectors: function(e, t) {
  37405. return this.x = e.x - t.x,
  37406. this.y = e.y - t.y,
  37407. this
  37408. },
  37409. multiply: function(e) {
  37410. return this.x *= e.x,
  37411. this.y *= e.y,
  37412. this
  37413. },
  37414. multiplyScalar: function(e) {
  37415. return isFinite(e) ? (this.x *= e,
  37416. this.y *= e) : (this.x = 0,
  37417. this.y = 0),
  37418. this
  37419. },
  37420. divide: function(e) {
  37421. return this.x /= e.x,
  37422. this.y /= e.y,
  37423. this
  37424. },
  37425. divideScalar: function(e) {
  37426. return this.multiplyScalar(1 / e)
  37427. },
  37428. min: function(e) {
  37429. return this.x = Math.min(this.x, e.x),
  37430. this.y = Math.min(this.y, e.y),
  37431. this
  37432. },
  37433. max: function(e) {
  37434. return this.x = Math.max(this.x, e.x),
  37435. this.y = Math.max(this.y, e.y),
  37436. this
  37437. },
  37438. clamp: function(e, t) {
  37439. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37440. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37441. this
  37442. },
  37443. clampScalar: function(e, t) {
  37444. return void 0 === Ne && (Ne = new Ci.Vector2,
  37445. Fe = new Ci.Vector2),
  37446. Ne.set(e, e),
  37447. Fe.set(t, t),
  37448. this.clamp(Ne, Fe)
  37449. },
  37450. clampLength: function(e, t) {
  37451. var i = this.length();
  37452. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37453. this
  37454. },
  37455. floor: function() {
  37456. return this.x = Math.floor(this.x),
  37457. this.y = Math.floor(this.y),
  37458. this
  37459. },
  37460. ceil: function() {
  37461. return this.x = Math.ceil(this.x),
  37462. this.y = Math.ceil(this.y),
  37463. this
  37464. },
  37465. round: function() {
  37466. return this.x = Math.round(this.x),
  37467. this.y = Math.round(this.y),
  37468. this
  37469. },
  37470. roundToZero: function() {
  37471. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37472. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37473. this
  37474. },
  37475. negate: function() {
  37476. return this.x = -this.x,
  37477. this.y = -this.y,
  37478. this
  37479. },
  37480. dot: function(e) {
  37481. return this.x * e.x + this.y * e.y
  37482. },
  37483. lengthSq: function() {
  37484. return this.x * this.x + this.y * this.y
  37485. },
  37486. length: function() {
  37487. return Math.sqrt(this.x * this.x + this.y * this.y)
  37488. },
  37489. lengthManhattan: function() {
  37490. return Math.abs(this.x) + Math.abs(this.y)
  37491. },
  37492. normalize: function() {
  37493. return this.divideScalar(this.length())
  37494. },
  37495. angle: function() {
  37496. var e = Math.atan2(this.y, this.x);
  37497. return e < 0 && (e += 2 * Math.PI),
  37498. e
  37499. },
  37500. distanceTo: function(e) {
  37501. return Math.sqrt(this.distanceToSquared(e))
  37502. },
  37503. distanceToSquared: function(e) {
  37504. var t = this.x - e.x
  37505. , i = this.y - e.y;
  37506. return t * t + i * i
  37507. },
  37508. setLength: function(e) {
  37509. return this.multiplyScalar(e / this.length())
  37510. },
  37511. lerp: function(e, t) {
  37512. return this.x += (e.x - this.x) * t,
  37513. this.y += (e.y - this.y) * t,
  37514. this
  37515. },
  37516. lerpVectors: function(e, t, i) {
  37517. return this.subVectors(t, e).multiplyScalar(i).add(e),
  37518. this
  37519. },
  37520. equals: function(e) {
  37521. return e.x === this.x && e.y === this.y
  37522. },
  37523. fromArray: function(e, t) {
  37524. return void 0 === t && (t = 0),
  37525. this.x = e[t],
  37526. this.y = e[t + 1],
  37527. this
  37528. },
  37529. toArray: function(e, t) {
  37530. return void 0 === e && (e = []),
  37531. void 0 === t && (t = 0),
  37532. e[t] = this.x,
  37533. e[t + 1] = this.y,
  37534. e
  37535. },
  37536. fromAttribute: function(e, t, i) {
  37537. return void 0 === i && (i = 0),
  37538. t = t * e.itemSize + i,
  37539. this.x = e.array[t],
  37540. this.y = e.array[t + 1],
  37541. this
  37542. },
  37543. rotateAround: function(e, t) {
  37544. var i = Math.cos(t)
  37545. , n = Math.sin(t)
  37546. , r = this.x - e.x
  37547. , o = this.y - e.y;
  37548. return this.x = r * i - o * n + e.x,
  37549. this.y = r * n + o * i + e.y,
  37550. this
  37551. }
  37552. },
  37553. Ci.Vector3 = function(e, t, i) {
  37554. this.x = e || 0,
  37555. this.y = t || 0,
  37556. this.z = i || 0
  37557. }
  37558. ,
  37559. Ci.Vector3.prototype = {
  37560. constructor: Ci.Vector3,
  37561. set: function(e, t, i) {
  37562. return this.x = e,
  37563. this.y = t,
  37564. this.z = i,
  37565. this
  37566. },
  37567. setScalar: function(e) {
  37568. return this.x = e,
  37569. this.y = e,
  37570. this.z = e,
  37571. this
  37572. },
  37573. setX: function(e) {
  37574. return this.x = e,
  37575. this
  37576. },
  37577. setY: function(e) {
  37578. return this.y = e,
  37579. this
  37580. },
  37581. setZ: function(e) {
  37582. return this.z = e,
  37583. this
  37584. },
  37585. setComponent: function(e, t) {
  37586. switch (e) {
  37587. case 0:
  37588. this.x = t;
  37589. break;
  37590. case 1:
  37591. this.y = t;
  37592. break;
  37593. case 2:
  37594. this.z = t;
  37595. break;
  37596. default:
  37597. throw new Error("index is out of range: " + e)
  37598. }
  37599. },
  37600. getComponent: function(e) {
  37601. switch (e) {
  37602. case 0:
  37603. return this.x;
  37604. case 1:
  37605. return this.y;
  37606. case 2:
  37607. return this.z;
  37608. default:
  37609. throw new Error("index is out of range: " + e)
  37610. }
  37611. },
  37612. clone: function() {
  37613. return new this.constructor(this.x,this.y,this.z)
  37614. },
  37615. copy: function(e) {
  37616. return this.x = e.x,
  37617. this.y = e.y,
  37618. this.z = e.z,
  37619. this
  37620. },
  37621. add: function(e, t) {
  37622. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37623. this.addVectors(e, t)) : (this.x += e.x,
  37624. this.y += e.y,
  37625. this.z += e.z,
  37626. this)
  37627. },
  37628. addScalar: function(e) {
  37629. return this.x += e,
  37630. this.y += e,
  37631. this.z += e,
  37632. this
  37633. },
  37634. addVectors: function(e, t) {
  37635. return this.x = e.x + t.x,
  37636. this.y = e.y + t.y,
  37637. this.z = e.z + t.z,
  37638. this
  37639. },
  37640. addScaledVector: function(e, t) {
  37641. return this.x += e.x * t,
  37642. this.y += e.y * t,
  37643. this.z += e.z * t,
  37644. this
  37645. },
  37646. sub: function(e, t) {
  37647. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37648. this.subVectors(e, t)) : (this.x -= e.x,
  37649. this.y -= e.y,
  37650. this.z -= e.z,
  37651. this)
  37652. },
  37653. subScalar: function(e) {
  37654. return this.x -= e,
  37655. this.y -= e,
  37656. this.z -= e,
  37657. this
  37658. },
  37659. subVectors: function(e, t) {
  37660. return this.x = e.x - t.x,
  37661. this.y = e.y - t.y,
  37662. this.z = e.z - t.z,
  37663. this
  37664. },
  37665. multiply: function(e, t) {
  37666. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  37667. this.multiplyVectors(e, t)) : (this.x *= e.x,
  37668. this.y *= e.y,
  37669. this.z *= e.z,
  37670. this)
  37671. },
  37672. multiplyScalar: function(e) {
  37673. return isFinite(e) ? (this.x *= e,
  37674. this.y *= e,
  37675. this.z *= e) : (this.x = 0,
  37676. this.y = 0,
  37677. this.z = 0),
  37678. this
  37679. },
  37680. multiplyVectors: function(e, t) {
  37681. return this.x = e.x * t.x,
  37682. this.y = e.y * t.y,
  37683. this.z = e.z * t.z,
  37684. this
  37685. },
  37686. applyEuler: function(e) {
  37687. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  37688. void 0 === De && (De = new Ci.Quaternion),
  37689. this.applyQuaternion(De.setFromEuler(e)),
  37690. this
  37691. },
  37692. applyAxisAngle: function(e, t) {
  37693. return void 0 === Le && (Le = new Ci.Quaternion),
  37694. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  37695. this
  37696. },
  37697. applyMatrix3: function(e) {
  37698. var t = this.x
  37699. , i = this.y
  37700. , n = this.z
  37701. , r = e.elements;
  37702. return this.x = r[0] * t + r[3] * i + r[6] * n,
  37703. this.y = r[1] * t + r[4] * i + r[7] * n,
  37704. this.z = r[2] * t + r[5] * i + r[8] * n,
  37705. this
  37706. },
  37707. applyMatrix4: function(e) {
  37708. var t = this.x
  37709. , i = this.y
  37710. , n = this.z
  37711. , r = e.elements;
  37712. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  37713. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  37714. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  37715. this
  37716. },
  37717. applyProjection: function(e) {
  37718. var t = this.x
  37719. , i = this.y
  37720. , n = this.z
  37721. , r = e.elements
  37722. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  37723. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  37724. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  37725. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  37726. this
  37727. },
  37728. applyQuaternion: function(e) {
  37729. var t = this.x
  37730. , i = this.y
  37731. , n = this.z
  37732. , r = e.x
  37733. , o = e.y
  37734. , a = e.z
  37735. , s = e.w
  37736. , l = s * t + o * n - a * i
  37737. , c = s * i + a * t - r * n
  37738. , h = s * n + r * i - o * t
  37739. , u = -r * t - o * i - a * n;
  37740. return this.x = l * s + u * -r + c * -a - h * -o,
  37741. this.y = c * s + u * -o + h * -r - l * -a,
  37742. this.z = h * s + u * -a + l * -o - c * -r,
  37743. this
  37744. },
  37745. project: function(e) {
  37746. return void 0 === Oe && (Oe = new Ci.Matrix4),
  37747. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  37748. this.applyProjection(Oe)
  37749. },
  37750. unproject: function(e) {
  37751. return void 0 === Pe && (Pe = new Ci.Matrix4),
  37752. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  37753. this.applyProjection(Pe)
  37754. },
  37755. transformDirection: function(e) {
  37756. var t = this.x
  37757. , i = this.y
  37758. , n = this.z
  37759. , r = e.elements;
  37760. return this.x = r[0] * t + r[4] * i + r[8] * n,
  37761. this.y = r[1] * t + r[5] * i + r[9] * n,
  37762. this.z = r[2] * t + r[6] * i + r[10] * n,
  37763. this.normalize(),
  37764. this
  37765. },
  37766. divide: function(e) {
  37767. return this.x /= e.x,
  37768. this.y /= e.y,
  37769. this.z /= e.z,
  37770. this
  37771. },
  37772. divideScalar: function(e) {
  37773. return this.multiplyScalar(1 / e)
  37774. },
  37775. min: function(e) {
  37776. return this.x = Math.min(this.x, e.x),
  37777. this.y = Math.min(this.y, e.y),
  37778. this.z = Math.min(this.z, e.z),
  37779. this
  37780. },
  37781. max: function(e) {
  37782. return this.x = Math.max(this.x, e.x),
  37783. this.y = Math.max(this.y, e.y),
  37784. this.z = Math.max(this.z, e.z),
  37785. this
  37786. },
  37787. clamp: function(e, t) {
  37788. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37789. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37790. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  37791. this
  37792. },
  37793. clampScalar: function(e, t) {
  37794. return void 0 === Me && (Me = new Ci.Vector3,
  37795. Re = new Ci.Vector3),
  37796. Me.set(e, e, e),
  37797. Re.set(t, t, t),
  37798. this.clamp(Me, Re)
  37799. },
  37800. clampLength: function(e, t) {
  37801. var i = this.length();
  37802. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37803. this
  37804. },
  37805. floor: function() {
  37806. return this.x = Math.floor(this.x),
  37807. this.y = Math.floor(this.y),
  37808. this.z = Math.floor(this.z),
  37809. this
  37810. },
  37811. ceil: function() {
  37812. return this.x = Math.ceil(this.x),
  37813. this.y = Math.ceil(this.y),
  37814. this.z = Math.ceil(this.z),
  37815. this
  37816. },
  37817. round: function() {
  37818. return this.x = Math.round(this.x),
  37819. this.y = Math.round(this.y),
  37820. this.z = Math.round(this.z),
  37821. this
  37822. },
  37823. roundToZero: function() {
  37824. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37825. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37826. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  37827. this
  37828. },
  37829. negate: function() {
  37830. return this.x = -this.x,
  37831. this.y = -this.y,
  37832. this.z = -this.z,
  37833. this
  37834. },
  37835. dot: function(e) {
  37836. return this.x * e.x + this.y * e.y + this.z * e.z
  37837. },
  37838. lengthSq: function() {
  37839. return this.x * this.x + this.y * this.y + this.z * this.z
  37840. },
  37841. length: function() {
  37842. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  37843. },
  37844. lengthManhattan: function() {
  37845. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  37846. },
  37847. normalize: function() {
  37848. return this.divideScalar(this.length())
  37849. },
  37850. setLength: function(e) {
  37851. return this.multiplyScalar(e / this.length())
  37852. },
  37853. lerp: function(e, t) {
  37854. return this.x += (e.x - this.x) * t,
  37855. this.y += (e.y - this.y) * t,
  37856. this.z += (e.z - this.z) * t,
  37857. this
  37858. },
  37859. lerpVectors: function(e, t, i) {
  37860. return this.subVectors(t, e).multiplyScalar(i).add(e),
  37861. this
  37862. },
  37863. cross: function(e, t) {
  37864. if (void 0 !== t)
  37865. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  37866. this.crossVectors(e, t);
  37867. var i = this.x
  37868. , n = this.y
  37869. , r = this.z;
  37870. return this.x = n * e.z - r * e.y,
  37871. this.y = r * e.x - i * e.z,
  37872. this.z = i * e.y - n * e.x,
  37873. this
  37874. },
  37875. crossVectors: function(e, t) {
  37876. var i = e.x
  37877. , n = e.y
  37878. , r = e.z
  37879. , o = t.x
  37880. , a = t.y
  37881. , s = t.z;
  37882. return this.x = n * s - r * a,
  37883. this.y = r * o - i * s,
  37884. this.z = i * a - n * o,
  37885. this
  37886. },
  37887. projectOnVector: function(e) {
  37888. return void 0 === xe && (xe = new Ci.Vector3),
  37889. xe.copy(e).normalize(),
  37890. Se = this.dot(xe),
  37891. this.copy(xe).multiplyScalar(Se)
  37892. },
  37893. projectOnPlane: function(e) {
  37894. return void 0 === Te && (Te = new Ci.Vector3),
  37895. Te.copy(this).projectOnVector(e),
  37896. this.sub(Te)
  37897. },
  37898. reflect: function(e) {
  37899. return void 0 === we && (we = new Ci.Vector3),
  37900. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  37901. },
  37902. angleTo: function(e) {
  37903. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  37904. return Math.acos(Ci.Math.clamp(t, -1, 1))
  37905. },
  37906. distanceTo: function(e) {
  37907. return Math.sqrt(this.distanceToSquared(e))
  37908. },
  37909. distanceToSquared: function(e) {
  37910. var t = this.x - e.x
  37911. , i = this.y - e.y
  37912. , n = this.z - e.z;
  37913. return t * t + i * i + n * n
  37914. },
  37915. setFromSpherical: function(e) {
  37916. var t = Math.sin(e.phi) * e.radius;
  37917. return this.x = t * Math.sin(e.theta),
  37918. this.y = Math.cos(e.phi) * e.radius,
  37919. this.z = t * Math.cos(e.theta),
  37920. this
  37921. },
  37922. setFromMatrixPosition: function(e) {
  37923. return this.setFromMatrixColumn(e, 3)
  37924. },
  37925. setFromMatrixScale: function(e) {
  37926. var t = this.setFromMatrixColumn(e, 0).length()
  37927. , i = this.setFromMatrixColumn(e, 1).length()
  37928. , n = this.setFromMatrixColumn(e, 2).length();
  37929. return this.x = t,
  37930. this.y = i,
  37931. this.z = n,
  37932. this
  37933. },
  37934. setFromMatrixColumn: function(e, t) {
  37935. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  37936. t = e = t),
  37937. this.fromArray(e.elements, 4 * t)
  37938. },
  37939. equals: function(e) {
  37940. return e.x === this.x && e.y === this.y && e.z === this.z
  37941. },
  37942. fromArray: function(e, t) {
  37943. return void 0 === t && (t = 0),
  37944. this.x = e[t],
  37945. this.y = e[t + 1],
  37946. this.z = e[t + 2],
  37947. this
  37948. },
  37949. toArray: function(e, t) {
  37950. return void 0 === e && (e = []),
  37951. void 0 === t && (t = 0),
  37952. e[t] = this.x,
  37953. e[t + 1] = this.y,
  37954. e[t + 2] = this.z,
  37955. e
  37956. },
  37957. fromAttribute: function(e, t, i) {
  37958. return void 0 === i && (i = 0),
  37959. t = t * e.itemSize + i,
  37960. this.x = e.array[t],
  37961. this.y = e.array[t + 1],
  37962. this.z = e.array[t + 2],
  37963. this
  37964. }
  37965. },
  37966. Ci.Vector4 = function(e, t, i, n) {
  37967. this.x = e || 0,
  37968. this.y = t || 0,
  37969. this.z = i || 0,
  37970. this.w = void 0 !== n ? n : 1
  37971. }
  37972. ,
  37973. Ci.Vector4.prototype = {
  37974. constructor: Ci.Vector4,
  37975. set: function(e, t, i, n) {
  37976. return this.x = e,
  37977. this.y = t,
  37978. this.z = i,
  37979. this.w = n,
  37980. this
  37981. },
  37982. setScalar: function(e) {
  37983. return this.x = e,
  37984. this.y = e,
  37985. this.z = e,
  37986. this.w = e,
  37987. this
  37988. },
  37989. setX: function(e) {
  37990. return this.x = e,
  37991. this
  37992. },
  37993. setY: function(e) {
  37994. return this.y = e,
  37995. this
  37996. },
  37997. setZ: function(e) {
  37998. return this.z = e,
  37999. this
  38000. },
  38001. setW: function(e) {
  38002. return this.w = e,
  38003. this
  38004. },
  38005. setComponent: function(e, t) {
  38006. switch (e) {
  38007. case 0:
  38008. this.x = t;
  38009. break;
  38010. case 1:
  38011. this.y = t;
  38012. break;
  38013. case 2:
  38014. this.z = t;
  38015. break;
  38016. case 3:
  38017. this.w = t;
  38018. break;
  38019. default:
  38020. throw new Error("index is out of range: " + e)
  38021. }
  38022. },
  38023. getComponent: function(e) {
  38024. switch (e) {
  38025. case 0:
  38026. return this.x;
  38027. case 1:
  38028. return this.y;
  38029. case 2:
  38030. return this.z;
  38031. case 3:
  38032. return this.w;
  38033. default:
  38034. throw new Error("index is out of range: " + e)
  38035. }
  38036. },
  38037. clone: function() {
  38038. return new this.constructor(this.x,this.y,this.z,this.w)
  38039. },
  38040. copy: function(e) {
  38041. return this.x = e.x,
  38042. this.y = e.y,
  38043. this.z = e.z,
  38044. this.w = void 0 !== e.w ? e.w : 1,
  38045. this
  38046. },
  38047. add: function(e, t) {
  38048. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38049. this.addVectors(e, t)) : (this.x += e.x,
  38050. this.y += e.y,
  38051. this.z += e.z,
  38052. this.w += e.w,
  38053. this)
  38054. },
  38055. addScalar: function(e) {
  38056. return this.x += e,
  38057. this.y += e,
  38058. this.z += e,
  38059. this.w += e,
  38060. this
  38061. },
  38062. addVectors: function(e, t) {
  38063. return this.x = e.x + t.x,
  38064. this.y = e.y + t.y,
  38065. this.z = e.z + t.z,
  38066. this.w = e.w + t.w,
  38067. this
  38068. },
  38069. addScaledVector: function(e, t) {
  38070. return this.x += e.x * t,
  38071. this.y += e.y * t,
  38072. this.z += e.z * t,
  38073. this.w += e.w * t,
  38074. this
  38075. },
  38076. sub: function(e, t) {
  38077. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38078. this.subVectors(e, t)) : (this.x -= e.x,
  38079. this.y -= e.y,
  38080. this.z -= e.z,
  38081. this.w -= e.w,
  38082. this)
  38083. },
  38084. subScalar: function(e) {
  38085. return this.x -= e,
  38086. this.y -= e,
  38087. this.z -= e,
  38088. this.w -= e,
  38089. this
  38090. },
  38091. subVectors: function(e, t) {
  38092. return this.x = e.x - t.x,
  38093. this.y = e.y - t.y,
  38094. this.z = e.z - t.z,
  38095. this.w = e.w - t.w,
  38096. this
  38097. },
  38098. multiplyScalar: function(e) {
  38099. return isFinite(e) ? (this.x *= e,
  38100. this.y *= e,
  38101. this.z *= e,
  38102. this.w *= e) : (this.x = 0,
  38103. this.y = 0,
  38104. this.z = 0,
  38105. this.w = 0),
  38106. this
  38107. },
  38108. applyMatrix4: function(e) {
  38109. var t = this.x
  38110. , i = this.y
  38111. , n = this.z
  38112. , r = this.w
  38113. , o = e.elements;
  38114. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38115. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38116. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38117. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38118. this
  38119. },
  38120. divideScalar: function(e) {
  38121. return this.multiplyScalar(1 / e)
  38122. },
  38123. setAxisAngleFromQuaternion: function(e) {
  38124. this.w = 2 * Math.acos(e.w);
  38125. var t = Math.sqrt(1 - e.w * e.w);
  38126. return t < 1e-4 ? (this.x = 1,
  38127. this.y = 0,
  38128. this.z = 0) : (this.x = e.x / t,
  38129. this.y = e.y / t,
  38130. this.z = e.z / t),
  38131. this
  38132. },
  38133. setAxisAngleFromRotationMatrix: function(e) {
  38134. 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];
  38135. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  38136. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  38137. return this.set(1, 0, 0, 0),
  38138. this;
  38139. t = Math.PI;
  38140. var g = (a + 1) / 2
  38141. , m = (h + 1) / 2
  38142. , v = (f + 1) / 2
  38143. , y = (s + c) / 4
  38144. , A = (l + d) / 4
  38145. , C = (u + p) / 4;
  38146. return m < g && v < g ? r = g < .01 ? (i = 0,
  38147. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  38148. A / i) : v < m ? r = m < .01 ? (n = 0,
  38149. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  38150. C / n) : v < .01 ? (n = i = .707106781,
  38151. r = 0) : (i = A / (r = Math.sqrt(v)),
  38152. n = C / r),
  38153. this.set(i, n, r, t),
  38154. this
  38155. }
  38156. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  38157. return Math.abs(I) < .001 && (I = 1),
  38158. this.x = (p - u) / I,
  38159. this.y = (l - d) / I,
  38160. this.z = (c - s) / I,
  38161. this.w = Math.acos((a + h + f - 1) / 2),
  38162. this
  38163. },
  38164. min: function(e) {
  38165. return this.x = Math.min(this.x, e.x),
  38166. this.y = Math.min(this.y, e.y),
  38167. this.z = Math.min(this.z, e.z),
  38168. this.w = Math.min(this.w, e.w),
  38169. this
  38170. },
  38171. max: function(e) {
  38172. return this.x = Math.max(this.x, e.x),
  38173. this.y = Math.max(this.y, e.y),
  38174. this.z = Math.max(this.z, e.z),
  38175. this.w = Math.max(this.w, e.w),
  38176. this
  38177. },
  38178. clamp: function(e, t) {
  38179. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38180. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38181. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38182. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38183. this
  38184. },
  38185. clampScalar: function(e, t) {
  38186. return void 0 === _e && (_e = new Ci.Vector4,
  38187. be = new Ci.Vector4),
  38188. _e.set(e, e, e, e),
  38189. be.set(t, t, t, t),
  38190. this.clamp(_e, be)
  38191. },
  38192. floor: function() {
  38193. return this.x = Math.floor(this.x),
  38194. this.y = Math.floor(this.y),
  38195. this.z = Math.floor(this.z),
  38196. this.w = Math.floor(this.w),
  38197. this
  38198. },
  38199. ceil: function() {
  38200. return this.x = Math.ceil(this.x),
  38201. this.y = Math.ceil(this.y),
  38202. this.z = Math.ceil(this.z),
  38203. this.w = Math.ceil(this.w),
  38204. this
  38205. },
  38206. round: function() {
  38207. return this.x = Math.round(this.x),
  38208. this.y = Math.round(this.y),
  38209. this.z = Math.round(this.z),
  38210. this.w = Math.round(this.w),
  38211. this
  38212. },
  38213. roundToZero: function() {
  38214. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38215. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38216. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38217. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38218. this
  38219. },
  38220. negate: function() {
  38221. return this.x = -this.x,
  38222. this.y = -this.y,
  38223. this.z = -this.z,
  38224. this.w = -this.w,
  38225. this
  38226. },
  38227. dot: function(e) {
  38228. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38229. },
  38230. lengthSq: function() {
  38231. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38232. },
  38233. length: function() {
  38234. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38235. },
  38236. lengthManhattan: function() {
  38237. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38238. },
  38239. normalize: function() {
  38240. return this.divideScalar(this.length())
  38241. },
  38242. setLength: function(e) {
  38243. return this.multiplyScalar(e / this.length())
  38244. },
  38245. lerp: function(e, t) {
  38246. return this.x += (e.x - this.x) * t,
  38247. this.y += (e.y - this.y) * t,
  38248. this.z += (e.z - this.z) * t,
  38249. this.w += (e.w - this.w) * t,
  38250. this
  38251. },
  38252. lerpVectors: function(e, t, i) {
  38253. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38254. this
  38255. },
  38256. equals: function(e) {
  38257. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38258. },
  38259. fromArray: function(e, t) {
  38260. return void 0 === t && (t = 0),
  38261. this.x = e[t],
  38262. this.y = e[t + 1],
  38263. this.z = e[t + 2],
  38264. this.w = e[t + 3],
  38265. this
  38266. },
  38267. toArray: function(e, t) {
  38268. return void 0 === e && (e = []),
  38269. void 0 === t && (t = 0),
  38270. e[t] = this.x,
  38271. e[t + 1] = this.y,
  38272. e[t + 2] = this.z,
  38273. e[t + 3] = this.w,
  38274. e
  38275. },
  38276. fromAttribute: function(e, t, i) {
  38277. return void 0 === i && (i = 0),
  38278. t = t * e.itemSize + i,
  38279. this.x = e.array[t],
  38280. this.y = e.array[t + 1],
  38281. this.z = e.array[t + 2],
  38282. this.w = e.array[t + 3],
  38283. this
  38284. }
  38285. },
  38286. Ci.Euler = function(e, t, i, n) {
  38287. this._x = e || 0,
  38288. this._y = t || 0,
  38289. this._z = i || 0,
  38290. this._order = n || Ci.Euler.DefaultOrder
  38291. }
  38292. ,
  38293. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38294. Ci.Euler.DefaultOrder = "XYZ",
  38295. Ci.Euler.prototype = {
  38296. constructor: Ci.Euler,
  38297. get x() {
  38298. return this._x
  38299. },
  38300. set x(e) {
  38301. this._x = e,
  38302. this.onChangeCallback()
  38303. },
  38304. get y() {
  38305. return this._y
  38306. },
  38307. set y(e) {
  38308. this._y = e,
  38309. this.onChangeCallback()
  38310. },
  38311. get z() {
  38312. return this._z
  38313. },
  38314. set z(e) {
  38315. this._z = e,
  38316. this.onChangeCallback()
  38317. },
  38318. get order() {
  38319. return this._order
  38320. },
  38321. set order(e) {
  38322. this._order = e,
  38323. this.onChangeCallback()
  38324. },
  38325. set: function(e, t, i, n) {
  38326. return this._x = e,
  38327. this._y = t,
  38328. this._z = i,
  38329. this._order = n || this._order,
  38330. this.onChangeCallback(),
  38331. this
  38332. },
  38333. clone: function() {
  38334. return new this.constructor(this._x,this._y,this._z,this._order)
  38335. },
  38336. copy: function(e) {
  38337. return this._x = e._x,
  38338. this._y = e._y,
  38339. this._z = e._z,
  38340. this._order = e._order,
  38341. this.onChangeCallback(),
  38342. this
  38343. },
  38344. setFromRotationMatrix: function(e, t, i) {
  38345. var n = Ci.Math.clamp
  38346. , r = e.elements
  38347. , o = r[0]
  38348. , a = r[4]
  38349. , s = r[8]
  38350. , l = r[1]
  38351. , c = r[5]
  38352. , h = r[9]
  38353. , u = r[2]
  38354. , d = r[6]
  38355. , p = r[10];
  38356. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  38357. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  38358. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  38359. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  38360. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  38361. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  38362. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  38363. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  38364. this._z = Math.atan2(-a, c)) : (this._y = 0,
  38365. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  38366. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  38367. this._z = Math.atan2(l, o)) : (this._x = 0,
  38368. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  38369. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  38370. this._y = Math.atan2(-u, o)) : (this._x = 0,
  38371. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  38372. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  38373. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  38374. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38375. this._order = t,
  38376. !1 !== i && this.onChangeCallback(),
  38377. this
  38378. },
  38379. setFromQuaternion: function(e, t, i) {
  38380. return void 0 === Ee && (Ee = new Ci.Matrix4),
  38381. Ee.makeRotationFromQuaternion(e),
  38382. this.setFromRotationMatrix(Ee, t, i),
  38383. this
  38384. },
  38385. setFromVector3: function(e, t) {
  38386. return this.set(e.x, e.y, e.z, t || this._order)
  38387. },
  38388. reorder: (Ie = new Ci.Quaternion,
  38389. function(e) {
  38390. Ie.setFromEuler(this),
  38391. this.setFromQuaternion(Ie, e)
  38392. }
  38393. ),
  38394. equals: function(e) {
  38395. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38396. },
  38397. fromArray: function(e) {
  38398. return this._x = e[0],
  38399. this._y = e[1],
  38400. this._z = e[2],
  38401. void 0 !== e[3] && (this._order = e[3]),
  38402. this.onChangeCallback(),
  38403. this
  38404. },
  38405. toArray: function(e, t) {
  38406. return void 0 === e && (e = []),
  38407. void 0 === t && (t = 0),
  38408. e[t] = this._x,
  38409. e[t + 1] = this._y,
  38410. e[t + 2] = this._z,
  38411. e[t + 3] = this._order,
  38412. e
  38413. },
  38414. toVector3: function(e) {
  38415. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  38416. },
  38417. onChange: function(e) {
  38418. return this.onChangeCallback = e,
  38419. this
  38420. },
  38421. onChangeCallback: function() {}
  38422. },
  38423. Ci.Line3 = function(e, t) {
  38424. this.start = void 0 !== e ? e : new Ci.Vector3,
  38425. this.end = void 0 !== t ? t : new Ci.Vector3
  38426. }
  38427. ,
  38428. Ci.Line3.prototype = {
  38429. constructor: Ci.Line3,
  38430. set: function(e, t) {
  38431. return this.start.copy(e),
  38432. this.end.copy(t),
  38433. this
  38434. },
  38435. clone: function() {
  38436. return (new this.constructor).copy(this)
  38437. },
  38438. copy: function(e) {
  38439. return this.start.copy(e.start),
  38440. this.end.copy(e.end),
  38441. this
  38442. },
  38443. center: function(e) {
  38444. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  38445. },
  38446. delta: function(e) {
  38447. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  38448. },
  38449. distanceSq: function() {
  38450. return this.start.distanceToSquared(this.end)
  38451. },
  38452. distance: function() {
  38453. return this.start.distanceTo(this.end)
  38454. },
  38455. at: function(e, t) {
  38456. var i = t || new Ci.Vector3;
  38457. return this.delta(i).multiplyScalar(e).add(this.start)
  38458. },
  38459. closestPointToPointParameter: (Ae = new Ci.Vector3,
  38460. Ce = new Ci.Vector3,
  38461. function(e, t) {
  38462. Ae.subVectors(e, this.start),
  38463. Ce.subVectors(this.end, this.start);
  38464. var i = Ce.dot(Ce)
  38465. , n = Ce.dot(Ae) / i;
  38466. return t && (n = Ci.Math.clamp(n, 0, 1)),
  38467. n
  38468. }
  38469. ),
  38470. closestPointToPoint: function(e, t, i) {
  38471. var n = this.closestPointToPointParameter(e, t)
  38472. , r = i || new Ci.Vector3;
  38473. return this.delta(r).multiplyScalar(n).add(this.start)
  38474. },
  38475. applyMatrix4: function(e) {
  38476. return this.start.applyMatrix4(e),
  38477. this.end.applyMatrix4(e),
  38478. this
  38479. },
  38480. equals: function(e) {
  38481. return e.start.equals(this.start) && e.end.equals(this.end)
  38482. }
  38483. },
  38484. Ci.Box2 = function(e, t) {
  38485. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  38486. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  38487. }
  38488. ,
  38489. Ci.Box2.prototype = {
  38490. constructor: Ci.Box2,
  38491. set: function(e, t) {
  38492. return this.min.copy(e),
  38493. this.max.copy(t),
  38494. this
  38495. },
  38496. setFromPoints: function(e) {
  38497. this.makeEmpty();
  38498. for (var t = 0, i = e.length; t < i; t++)
  38499. this.expandByPoint(e[t]);
  38500. return this
  38501. },
  38502. setFromCenterAndSize: (ye = new Ci.Vector2,
  38503. function(e, t) {
  38504. var i = ye.copy(t).multiplyScalar(.5);
  38505. return this.min.copy(e).sub(i),
  38506. this.max.copy(e).add(i),
  38507. this
  38508. }
  38509. ),
  38510. clone: function() {
  38511. return (new this.constructor).copy(this)
  38512. },
  38513. copy: function(e) {
  38514. return this.min.copy(e.min),
  38515. this.max.copy(e.max),
  38516. this
  38517. },
  38518. makeEmpty: function() {
  38519. return this.min.x = this.min.y = 1 / 0,
  38520. this.max.x = this.max.y = -1 / 0,
  38521. this
  38522. },
  38523. isEmpty: function() {
  38524. return this.max.x < this.min.x || this.max.y < this.min.y
  38525. },
  38526. center: function(e) {
  38527. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  38528. },
  38529. size: function(e) {
  38530. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  38531. },
  38532. expandByPoint: function(e) {
  38533. return this.min.min(e),
  38534. this.max.max(e),
  38535. this
  38536. },
  38537. expandByVector: function(e) {
  38538. return this.min.sub(e),
  38539. this.max.add(e),
  38540. this
  38541. },
  38542. expandByScalar: function(e) {
  38543. return this.min.addScalar(-e),
  38544. this.max.addScalar(e),
  38545. this
  38546. },
  38547. containsPoint: function(e) {
  38548. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  38549. },
  38550. containsBox: function(e) {
  38551. 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
  38552. },
  38553. getParameter: function(e, t) {
  38554. 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))
  38555. },
  38556. intersectsBox: function(e) {
  38557. 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)
  38558. },
  38559. clampPoint: function(e, t) {
  38560. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  38561. },
  38562. distanceToPoint: (ve = new Ci.Vector2,
  38563. function(e) {
  38564. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  38565. }
  38566. ),
  38567. intersect: function(e) {
  38568. return this.min.max(e.min),
  38569. this.max.min(e.max),
  38570. this
  38571. },
  38572. union: function(e) {
  38573. return this.min.min(e.min),
  38574. this.max.max(e.max),
  38575. this
  38576. },
  38577. translate: function(e) {
  38578. return this.min.add(e),
  38579. this.max.add(e),
  38580. this
  38581. },
  38582. equals: function(e) {
  38583. return e.min.equals(this.min) && e.max.equals(this.max)
  38584. }
  38585. },
  38586. Ci.Box3 = function(e, t) {
  38587. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  38588. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  38589. }
  38590. ,
  38591. Ci.Box3.prototype = {
  38592. constructor: Ci.Box3,
  38593. set: function(e, t) {
  38594. return this.min.copy(e),
  38595. this.max.copy(t),
  38596. this
  38597. },
  38598. setFromArray: function(e) {
  38599. this.makeEmpty();
  38600. 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) {
  38601. var c = e[s]
  38602. , h = e[s + 1]
  38603. , u = e[s + 2];
  38604. c < t && (t = c),
  38605. h < i && (i = h),
  38606. u < n && (n = u),
  38607. r < c && (r = c),
  38608. o < h && (o = h),
  38609. a < u && (a = u)
  38610. }
  38611. this.min.set(t, i, n),
  38612. this.max.set(r, o, a)
  38613. },
  38614. setFromPoints: function(e) {
  38615. this.makeEmpty();
  38616. for (var t = 0, i = e.length; t < i; t++)
  38617. this.expandByPoint(e[t]);
  38618. return this
  38619. },
  38620. setFromCenterAndSize: (me = new Ci.Vector3,
  38621. function(e, t) {
  38622. var i = me.copy(t).multiplyScalar(.5);
  38623. return this.min.copy(e).sub(i),
  38624. this.max.copy(e).add(i),
  38625. this
  38626. }
  38627. ),
  38628. setFromObject: function(e) {
  38629. void 0 === ge && (ge = new Ci.Box3);
  38630. var i = this;
  38631. return this.makeEmpty(),
  38632. e.updateMatrixWorld(!0),
  38633. e.traverse(function(e) {
  38634. var t = e.geometry;
  38635. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  38636. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  38637. ge.applyMatrix4(e.matrixWorld),
  38638. i.union(ge)))
  38639. }),
  38640. this
  38641. },
  38642. clone: function() {
  38643. return (new this.constructor).copy(this)
  38644. },
  38645. copy: function(e) {
  38646. return this.min.copy(e.min),
  38647. this.max.copy(e.max),
  38648. this
  38649. },
  38650. makeEmpty: function() {
  38651. return this.min.x = this.min.y = this.min.z = 1 / 0,
  38652. this.max.x = this.max.y = this.max.z = -1 / 0,
  38653. this
  38654. },
  38655. isEmpty: function() {
  38656. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  38657. },
  38658. center: function(e) {
  38659. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  38660. },
  38661. size: function(e) {
  38662. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  38663. },
  38664. expandByPoint: function(e) {
  38665. return this.min.min(e),
  38666. this.max.max(e),
  38667. this
  38668. },
  38669. expandByVector: function(e) {
  38670. return this.min.sub(e),
  38671. this.max.add(e),
  38672. this
  38673. },
  38674. expandByScalar: function(e) {
  38675. return this.min.addScalar(-e),
  38676. this.max.addScalar(e),
  38677. this
  38678. },
  38679. containsPoint: function(e) {
  38680. 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)
  38681. },
  38682. containsBox: function(e) {
  38683. 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
  38684. },
  38685. getParameter: function(e, t) {
  38686. 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))
  38687. },
  38688. intersectsBox: function(e) {
  38689. 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)
  38690. },
  38691. intersectsSphere: function(e) {
  38692. return void 0 === fe && (fe = new Ci.Vector3),
  38693. this.clampPoint(e.center, fe),
  38694. fe.distanceToSquared(e.center) <= e.radius * e.radius
  38695. },
  38696. intersectsPlane: function(e) {
  38697. var t, i;
  38698. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  38699. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  38700. e.normal.x * this.min.x),
  38701. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  38702. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  38703. i += e.normal.y * this.min.y),
  38704. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  38705. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  38706. i += e.normal.z * this.min.z),
  38707. t <= e.constant && i >= e.constant
  38708. },
  38709. clampPoint: function(e, t) {
  38710. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  38711. },
  38712. distanceToPoint: (pe = new Ci.Vector3,
  38713. function(e) {
  38714. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  38715. }
  38716. ),
  38717. getBoundingSphere: (de = new Ci.Vector3,
  38718. function(e) {
  38719. var t = e || new Ci.Sphere;
  38720. return t.center = this.center(),
  38721. t.radius = .5 * this.size(de).length(),
  38722. t
  38723. }
  38724. ),
  38725. intersect: function(e) {
  38726. return this.min.max(e.min),
  38727. this.max.min(e.max),
  38728. this
  38729. },
  38730. union: function(e) {
  38731. return this.min.min(e.min),
  38732. this.max.max(e.max),
  38733. this
  38734. },
  38735. 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],
  38736. function(e) {
  38737. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  38738. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  38739. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  38740. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  38741. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  38742. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  38743. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  38744. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  38745. this.makeEmpty(),
  38746. this.setFromPoints(ue),
  38747. this
  38748. }
  38749. ),
  38750. translate: function(e) {
  38751. return this.min.add(e),
  38752. this.max.add(e),
  38753. this
  38754. },
  38755. equals: function(e) {
  38756. return e.min.equals(this.min) && e.max.equals(this.max)
  38757. }
  38758. },
  38759. Ci.Matrix3 = function() {
  38760. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  38761. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  38762. }
  38763. ,
  38764. Ci.Matrix3.prototype = {
  38765. constructor: Ci.Matrix3,
  38766. set: function(e, t, i, n, r, o, a, s, l) {
  38767. var c = this.elements;
  38768. return c[0] = e,
  38769. c[1] = n,
  38770. c[2] = a,
  38771. c[3] = t,
  38772. c[4] = r,
  38773. c[5] = s,
  38774. c[6] = i,
  38775. c[7] = o,
  38776. c[8] = l,
  38777. this
  38778. },
  38779. identity: function() {
  38780. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  38781. this
  38782. },
  38783. clone: function() {
  38784. return (new this.constructor).fromArray(this.elements)
  38785. },
  38786. copy: function(e) {
  38787. var t = e.elements;
  38788. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  38789. this
  38790. },
  38791. setFromMatrix4: function(e) {
  38792. var t = e.elements;
  38793. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  38794. this
  38795. },
  38796. applyToVector3Array: function(e, t, i) {
  38797. void 0 === he && (he = new Ci.Vector3),
  38798. void 0 === t && (t = 0),
  38799. void 0 === i && (i = e.length);
  38800. for (var n = 0, r = t; n < i; n += 3,
  38801. r += 3)
  38802. he.fromArray(e, r),
  38803. he.applyMatrix3(this),
  38804. he.toArray(e, r);
  38805. return e
  38806. },
  38807. applyToBuffer: function(e, t, i) {
  38808. void 0 === ce && (ce = new Ci.Vector3),
  38809. void 0 === t && (t = 0),
  38810. void 0 === i && (i = e.length / e.itemSize);
  38811. for (var n = 0, r = t; n < i; n++,
  38812. r++)
  38813. ce.x = e.getX(r),
  38814. ce.y = e.getY(r),
  38815. ce.z = e.getZ(r),
  38816. ce.applyMatrix3(this),
  38817. e.setXYZ(ce.x, ce.y, ce.z);
  38818. return e
  38819. },
  38820. multiplyScalar: function(e) {
  38821. var t = this.elements;
  38822. return t[0] *= e,
  38823. t[3] *= e,
  38824. t[6] *= e,
  38825. t[1] *= e,
  38826. t[4] *= e,
  38827. t[7] *= e,
  38828. t[2] *= e,
  38829. t[5] *= e,
  38830. t[8] *= e,
  38831. this
  38832. },
  38833. determinant: function() {
  38834. var e = this.elements
  38835. , t = e[0]
  38836. , i = e[1]
  38837. , n = e[2]
  38838. , r = e[3]
  38839. , o = e[4]
  38840. , a = e[5]
  38841. , s = e[6]
  38842. , l = e[7]
  38843. , c = e[8];
  38844. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  38845. },
  38846. getInverse: function(e, t) {
  38847. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  38848. var i = e.elements
  38849. , n = this.elements
  38850. , r = i[0]
  38851. , o = i[1]
  38852. , a = i[2]
  38853. , s = i[3]
  38854. , l = i[4]
  38855. , c = i[5]
  38856. , h = i[6]
  38857. , u = i[7]
  38858. , d = i[8]
  38859. , p = d * l - c * u
  38860. , f = c * h - d * s
  38861. , g = u * s - l * h
  38862. , m = r * p + o * f + a * g;
  38863. if (0 != m)
  38864. return n[0] = p,
  38865. n[1] = a * u - d * o,
  38866. n[2] = c * o - a * l,
  38867. n[3] = f,
  38868. n[4] = d * r - a * h,
  38869. n[5] = a * s - c * r,
  38870. n[6] = g,
  38871. n[7] = o * h - u * r,
  38872. n[8] = l * r - o * s,
  38873. this.multiplyScalar(1 / m);
  38874. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  38875. if (t)
  38876. throw new Error(v);
  38877. return console.warn(v),
  38878. this.identity()
  38879. },
  38880. transpose: function() {
  38881. var e, t = this.elements;
  38882. return e = t[1],
  38883. t[1] = t[3],
  38884. t[3] = e,
  38885. e = t[2],
  38886. t[2] = t[6],
  38887. t[6] = e,
  38888. e = t[5],
  38889. t[5] = t[7],
  38890. t[7] = e,
  38891. this
  38892. },
  38893. flattenToArrayOffset: function(e, t) {
  38894. var i = this.elements;
  38895. return e[t] = i[0],
  38896. e[t + 1] = i[1],
  38897. e[t + 2] = i[2],
  38898. e[t + 3] = i[3],
  38899. e[t + 4] = i[4],
  38900. e[t + 5] = i[5],
  38901. e[t + 6] = i[6],
  38902. e[t + 7] = i[7],
  38903. e[t + 8] = i[8],
  38904. e
  38905. },
  38906. getNormalMatrix: function(e) {
  38907. return this.setFromMatrix4(e).getInverse(this).transpose()
  38908. },
  38909. transposeIntoArray: function(e) {
  38910. var t = this.elements;
  38911. return e[0] = t[0],
  38912. e[1] = t[3],
  38913. e[2] = t[6],
  38914. e[3] = t[1],
  38915. e[4] = t[4],
  38916. e[5] = t[7],
  38917. e[6] = t[2],
  38918. e[7] = t[5],
  38919. e[8] = t[8],
  38920. this
  38921. },
  38922. fromArray: function(e) {
  38923. return this.elements.set(e),
  38924. this
  38925. },
  38926. toArray: function() {
  38927. var e = this.elements;
  38928. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  38929. }
  38930. },
  38931. Ci.Matrix4 = function() {
  38932. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  38933. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  38934. }
  38935. ,
  38936. Ci.Matrix4.prototype = {
  38937. constructor: Ci.Matrix4,
  38938. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  38939. var m = this.elements;
  38940. return m[0] = e,
  38941. m[4] = t,
  38942. m[8] = i,
  38943. m[12] = n,
  38944. m[1] = r,
  38945. m[5] = o,
  38946. m[9] = a,
  38947. m[13] = s,
  38948. m[2] = l,
  38949. m[6] = c,
  38950. m[10] = h,
  38951. m[14] = u,
  38952. m[3] = d,
  38953. m[7] = p,
  38954. m[11] = f,
  38955. m[15] = g,
  38956. this
  38957. },
  38958. identity: function() {
  38959. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  38960. this
  38961. },
  38962. clone: function() {
  38963. return (new Ci.Matrix4).fromArray(this.elements)
  38964. },
  38965. copy: function(e) {
  38966. return this.elements.set(e.elements),
  38967. this
  38968. },
  38969. copyPosition: function(e) {
  38970. var t = this.elements
  38971. , i = e.elements;
  38972. return t[12] = i[12],
  38973. t[13] = i[13],
  38974. t[14] = i[14],
  38975. this
  38976. },
  38977. extractBasis: function(e, t, i) {
  38978. return e.setFromMatrixColumn(this, 0),
  38979. t.setFromMatrixColumn(this, 1),
  38980. i.setFromMatrixColumn(this, 2),
  38981. this
  38982. },
  38983. makeBasis: function(e, t, i) {
  38984. 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),
  38985. this
  38986. },
  38987. extractRotation: function(e) {
  38988. void 0 === le && (le = new Ci.Vector3);
  38989. var t = this.elements
  38990. , i = e.elements
  38991. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  38992. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  38993. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  38994. return t[0] = i[0] * n,
  38995. t[1] = i[1] * n,
  38996. t[2] = i[2] * n,
  38997. t[4] = i[4] * r,
  38998. t[5] = i[5] * r,
  38999. t[6] = i[6] * r,
  39000. t[8] = i[8] * o,
  39001. t[9] = i[9] * o,
  39002. t[10] = i[10] * o,
  39003. this
  39004. },
  39005. makeRotationFromEuler: function(e) {
  39006. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39007. var t = this.elements
  39008. , i = e.x
  39009. , n = e.y
  39010. , r = e.z
  39011. , o = Math.cos(i)
  39012. , a = Math.sin(i)
  39013. , s = Math.cos(n)
  39014. , l = Math.sin(n)
  39015. , c = Math.cos(r)
  39016. , h = Math.sin(r);
  39017. if ("XYZ" === e.order) {
  39018. var u = o * c
  39019. , d = o * h
  39020. , p = a * c
  39021. , f = a * h;
  39022. t[0] = s * c,
  39023. t[4] = -s * h,
  39024. t[8] = l,
  39025. t[1] = d + p * l,
  39026. t[5] = u - f * l,
  39027. t[9] = -a * s,
  39028. t[2] = f - u * l,
  39029. t[6] = p + d * l,
  39030. t[10] = o * s
  39031. } else if ("YXZ" === e.order) {
  39032. var g = s * c
  39033. , m = s * h
  39034. , v = l * c
  39035. , y = l * h;
  39036. t[0] = g + y * a,
  39037. t[4] = v * a - m,
  39038. t[8] = o * l,
  39039. t[1] = o * h,
  39040. t[5] = o * c,
  39041. t[9] = -a,
  39042. t[2] = m * a - v,
  39043. t[6] = y + g * a,
  39044. t[10] = o * s
  39045. } else if ("ZXY" === e.order) {
  39046. g = s * c,
  39047. m = s * h,
  39048. v = l * c,
  39049. y = l * h;
  39050. t[0] = g - y * a,
  39051. t[4] = -o * h,
  39052. t[8] = v + m * a,
  39053. t[1] = m + v * a,
  39054. t[5] = o * c,
  39055. t[9] = y - g * a,
  39056. t[2] = -o * l,
  39057. t[6] = a,
  39058. t[10] = o * s
  39059. } else if ("ZYX" === e.order) {
  39060. u = o * c,
  39061. d = o * h,
  39062. p = a * c,
  39063. f = a * h;
  39064. t[0] = s * c,
  39065. t[4] = p * l - d,
  39066. t[8] = u * l + f,
  39067. t[1] = s * h,
  39068. t[5] = f * l + u,
  39069. t[9] = d * l - p,
  39070. t[2] = -l,
  39071. t[6] = a * s,
  39072. t[10] = o * s
  39073. } else if ("YZX" === e.order) {
  39074. var A = o * s
  39075. , C = o * l
  39076. , I = a * s
  39077. , E = a * l;
  39078. t[0] = s * c,
  39079. t[4] = E - A * h,
  39080. t[8] = I * h + C,
  39081. t[1] = h,
  39082. t[5] = o * c,
  39083. t[9] = -a * c,
  39084. t[2] = -l * c,
  39085. t[6] = C * h + I,
  39086. t[10] = A - E * h
  39087. } else if ("XZY" === e.order) {
  39088. A = o * s,
  39089. C = o * l,
  39090. I = a * s,
  39091. E = a * l;
  39092. t[0] = s * c,
  39093. t[4] = -h,
  39094. t[8] = l * c,
  39095. t[1] = A * h + E,
  39096. t[5] = o * c,
  39097. t[9] = C * h - I,
  39098. t[2] = I * h - C,
  39099. t[6] = a * c,
  39100. t[10] = E * h + A
  39101. }
  39102. return t[3] = 0,
  39103. t[7] = 0,
  39104. t[11] = 0,
  39105. t[12] = 0,
  39106. t[13] = 0,
  39107. t[14] = 0,
  39108. t[15] = 1,
  39109. this
  39110. },
  39111. makeRotationFromQuaternion: function(e) {
  39112. var t = this.elements
  39113. , i = e.x
  39114. , n = e.y
  39115. , r = e.z
  39116. , o = e.w
  39117. , a = i + i
  39118. , s = n + n
  39119. , l = r + r
  39120. , c = i * a
  39121. , h = i * s
  39122. , u = i * l
  39123. , d = n * s
  39124. , p = n * l
  39125. , f = r * l
  39126. , g = o * a
  39127. , m = o * s
  39128. , v = o * l;
  39129. return t[0] = 1 - (d + f),
  39130. t[4] = h - v,
  39131. t[8] = u + m,
  39132. t[1] = h + v,
  39133. t[5] = 1 - (c + f),
  39134. t[9] = p - g,
  39135. t[2] = u - m,
  39136. t[6] = p + g,
  39137. t[10] = 1 - (c + d),
  39138. t[3] = 0,
  39139. t[7] = 0,
  39140. t[11] = 0,
  39141. t[12] = 0,
  39142. t[13] = 0,
  39143. t[14] = 0,
  39144. t[15] = 1,
  39145. this
  39146. },
  39147. lookAt: function(e, t, i) {
  39148. void 0 === oe && (oe = new Ci.Vector3),
  39149. void 0 === ae && (ae = new Ci.Vector3),
  39150. void 0 === se && (se = new Ci.Vector3);
  39151. var n = this.elements;
  39152. return se.subVectors(e, t).normalize(),
  39153. 0 === se.lengthSq() && (se.z = 1),
  39154. oe.crossVectors(i, se).normalize(),
  39155. 0 === oe.lengthSq() && (se.x += 1e-4,
  39156. oe.crossVectors(i, se).normalize()),
  39157. ae.crossVectors(se, oe),
  39158. n[0] = oe.x,
  39159. n[4] = ae.x,
  39160. n[8] = se.x,
  39161. n[1] = oe.y,
  39162. n[5] = ae.y,
  39163. n[9] = se.y,
  39164. n[2] = oe.z,
  39165. n[6] = ae.z,
  39166. n[10] = se.z,
  39167. this
  39168. },
  39169. multiply: function(e, t) {
  39170. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39171. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39172. },
  39173. multiplyMatrices: function(e, t) {
  39174. var i = e.elements
  39175. , n = t.elements
  39176. , r = this.elements
  39177. , o = i[0]
  39178. , a = i[4]
  39179. , s = i[8]
  39180. , l = i[12]
  39181. , c = i[1]
  39182. , h = i[5]
  39183. , u = i[9]
  39184. , d = i[13]
  39185. , p = i[2]
  39186. , f = i[6]
  39187. , g = i[10]
  39188. , m = i[14]
  39189. , v = i[3]
  39190. , y = i[7]
  39191. , A = i[11]
  39192. , C = i[15]
  39193. , I = n[0]
  39194. , E = n[4]
  39195. , _ = n[8]
  39196. , b = n[12]
  39197. , w = n[1]
  39198. , T = n[5]
  39199. , x = n[9]
  39200. , S = n[13]
  39201. , M = n[2]
  39202. , R = n[6]
  39203. , P = n[10]
  39204. , O = n[14]
  39205. , L = n[3]
  39206. , D = n[7]
  39207. , N = n[11]
  39208. , F = n[15];
  39209. return r[0] = o * I + a * w + s * M + l * L,
  39210. r[4] = o * E + a * T + s * R + l * D,
  39211. r[8] = o * _ + a * x + s * P + l * N,
  39212. r[12] = o * b + a * S + s * O + l * F,
  39213. r[1] = c * I + h * w + u * M + d * L,
  39214. r[5] = c * E + h * T + u * R + d * D,
  39215. r[9] = c * _ + h * x + u * P + d * N,
  39216. r[13] = c * b + h * S + u * O + d * F,
  39217. r[2] = p * I + f * w + g * M + m * L,
  39218. r[6] = p * E + f * T + g * R + m * D,
  39219. r[10] = p * _ + f * x + g * P + m * N,
  39220. r[14] = p * b + f * S + g * O + m * F,
  39221. r[3] = v * I + y * w + A * M + C * L,
  39222. r[7] = v * E + y * T + A * R + C * D,
  39223. r[11] = v * _ + y * x + A * P + C * N,
  39224. r[15] = v * b + y * S + A * O + C * F,
  39225. this
  39226. },
  39227. multiplyToArray: function(e, t, i) {
  39228. var n = this.elements;
  39229. return this.multiplyMatrices(e, t),
  39230. i[0] = n[0],
  39231. i[1] = n[1],
  39232. i[2] = n[2],
  39233. i[3] = n[3],
  39234. i[4] = n[4],
  39235. i[5] = n[5],
  39236. i[6] = n[6],
  39237. i[7] = n[7],
  39238. i[8] = n[8],
  39239. i[9] = n[9],
  39240. i[10] = n[10],
  39241. i[11] = n[11],
  39242. i[12] = n[12],
  39243. i[13] = n[13],
  39244. i[14] = n[14],
  39245. i[15] = n[15],
  39246. this
  39247. },
  39248. multiplyScalar: function(e) {
  39249. var t = this.elements;
  39250. return t[0] *= e,
  39251. t[4] *= e,
  39252. t[8] *= e,
  39253. t[12] *= e,
  39254. t[1] *= e,
  39255. t[5] *= e,
  39256. t[9] *= e,
  39257. t[13] *= e,
  39258. t[2] *= e,
  39259. t[6] *= e,
  39260. t[10] *= e,
  39261. t[14] *= e,
  39262. t[3] *= e,
  39263. t[7] *= e,
  39264. t[11] *= e,
  39265. t[15] *= e,
  39266. this
  39267. },
  39268. applyToVector3Array: function(e, t, i) {
  39269. void 0 === re && (re = new Ci.Vector3),
  39270. void 0 === t && (t = 0),
  39271. void 0 === i && (i = e.length);
  39272. for (var n = 0, r = t; n < i; n += 3,
  39273. r += 3)
  39274. re.fromArray(e, r),
  39275. re.applyMatrix4(this),
  39276. re.toArray(e, r);
  39277. return e
  39278. },
  39279. applyToBuffer: function(e, t, i) {
  39280. void 0 === ne && (ne = new Ci.Vector3),
  39281. void 0 === t && (t = 0),
  39282. void 0 === i && (i = e.length / e.itemSize);
  39283. for (var n = 0, r = t; n < i; n++,
  39284. r++)
  39285. ne.x = e.getX(r),
  39286. ne.y = e.getY(r),
  39287. ne.z = e.getZ(r),
  39288. ne.applyMatrix4(this),
  39289. e.setXYZ(ne.x, ne.y, ne.z);
  39290. return e
  39291. },
  39292. determinant: function() {
  39293. var e = this.elements
  39294. , t = e[0]
  39295. , i = e[4]
  39296. , n = e[8]
  39297. , r = e[12]
  39298. , o = e[1]
  39299. , a = e[5]
  39300. , s = e[9]
  39301. , l = e[13]
  39302. , c = e[2]
  39303. , h = e[6]
  39304. , u = e[10]
  39305. , d = e[14];
  39306. 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)
  39307. },
  39308. transpose: function() {
  39309. var e, t = this.elements;
  39310. return e = t[1],
  39311. t[1] = t[4],
  39312. t[4] = e,
  39313. e = t[2],
  39314. t[2] = t[8],
  39315. t[8] = e,
  39316. e = t[6],
  39317. t[6] = t[9],
  39318. t[9] = e,
  39319. e = t[3],
  39320. t[3] = t[12],
  39321. t[12] = e,
  39322. e = t[7],
  39323. t[7] = t[13],
  39324. t[13] = e,
  39325. e = t[11],
  39326. t[11] = t[14],
  39327. t[14] = e,
  39328. this
  39329. },
  39330. flattenToArrayOffset: function(e, t) {
  39331. var i = this.elements;
  39332. return e[t] = i[0],
  39333. e[t + 1] = i[1],
  39334. e[t + 2] = i[2],
  39335. e[t + 3] = i[3],
  39336. e[t + 4] = i[4],
  39337. e[t + 5] = i[5],
  39338. e[t + 6] = i[6],
  39339. e[t + 7] = i[7],
  39340. e[t + 8] = i[8],
  39341. e[t + 9] = i[9],
  39342. e[t + 10] = i[10],
  39343. e[t + 11] = i[11],
  39344. e[t + 12] = i[12],
  39345. e[t + 13] = i[13],
  39346. e[t + 14] = i[14],
  39347. e[t + 15] = i[15],
  39348. e
  39349. },
  39350. getPosition: function() {
  39351. return void 0 === ie && (ie = new Ci.Vector3),
  39352. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39353. ie.setFromMatrixColumn(this, 3)
  39354. },
  39355. setPosition: function(e) {
  39356. var t = this.elements;
  39357. return t[12] = e.x,
  39358. t[13] = e.y,
  39359. t[14] = e.z,
  39360. this
  39361. },
  39362. getInverse: function(e, t) {
  39363. var i = this.elements
  39364. , n = e.elements
  39365. , r = n[0]
  39366. , o = n[1]
  39367. , a = n[2]
  39368. , s = n[3]
  39369. , l = n[4]
  39370. , c = n[5]
  39371. , h = n[6]
  39372. , u = n[7]
  39373. , d = n[8]
  39374. , p = n[9]
  39375. , f = n[10]
  39376. , g = n[11]
  39377. , m = n[12]
  39378. , v = n[13]
  39379. , y = n[14]
  39380. , A = n[15]
  39381. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  39382. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  39383. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  39384. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  39385. , b = r * C + o * I + a * E + s * _;
  39386. if (0 != b)
  39387. return i[0] = C,
  39388. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  39389. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  39390. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  39391. i[4] = I,
  39392. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  39393. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  39394. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  39395. i[8] = E,
  39396. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  39397. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  39398. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  39399. i[12] = _,
  39400. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  39401. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  39402. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  39403. this.multiplyScalar(1 / b);
  39404. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  39405. if (t)
  39406. throw new Error(w);
  39407. return console.warn(w),
  39408. this.identity()
  39409. },
  39410. scale: function(e) {
  39411. var t = this.elements
  39412. , i = e.x
  39413. , n = e.y
  39414. , r = e.z;
  39415. return t[0] *= i,
  39416. t[4] *= n,
  39417. t[8] *= r,
  39418. t[1] *= i,
  39419. t[5] *= n,
  39420. t[9] *= r,
  39421. t[2] *= i,
  39422. t[6] *= n,
  39423. t[10] *= r,
  39424. t[3] *= i,
  39425. t[7] *= n,
  39426. t[11] *= r,
  39427. this
  39428. },
  39429. getMaxScaleOnAxis: function() {
  39430. var e = this.elements
  39431. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  39432. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  39433. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  39434. return Math.sqrt(Math.max(t, i, n))
  39435. },
  39436. makeTranslation: function(e, t, i) {
  39437. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  39438. this
  39439. },
  39440. makeRotationX: function(e) {
  39441. var t = Math.cos(e)
  39442. , i = Math.sin(e);
  39443. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  39444. this
  39445. },
  39446. makeRotationY: function(e) {
  39447. var t = Math.cos(e)
  39448. , i = Math.sin(e);
  39449. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  39450. this
  39451. },
  39452. makeRotationZ: function(e) {
  39453. var t = Math.cos(e)
  39454. , i = Math.sin(e);
  39455. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39456. this
  39457. },
  39458. makeRotationAxis: function(e, t) {
  39459. var i = Math.cos(t)
  39460. , n = Math.sin(t)
  39461. , r = 1 - i
  39462. , o = e.x
  39463. , a = e.y
  39464. , s = e.z
  39465. , l = r * o
  39466. , c = r * a;
  39467. 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),
  39468. this
  39469. },
  39470. makeScale: function(e, t, i) {
  39471. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  39472. this
  39473. },
  39474. compose: function(e, t, i) {
  39475. return this.makeRotationFromQuaternion(t),
  39476. this.scale(i),
  39477. this.setPosition(e),
  39478. this
  39479. },
  39480. decompose: function(e, t, i) {
  39481. void 0 === ee && (ee = new Ci.Vector3),
  39482. void 0 === te && (te = new Ci.Matrix4);
  39483. var n = this.elements
  39484. , r = ee.set(n[0], n[1], n[2]).length()
  39485. , o = ee.set(n[4], n[5], n[6]).length()
  39486. , a = ee.set(n[8], n[9], n[10]).length();
  39487. this.determinant() < 0 && (r = -r),
  39488. e.x = n[12],
  39489. e.y = n[13],
  39490. e.z = n[14],
  39491. te.elements.set(this.elements);
  39492. var s = 1 / r
  39493. , l = 1 / o
  39494. , c = 1 / a;
  39495. return te.elements[0] *= s,
  39496. te.elements[1] *= s,
  39497. te.elements[2] *= s,
  39498. te.elements[4] *= l,
  39499. te.elements[5] *= l,
  39500. te.elements[6] *= l,
  39501. te.elements[8] *= c,
  39502. te.elements[9] *= c,
  39503. te.elements[10] *= c,
  39504. t.setFromRotationMatrix(te),
  39505. i.x = r,
  39506. i.y = o,
  39507. i.z = a,
  39508. this
  39509. },
  39510. makeFrustum: function(e, t, i, n, r, o) {
  39511. var a = this.elements
  39512. , s = 2 * r / (t - e)
  39513. , l = 2 * r / (n - i)
  39514. , c = (t + e) / (t - e)
  39515. , h = (n + i) / (n - i)
  39516. , u = -(o + r) / (o - r)
  39517. , d = -2 * o * r / (o - r);
  39518. return a[0] = s,
  39519. a[4] = 0,
  39520. a[8] = c,
  39521. a[12] = 0,
  39522. a[1] = 0,
  39523. a[5] = l,
  39524. a[9] = h,
  39525. a[13] = 0,
  39526. a[2] = 0,
  39527. a[6] = 0,
  39528. a[10] = u,
  39529. a[14] = d,
  39530. a[3] = 0,
  39531. a[7] = 0,
  39532. a[11] = -1,
  39533. a[15] = 0,
  39534. this
  39535. },
  39536. makePerspective: function(e, t, i, n) {
  39537. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  39538. , o = -r
  39539. , a = o * t
  39540. , s = r * t;
  39541. return this.makeFrustum(a, s, o, r, i, n)
  39542. },
  39543. makeOrthographic: function(e, t, i, n, r, o) {
  39544. var a = this.elements
  39545. , s = 1 / (t - e)
  39546. , l = 1 / (i - n)
  39547. , c = 1 / (o - r)
  39548. , h = (t + e) * s
  39549. , u = (i + n) * l
  39550. , d = (o + r) * c;
  39551. return a[0] = 2 * s,
  39552. a[4] = 0,
  39553. a[8] = 0,
  39554. a[12] = -h,
  39555. a[1] = 0,
  39556. a[5] = 2 * l,
  39557. a[9] = 0,
  39558. a[13] = -u,
  39559. a[2] = 0,
  39560. a[6] = 0,
  39561. a[10] = -2 * c,
  39562. a[14] = -d,
  39563. a[3] = 0,
  39564. a[7] = 0,
  39565. a[11] = 0,
  39566. a[15] = 1,
  39567. this
  39568. },
  39569. equals: function(e) {
  39570. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  39571. if (t[n] !== i[n])
  39572. return !1;
  39573. return !0
  39574. },
  39575. fromArray: function(e) {
  39576. return this.elements.set(e),
  39577. this
  39578. },
  39579. toArray: function() {
  39580. var e = this.elements;
  39581. 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]]
  39582. }
  39583. },
  39584. Ci.Ray = function(e, t) {
  39585. this.origin = void 0 !== e ? e : new Ci.Vector3,
  39586. this.direction = void 0 !== t ? t : new Ci.Vector3
  39587. }
  39588. ,
  39589. Ci.Ray.prototype = {
  39590. constructor: Ci.Ray,
  39591. set: function(e, t) {
  39592. return this.origin.copy(e),
  39593. this.direction.copy(t),
  39594. this
  39595. },
  39596. clone: function() {
  39597. return (new this.constructor).copy(this)
  39598. },
  39599. copy: function(e) {
  39600. return this.origin.copy(e.origin),
  39601. this.direction.copy(e.direction),
  39602. this
  39603. },
  39604. at: function(e, t) {
  39605. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  39606. },
  39607. lookAt: function(e) {
  39608. this.direction.copy(e).sub(this.origin).normalize()
  39609. },
  39610. recast: ($ = new Ci.Vector3,
  39611. function(e) {
  39612. return this.origin.copy(this.at(e, $)),
  39613. this
  39614. }
  39615. ),
  39616. closestPointToPoint: function(e, t) {
  39617. var i = t || new Ci.Vector3;
  39618. i.subVectors(e, this.origin);
  39619. var n = i.dot(this.direction);
  39620. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  39621. },
  39622. distanceToPoint: function(e) {
  39623. return Math.sqrt(this.distanceSqToPoint(e))
  39624. },
  39625. distanceSqToPoint: (J = new Ci.Vector3,
  39626. function(e) {
  39627. var t = J.subVectors(e, this.origin).dot(this.direction);
  39628. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  39629. J.distanceToSquared(e))
  39630. }
  39631. ),
  39632. distanceSqToSegment: (Z = new Ci.Vector3,
  39633. K = new Ci.Vector3,
  39634. Q = new Ci.Vector3,
  39635. function(e, t, i, n) {
  39636. Z.copy(e).add(t).multiplyScalar(.5),
  39637. K.copy(t).sub(e).normalize(),
  39638. Q.copy(this.origin).sub(Z);
  39639. 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);
  39640. if (0 < p)
  39641. if (o = c * h - u,
  39642. s = l * p,
  39643. 0 <= (r = c * u - h))
  39644. if (-s <= o)
  39645. if (o <= s) {
  39646. var f = 1 / p;
  39647. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  39648. } else
  39649. o = l,
  39650. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39651. else
  39652. o = -l,
  39653. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39654. else
  39655. 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,
  39656. (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;
  39657. else
  39658. o = 0 < c ? -l : l,
  39659. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39660. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  39661. n && n.copy(K).multiplyScalar(o).add(Z),
  39662. a
  39663. }
  39664. ),
  39665. intersectSphere: (X = new Ci.Vector3,
  39666. function(e, t) {
  39667. X.subVectors(e.center, this.origin);
  39668. var i = X.dot(this.direction)
  39669. , n = X.dot(X) - i * i
  39670. , r = e.radius * e.radius;
  39671. if (r < n)
  39672. return null;
  39673. var o = Math.sqrt(r - n)
  39674. , a = i - o
  39675. , s = i + o;
  39676. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  39677. }
  39678. ),
  39679. intersectsSphere: function(e) {
  39680. return this.distanceToPoint(e.center) <= e.radius
  39681. },
  39682. distanceToPlane: function(e) {
  39683. var t = e.normal.dot(this.direction);
  39684. if (0 === t)
  39685. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  39686. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  39687. return 0 <= i ? i : null
  39688. },
  39689. intersectPlane: function(e, t) {
  39690. var i = this.distanceToPlane(e);
  39691. return null === i ? null : this.at(i, t)
  39692. },
  39693. intersectsPlane: function(e) {
  39694. var t = e.distanceToPoint(this.origin);
  39695. return 0 === t || e.normal.dot(this.direction) * t < 0
  39696. },
  39697. intersectBox: function(e, t) {
  39698. 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;
  39699. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  39700. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  39701. (e.min.x - u.x) * l),
  39702. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  39703. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  39704. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  39705. (o < n || n != n) && (n = o),
  39706. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  39707. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  39708. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  39709. (s < n || n != n) && (n = s),
  39710. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  39711. },
  39712. intersectsBox: (q = new Ci.Vector3,
  39713. function(e) {
  39714. return null !== this.intersectBox(e, q)
  39715. }
  39716. ),
  39717. intersectTriangle: (G = new Ci.Vector3,
  39718. W = new Ci.Vector3,
  39719. j = new Ci.Vector3,
  39720. Y = new Ci.Vector3,
  39721. function(e, t, i, n, r) {
  39722. W.subVectors(t, e),
  39723. j.subVectors(i, e),
  39724. Y.crossVectors(W, j);
  39725. var o, a = this.direction.dot(Y);
  39726. if (0 < a) {
  39727. if (n)
  39728. return null;
  39729. o = 1
  39730. } else {
  39731. if (!(a < 0))
  39732. return null;
  39733. o = -1,
  39734. a = -a
  39735. }
  39736. G.subVectors(this.origin, e);
  39737. var s = o * this.direction.dot(j.crossVectors(G, j));
  39738. if (s < 0)
  39739. return null;
  39740. var l = o * this.direction.dot(W.cross(G));
  39741. if (l < 0)
  39742. return null;
  39743. if (a < s + l)
  39744. return null;
  39745. var c = -o * G.dot(Y);
  39746. return c < 0 ? null : this.at(c / a, r)
  39747. }
  39748. ),
  39749. applyMatrix4: function(e) {
  39750. return this.direction.add(this.origin).applyMatrix4(e),
  39751. this.origin.applyMatrix4(e),
  39752. this.direction.sub(this.origin),
  39753. this.direction.normalize(),
  39754. this
  39755. },
  39756. equals: function(e) {
  39757. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  39758. }
  39759. },
  39760. Ci.Sphere = function(e, t) {
  39761. this.center = void 0 !== e ? e : new Ci.Vector3,
  39762. this.radius = void 0 !== t ? t : 0
  39763. }
  39764. ,
  39765. Ci.Sphere.prototype = {
  39766. constructor: Ci.Sphere,
  39767. set: function(e, t) {
  39768. return this.center.copy(e),
  39769. this.radius = t,
  39770. this
  39771. },
  39772. setFromPoints: (z = new Ci.Box3,
  39773. function(e, t) {
  39774. var i = this.center;
  39775. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  39776. for (var n = 0, r = 0, o = e.length; r < o; r++)
  39777. n = Math.max(n, i.distanceToSquared(e[r]));
  39778. return this.radius = Math.sqrt(n),
  39779. this
  39780. }
  39781. ),
  39782. clone: function() {
  39783. return (new this.constructor).copy(this)
  39784. },
  39785. copy: function(e) {
  39786. return this.center.copy(e.center),
  39787. this.radius = e.radius,
  39788. this
  39789. },
  39790. empty: function() {
  39791. return this.radius <= 0
  39792. },
  39793. containsPoint: function(e) {
  39794. return e.distanceToSquared(this.center) <= this.radius * this.radius
  39795. },
  39796. distanceToPoint: function(e) {
  39797. return e.distanceTo(this.center) - this.radius
  39798. },
  39799. intersectsSphere: function(e) {
  39800. var t = this.radius + e.radius;
  39801. return e.center.distanceToSquared(this.center) <= t * t
  39802. },
  39803. intersectsBox: function(e) {
  39804. return e.intersectsSphere(this)
  39805. },
  39806. intersectsPlane: function(e) {
  39807. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  39808. },
  39809. clampPoint: function(e, t) {
  39810. var i = this.center.distanceToSquared(e)
  39811. , n = t || new Ci.Vector3;
  39812. return n.copy(e),
  39813. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  39814. n.multiplyScalar(this.radius).add(this.center)),
  39815. n
  39816. },
  39817. getBoundingBox: function(e) {
  39818. var t = e || new Ci.Box3;
  39819. return t.set(this.center, this.center),
  39820. t.expandByScalar(this.radius),
  39821. t
  39822. },
  39823. applyMatrix4: function(e) {
  39824. return this.center.applyMatrix4(e),
  39825. this.radius = this.radius * e.getMaxScaleOnAxis(),
  39826. this
  39827. },
  39828. translate: function(e) {
  39829. return this.center.add(e),
  39830. this
  39831. },
  39832. equals: function(e) {
  39833. return e.center.equals(this.center) && e.radius === this.radius
  39834. }
  39835. },
  39836. Ci.Frustum = function(e, t, i, n, r, o) {
  39837. 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]
  39838. }
  39839. ,
  39840. Ci.Frustum.prototype = {
  39841. constructor: Ci.Frustum,
  39842. set: function(e, t, i, n, r, o) {
  39843. var a = this.planes;
  39844. return a[0].copy(e),
  39845. a[1].copy(t),
  39846. a[2].copy(i),
  39847. a[3].copy(n),
  39848. a[4].copy(r),
  39849. a[5].copy(o),
  39850. this
  39851. },
  39852. clone: function() {
  39853. return (new this.constructor).copy(this)
  39854. },
  39855. copy: function(e) {
  39856. for (var t = this.planes, i = 0; i < 6; i++)
  39857. t[i].copy(e.planes[i]);
  39858. return this
  39859. },
  39860. setFromMatrix: function(e) {
  39861. var t = this.planes
  39862. , i = e.elements
  39863. , n = i[0]
  39864. , r = i[1]
  39865. , o = i[2]
  39866. , a = i[3]
  39867. , s = i[4]
  39868. , l = i[5]
  39869. , c = i[6]
  39870. , h = i[7]
  39871. , u = i[8]
  39872. , d = i[9]
  39873. , p = i[10]
  39874. , f = i[11]
  39875. , g = i[12]
  39876. , m = i[13]
  39877. , v = i[14]
  39878. , y = i[15];
  39879. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  39880. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  39881. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  39882. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  39883. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  39884. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  39885. this
  39886. },
  39887. intersectsObject: (H = new Ci.Sphere,
  39888. function(e) {
  39889. var t = e.geometry;
  39890. return null === t.boundingSphere && t.computeBoundingSphere(),
  39891. H.copy(t.boundingSphere),
  39892. H.applyMatrix4(e.matrixWorld),
  39893. this.intersectsSphere(H)
  39894. }
  39895. ),
  39896. intersectsSphere: function(e) {
  39897. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  39898. if (t[r].distanceToPoint(i) < n)
  39899. return !1
  39900. }
  39901. return !0
  39902. },
  39903. intersectsBox: (k = new Ci.Vector3,
  39904. U = new Ci.Vector3,
  39905. function(e) {
  39906. for (var t = this.planes, i = 0; i < 6; i++) {
  39907. var n = t[i];
  39908. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  39909. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  39910. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  39911. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  39912. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  39913. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  39914. var r = n.distanceToPoint(k)
  39915. , o = n.distanceToPoint(U);
  39916. if (r < 0 && o < 0)
  39917. return !1
  39918. }
  39919. return !0
  39920. }
  39921. ),
  39922. containsPoint: function(e) {
  39923. for (var t = this.planes, i = 0; i < 6; i++)
  39924. if (t[i].distanceToPoint(e) < 0)
  39925. return !1;
  39926. return !0
  39927. }
  39928. },
  39929. Ci.Plane = function(e, t) {
  39930. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  39931. this.constant = void 0 !== t ? t : 0
  39932. }
  39933. ,
  39934. Ci.Plane.prototype = {
  39935. constructor: Ci.Plane,
  39936. set: function(e, t) {
  39937. return this.normal.copy(e),
  39938. this.constant = t,
  39939. this
  39940. },
  39941. setComponents: function(e, t, i, n) {
  39942. return this.normal.set(e, t, i),
  39943. this.constant = n,
  39944. this
  39945. },
  39946. setFromNormalAndCoplanarPoint: function(e, t) {
  39947. return this.normal.copy(e),
  39948. this.constant = -t.dot(this.normal),
  39949. this
  39950. },
  39951. setFromCoplanarPoints: (B = new Ci.Vector3,
  39952. V = new Ci.Vector3,
  39953. function(e, t, i) {
  39954. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  39955. return this.setFromNormalAndCoplanarPoint(n, e),
  39956. this
  39957. }
  39958. ),
  39959. clone: function() {
  39960. return (new this.constructor).copy(this)
  39961. },
  39962. copy: function(e) {
  39963. return this.normal.copy(e.normal),
  39964. this.constant = e.constant,
  39965. this
  39966. },
  39967. normalize: function() {
  39968. var e = 1 / this.normal.length();
  39969. return this.normal.multiplyScalar(e),
  39970. this.constant *= e,
  39971. this
  39972. },
  39973. negate: function() {
  39974. return this.constant *= -1,
  39975. this.normal.negate(),
  39976. this
  39977. },
  39978. distanceToPoint: function(e) {
  39979. return this.normal.dot(e) + this.constant
  39980. },
  39981. distanceToSphere: function(e) {
  39982. return this.distanceToPoint(e.center) - e.radius
  39983. },
  39984. projectPoint: function(e, t) {
  39985. return this.orthoPoint(e, t).sub(e).negate()
  39986. },
  39987. orthoPoint: function(e, t) {
  39988. var i = this.distanceToPoint(e);
  39989. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  39990. },
  39991. intersectLine: (F = new Ci.Vector3,
  39992. function(e, t) {
  39993. var i = t || new Ci.Vector3
  39994. , n = e.delta(F)
  39995. , r = this.normal.dot(n);
  39996. if (0 !== r) {
  39997. var o = -(e.start.dot(this.normal) + this.constant) / r;
  39998. if (!(o < 0 || 1 < o))
  39999. return i.copy(n).multiplyScalar(o).add(e.start)
  40000. } else if (0 === this.distanceToPoint(e.start))
  40001. return i.copy(e.start)
  40002. }
  40003. ),
  40004. intersectsLine: function(e) {
  40005. var t = this.distanceToPoint(e.start)
  40006. , i = this.distanceToPoint(e.end);
  40007. return t < 0 && 0 < i || i < 0 && 0 < t
  40008. },
  40009. intersectsBox: function(e) {
  40010. return e.intersectsPlane(this)
  40011. },
  40012. intersectsSphere: function(e) {
  40013. return e.intersectsPlane(this)
  40014. },
  40015. coplanarPoint: function(e) {
  40016. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40017. },
  40018. applyMatrix4: (L = new Ci.Vector3,
  40019. D = new Ci.Vector3,
  40020. N = new Ci.Matrix3,
  40021. function(e, t) {
  40022. var i = t || N.getNormalMatrix(e)
  40023. , n = L.copy(this.normal).applyMatrix3(i)
  40024. , r = this.coplanarPoint(D);
  40025. return r.applyMatrix4(e),
  40026. this.setFromNormalAndCoplanarPoint(n, r),
  40027. this
  40028. }
  40029. ),
  40030. translate: function(e) {
  40031. return this.constant = this.constant - e.dot(this.normal),
  40032. this
  40033. },
  40034. equals: function(e) {
  40035. return e.normal.equals(this.normal) && e.constant === this.constant
  40036. }
  40037. },
  40038. Ci.Spherical = function(e, t, i) {
  40039. return this.radius = void 0 !== e ? e : 1,
  40040. this.phi = void 0 !== t ? t : 0,
  40041. this.theta = void 0 !== i ? i : 0,
  40042. this
  40043. }
  40044. ,
  40045. Ci.Spherical.prototype = {
  40046. constructor: Ci.Spherical,
  40047. set: function(e, t, i) {
  40048. this.radius = e,
  40049. this.phi = t,
  40050. this.theta = i
  40051. },
  40052. clone: function() {
  40053. return (new this.constructor).copy(this)
  40054. },
  40055. copy: function(e) {
  40056. return this.radius.copy(e.radius),
  40057. this.phi.copy(e.phi),
  40058. this.theta.copy(e.theta),
  40059. this
  40060. },
  40061. makeSafe: function() {
  40062. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  40063. },
  40064. setFromVector3: function(e) {
  40065. return this.radius = e.length(),
  40066. 0 === this.radius ? (this.theta = 0,
  40067. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40068. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  40069. this
  40070. }
  40071. },
  40072. Ci.Math = {
  40073. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  40074. P = new Array(36),
  40075. O = 0,
  40076. function() {
  40077. for (var e = 0; e < 36; e++)
  40078. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  40079. M = 15 & O,
  40080. O >>= 4,
  40081. P[e] = R[19 === e ? 3 & M | 8 : M]);
  40082. return P.join("")
  40083. }
  40084. ),
  40085. clamp: function(e, t, i) {
  40086. return Math.max(t, Math.min(i, e))
  40087. },
  40088. euclideanModulo: function(e, t) {
  40089. return (e % t + t) % t
  40090. },
  40091. mapLinear: function(e, t, i, n, r) {
  40092. return n + (e - t) * (r - n) / (i - t)
  40093. },
  40094. smoothstep: function(e, t, i) {
  40095. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  40096. },
  40097. smootherstep: function(e, t, i) {
  40098. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  40099. },
  40100. random16: function() {
  40101. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40102. Math.random()
  40103. },
  40104. randInt: function(e, t) {
  40105. return e + Math.floor(Math.random() * (t - e + 1))
  40106. },
  40107. randFloat: function(e, t) {
  40108. return e + Math.random() * (t - e)
  40109. },
  40110. randFloatSpread: function(e) {
  40111. return e * (.5 - Math.random())
  40112. },
  40113. degToRad: (S = Math.PI / 180,
  40114. function(e) {
  40115. return e * S
  40116. }
  40117. ),
  40118. radToDeg: (x = 180 / Math.PI,
  40119. function(e) {
  40120. return e * x
  40121. }
  40122. ),
  40123. isPowerOfTwo: function(e) {
  40124. return 0 == (e & e - 1) && 0 !== e
  40125. },
  40126. nearestPowerOfTwo: function(e) {
  40127. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40128. },
  40129. nextPowerOfTwo: function(e) {
  40130. return e--,
  40131. e |= e >> 1,
  40132. e |= e >> 2,
  40133. e |= e >> 4,
  40134. e |= e >> 8,
  40135. e |= e >> 16,
  40136. ++e
  40137. }
  40138. },
  40139. Ci.Spline = function(e) {
  40140. function t(e, t, i, n, r, o, a) {
  40141. var s = .5 * (i - e)
  40142. , l = .5 * (n - t);
  40143. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40144. }
  40145. this.points = e;
  40146. var i, n, r, o, a, s, l, c, h, u = [], d = {
  40147. x: 0,
  40148. y: 0,
  40149. z: 0
  40150. };
  40151. this.initFromArray = function(e) {
  40152. this.points = [];
  40153. for (var t = 0; t < e.length; t++)
  40154. this.points[t] = {
  40155. x: e[t][0],
  40156. y: e[t][1],
  40157. z: e[t][2]
  40158. }
  40159. }
  40160. ,
  40161. this.getPoint = function(e) {
  40162. return i = (this.points.length - 1) * e,
  40163. n = Math.floor(i),
  40164. r = i - n,
  40165. u[0] = 0 === n ? n : n - 1,
  40166. u[1] = n,
  40167. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  40168. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  40169. s = this.points[u[0]],
  40170. l = this.points[u[1]],
  40171. c = this.points[u[2]],
  40172. h = this.points[u[3]],
  40173. a = r * (o = r * r),
  40174. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  40175. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  40176. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  40177. d
  40178. }
  40179. ,
  40180. this.getControlPointsArray = function() {
  40181. var e, t, i = this.points.length, n = [];
  40182. for (e = 0; e < i; e++)
  40183. t = this.points[e],
  40184. n[e] = [t.x, t.y, t.z];
  40185. return n
  40186. }
  40187. ,
  40188. this.getLength = function(e) {
  40189. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  40190. for (h[0] = 0,
  40191. e = e || 100,
  40192. n = this.points.length * e,
  40193. l.copy(this.points[0]),
  40194. t = 1; t < n; t++)
  40195. i = t / n,
  40196. r = this.getPoint(i),
  40197. c.copy(r),
  40198. u += c.distanceTo(l),
  40199. l.copy(r),
  40200. o = (this.points.length - 1) * i,
  40201. (a = Math.floor(o)) !== s && (h[a] = u,
  40202. s = a);
  40203. return h[h.length] = u,
  40204. {
  40205. chunks: h,
  40206. total: u
  40207. }
  40208. }
  40209. ,
  40210. this.reparametrizeByArcLength = function(e) {
  40211. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  40212. for (c.push(h.copy(this.points[0]).clone()),
  40213. t = 1; t < this.points.length; t++) {
  40214. for (a = u.chunks[t] - u.chunks[t - 1],
  40215. s = Math.ceil(e * a / u.total),
  40216. r = (t - 1) / (this.points.length - 1),
  40217. o = t / (this.points.length - 1),
  40218. i = 1; i < s - 1; i++)
  40219. n = r + i * (1 / s) * (o - r),
  40220. l = this.getPoint(n),
  40221. c.push(h.copy(l).clone());
  40222. c.push(h.copy(this.points[t]).clone())
  40223. }
  40224. this.points = c
  40225. }
  40226. }
  40227. ,
  40228. Ci.Triangle = function(e, t, i) {
  40229. this.a = void 0 !== e ? e : new Ci.Vector3,
  40230. this.b = void 0 !== t ? t : new Ci.Vector3,
  40231. this.c = void 0 !== i ? i : new Ci.Vector3
  40232. }
  40233. ,
  40234. Ci.Triangle.normal = (T = new Ci.Vector3,
  40235. function(e, t, i, n) {
  40236. var r = n || new Ci.Vector3;
  40237. r.subVectors(i, t),
  40238. T.subVectors(e, t),
  40239. r.cross(T);
  40240. var o = r.lengthSq();
  40241. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  40242. }
  40243. ),
  40244. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  40245. b = new Ci.Vector3,
  40246. w = new Ci.Vector3,
  40247. function(e, t, i, n, r) {
  40248. _.subVectors(n, t),
  40249. b.subVectors(i, t),
  40250. w.subVectors(e, t);
  40251. var o = _.dot(_)
  40252. , a = _.dot(b)
  40253. , s = _.dot(w)
  40254. , l = b.dot(b)
  40255. , c = b.dot(w)
  40256. , h = o * l - a * a
  40257. , u = r || new Ci.Vector3;
  40258. if (0 == h)
  40259. return u.set(-2, -1, -1);
  40260. var d = 1 / h
  40261. , p = (l * s - a * c) * d
  40262. , f = (o * c - a * s) * d;
  40263. return u.set(1 - p - f, f, p)
  40264. }
  40265. ),
  40266. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  40267. function(e, t, i, n) {
  40268. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  40269. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  40270. }
  40271. ),
  40272. Ci.Triangle.prototype = {
  40273. constructor: Ci.Triangle,
  40274. set: function(e, t, i) {
  40275. return this.a.copy(e),
  40276. this.b.copy(t),
  40277. this.c.copy(i),
  40278. this
  40279. },
  40280. setFromPointsAndIndices: function(e, t, i, n) {
  40281. return this.a.copy(e[t]),
  40282. this.b.copy(e[i]),
  40283. this.c.copy(e[n]),
  40284. this
  40285. },
  40286. clone: function() {
  40287. return (new this.constructor).copy(this)
  40288. },
  40289. copy: function(e) {
  40290. return this.a.copy(e.a),
  40291. this.b.copy(e.b),
  40292. this.c.copy(e.c),
  40293. this
  40294. },
  40295. area: (C = new Ci.Vector3,
  40296. I = new Ci.Vector3,
  40297. function() {
  40298. return C.subVectors(this.c, this.b),
  40299. I.subVectors(this.a, this.b),
  40300. .5 * C.cross(I).length()
  40301. }
  40302. ),
  40303. midpoint: function(e) {
  40304. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40305. },
  40306. normal: function(e) {
  40307. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  40308. },
  40309. plane: function(e) {
  40310. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  40311. },
  40312. barycoordFromPoint: function(e, t) {
  40313. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40314. },
  40315. containsPoint: function(e) {
  40316. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  40317. },
  40318. equals: function(e) {
  40319. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40320. }
  40321. },
  40322. Ci.Interpolant = function(e, t, i, n) {
  40323. this.parameterPositions = e,
  40324. this._cachedIndex = 0,
  40325. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40326. this.sampleValues = t,
  40327. this.valueSize = i
  40328. }
  40329. ,
  40330. Ci.Interpolant.prototype = {
  40331. constructor: Ci.Interpolant,
  40332. evaluate: function(e) {
  40333. var t = this.parameterPositions
  40334. , i = this._cachedIndex
  40335. , n = t[i]
  40336. , r = t[i - 1];
  40337. e: {
  40338. t: {
  40339. var o;
  40340. i: {
  40341. n: if (!(e < n)) {
  40342. for (var a = i + 2; ; ) {
  40343. if (void 0 === n) {
  40344. if (e < r)
  40345. break n;
  40346. return i = t.length,
  40347. this._cachedIndex = i,
  40348. this.afterEnd_(i - 1, e, r)
  40349. }
  40350. if (i === a)
  40351. break;
  40352. if (r = n,
  40353. e < (n = t[++i]))
  40354. break t
  40355. }
  40356. o = t.length;
  40357. break i
  40358. }
  40359. if (r <= e)
  40360. break e;
  40361. var s = t[1];
  40362. e < s && (i = 2,
  40363. r = s);
  40364. for (a = i - 2; ; ) {
  40365. if (void 0 === r)
  40366. return this._cachedIndex = 0,
  40367. this.beforeStart_(0, e, n);
  40368. if (i === a)
  40369. break;
  40370. if (n = r,
  40371. (r = t[--i - 1]) <= e)
  40372. break t
  40373. }
  40374. o = i,
  40375. i = 0
  40376. }
  40377. for (; i < o; ) {
  40378. var l = i + o >>> 1;
  40379. e < t[l] ? o = l : i = 1 + l
  40380. }
  40381. if (n = t[i],
  40382. void 0 === (r = t[i - 1]))
  40383. return this._cachedIndex = 0,
  40384. this.beforeStart_(0, e, n);
  40385. if (void 0 === n)
  40386. return i = t.length,
  40387. this._cachedIndex = i,
  40388. this.afterEnd_(i - 1, r, e)
  40389. }
  40390. this._cachedIndex = i,
  40391. this.intervalChanged_(i, r, n)
  40392. }
  40393. return this.interpolate_(i, r, e, n)
  40394. },
  40395. settings: null,
  40396. DefaultSettings_: {},
  40397. getSettings_: function() {
  40398. return this.settings || this.DefaultSettings_
  40399. },
  40400. copySampleValue_: function(e) {
  40401. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  40402. t[o] = i[r + o];
  40403. return t
  40404. },
  40405. interpolate_: function(e, t, i, n) {
  40406. throw new Error("call to abstract method")
  40407. },
  40408. intervalChanged_: function(e, t, i) {}
  40409. },
  40410. Object.assign(Ci.Interpolant.prototype, {
  40411. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  40412. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  40413. }),
  40414. Ci.CubicInterpolant = function(e, t, i, n) {
  40415. Ci.Interpolant.call(this, e, t, i, n),
  40416. this._weightPrev = -0,
  40417. this._offsetPrev = -0,
  40418. this._weightNext = -0,
  40419. this._offsetNext = -0
  40420. }
  40421. ,
  40422. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40423. constructor: Ci.CubicInterpolant,
  40424. DefaultSettings_: {
  40425. endingStart: Ci.ZeroCurvatureEnding,
  40426. endingEnd: Ci.ZeroCurvatureEnding
  40427. },
  40428. intervalChanged_: function(e, t, i) {
  40429. var n = this.parameterPositions
  40430. , r = e - 2
  40431. , o = e + 1
  40432. , a = n[r]
  40433. , s = n[o];
  40434. if (void 0 === a)
  40435. switch (this.getSettings_().endingStart) {
  40436. case Ci.ZeroSlopeEnding:
  40437. r = e,
  40438. a = 2 * t - i;
  40439. break;
  40440. case Ci.WrapAroundEnding:
  40441. a = t + n[r = n.length - 2] - n[r + 1];
  40442. break;
  40443. default:
  40444. r = e,
  40445. a = i
  40446. }
  40447. if (void 0 === s)
  40448. switch (this.getSettings_().endingEnd) {
  40449. case Ci.ZeroSlopeEnding:
  40450. o = e,
  40451. s = 2 * i - t;
  40452. break;
  40453. case Ci.WrapAroundEnding:
  40454. s = i + n[o = 1] - n[0];
  40455. break;
  40456. default:
  40457. o = e - 1,
  40458. s = t
  40459. }
  40460. var l = .5 * (i - t)
  40461. , c = this.valueSize;
  40462. this._weightPrev = l / (t - a),
  40463. this._weightNext = l / (s - i),
  40464. this._offsetPrev = r * c,
  40465. this._offsetNext = o * c
  40466. },
  40467. interpolate_: function(e, t, i, n) {
  40468. 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)
  40469. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  40470. return r
  40471. }
  40472. }),
  40473. Ci.DiscreteInterpolant = function(e, t, i, n) {
  40474. Ci.Interpolant.call(this, e, t, i, n)
  40475. }
  40476. ,
  40477. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40478. constructor: Ci.DiscreteInterpolant,
  40479. interpolate_: function(e, t, i, n) {
  40480. return this.copySampleValue_(e - 1)
  40481. }
  40482. }),
  40483. Ci.LinearInterpolant = function(e, t, i, n) {
  40484. Ci.Interpolant.call(this, e, t, i, n)
  40485. }
  40486. ,
  40487. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40488. constructor: Ci.LinearInterpolant,
  40489. interpolate_: function(e, t, i, n) {
  40490. 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)
  40491. r[u] = o[l + u] * h + o[s + u] * c;
  40492. return r
  40493. }
  40494. }),
  40495. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  40496. Ci.Interpolant.call(this, e, t, i, n)
  40497. }
  40498. ,
  40499. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40500. constructor: Ci.QuaternionLinearInterpolant,
  40501. interpolate_: function(e, t, i, n) {
  40502. 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)
  40503. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  40504. return r
  40505. }
  40506. }),
  40507. Ci.Clock = function(e) {
  40508. this.autoStart = void 0 === e || e,
  40509. this.startTime = 0,
  40510. this.oldTime = 0,
  40511. this.elapsedTime = 0,
  40512. this.running = !1
  40513. }
  40514. ,
  40515. Ci.Clock.prototype = {
  40516. constructor: Ci.Clock,
  40517. start: function() {
  40518. this.startTime = performance.now(),
  40519. this.oldTime = this.startTime,
  40520. this.running = !0
  40521. },
  40522. stop: function() {
  40523. this.getElapsedTime(),
  40524. this.running = !1
  40525. },
  40526. getElapsedTime: function() {
  40527. return this.getDelta(),
  40528. this.elapsedTime
  40529. },
  40530. getDelta: function() {
  40531. var e = 0;
  40532. if (this.autoStart && !this.running && this.start(),
  40533. this.running) {
  40534. var t = performance.now();
  40535. e = .001 * (t - this.oldTime),
  40536. this.oldTime = t,
  40537. this.elapsedTime += e
  40538. }
  40539. return e
  40540. }
  40541. },
  40542. Ci.EventDispatcher = function() {}
  40543. ,
  40544. Ci.EventDispatcher.prototype = {
  40545. constructor: Ci.EventDispatcher,
  40546. apply: function(e) {
  40547. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  40548. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  40549. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  40550. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  40551. },
  40552. addEventListener: function(e, t) {
  40553. void 0 === this._listeners && (this._listeners = {});
  40554. var i = this._listeners;
  40555. void 0 === i[e] && (i[e] = []),
  40556. -1 === i[e].indexOf(t) && i[e].push(t)
  40557. },
  40558. hasEventListener: function(e, t) {
  40559. if (void 0 === this._listeners)
  40560. return !1;
  40561. var i = this._listeners;
  40562. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  40563. },
  40564. removeEventListener: function(e, t) {
  40565. if (void 0 !== this._listeners) {
  40566. var i = this._listeners[e];
  40567. if (void 0 !== i) {
  40568. var n = i.indexOf(t);
  40569. -1 !== n && i.splice(n, 1)
  40570. }
  40571. }
  40572. },
  40573. dispatchEvent: function(e) {
  40574. if (void 0 !== this._listeners) {
  40575. var t = this._listeners[e.type];
  40576. if (void 0 !== t) {
  40577. e.target = this;
  40578. for (var i = [], n = t.length, r = 0; r < n; r++)
  40579. i[r] = t[r];
  40580. for (r = 0; r < n; r++)
  40581. i[r].call(this, e)
  40582. }
  40583. }
  40584. }
  40585. },
  40586. Ci.Layers = function() {
  40587. this.mask = 1
  40588. }
  40589. ,
  40590. Ci.Layers.prototype = {
  40591. constructor: Ci.Layers,
  40592. set: function(e) {
  40593. this.mask = 1 << e
  40594. },
  40595. enable: function(e) {
  40596. this.mask |= 1 << e
  40597. },
  40598. toggle: function(e) {
  40599. this.mask ^= 1 << e
  40600. },
  40601. disable: function(e) {
  40602. this.mask &= ~(1 << e)
  40603. },
  40604. test: function(e) {
  40605. return 0 != (this.mask & e.mask)
  40606. }
  40607. },
  40608. (A = Ci).Raycaster = function(e, t, i, n) {
  40609. this.ray = new A.Ray(e,t),
  40610. this.near = i || 0,
  40611. this.far = n || 1 / 0,
  40612. this.params = {
  40613. Mesh: {},
  40614. Line: {},
  40615. LOD: {},
  40616. Points: {
  40617. threshold: 1
  40618. },
  40619. Sprite: {}
  40620. },
  40621. Object.defineProperties(this.params, {
  40622. PointCloud: {
  40623. get: function() {
  40624. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  40625. this.Points
  40626. }
  40627. }
  40628. })
  40629. }
  40630. ,
  40631. A.Raycaster.prototype = {
  40632. constructor: A.Raycaster,
  40633. linePrecision: 1,
  40634. set: function(e, t) {
  40635. this.ray.set(e, t)
  40636. },
  40637. setFromCamera: function(e, t) {
  40638. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  40639. 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),
  40640. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  40641. },
  40642. intersectObject: function(e, t) {
  40643. var i = [];
  40644. return Ei(e, this, i, t),
  40645. i.sort(Ii),
  40646. i
  40647. },
  40648. intersectObjects: function(e, t) {
  40649. var i = [];
  40650. if (!1 === Array.isArray(e))
  40651. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  40652. i;
  40653. for (var n = 0, r = e.length; n < r; n++)
  40654. Ei(e[n], this, i, t);
  40655. return i.sort(Ii),
  40656. i
  40657. }
  40658. },
  40659. Ci.Object3D = function() {
  40660. Object.defineProperty(this, "id", {
  40661. value: Ci.Object3DIdCount++
  40662. }),
  40663. this.uuid = Ci.Math.generateUUID(),
  40664. this.name = "",
  40665. this.type = "Object3D",
  40666. this.parent = null,
  40667. this.children = [],
  40668. this.up = Ci.Object3D.DefaultUp.clone();
  40669. var e = new Ci.Vector3
  40670. , t = new Ci.Euler
  40671. , i = new Ci.Quaternion
  40672. , n = new Ci.Vector3(1,1,1);
  40673. t.onChange(function() {
  40674. i.setFromEuler(t, !1)
  40675. }),
  40676. i.onChange(function() {
  40677. t.setFromQuaternion(i, void 0, !1)
  40678. }),
  40679. Object.defineProperties(this, {
  40680. position: {
  40681. enumerable: !0,
  40682. value: e
  40683. },
  40684. rotation: {
  40685. enumerable: !0,
  40686. value: t
  40687. },
  40688. quaternion: {
  40689. enumerable: !0,
  40690. value: i
  40691. },
  40692. scale: {
  40693. enumerable: !0,
  40694. value: n
  40695. },
  40696. modelViewMatrix: {
  40697. value: new Ci.Matrix4
  40698. },
  40699. normalMatrix: {
  40700. value: new Ci.Matrix3
  40701. }
  40702. }),
  40703. this.rotationAutoUpdate = !0,
  40704. this.matrix = new Ci.Matrix4,
  40705. this.matrixWorld = new Ci.Matrix4,
  40706. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  40707. this.matrixWorldNeedsUpdate = !1,
  40708. this.layers = new Ci.Layers,
  40709. this.visible = !0,
  40710. this.castShadow = !1,
  40711. this.receiveShadow = !1,
  40712. this.frustumCulled = !0,
  40713. this.renderOrder = 0,
  40714. this.userData = {}
  40715. }
  40716. ,
  40717. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  40718. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  40719. Ci.Object3D.prototype = {
  40720. constructor: Ci.Object3D,
  40721. applyMatrix: function(e) {
  40722. this.matrix.multiplyMatrices(e, this.matrix),
  40723. this.matrix.decompose(this.position, this.quaternion, this.scale)
  40724. },
  40725. setRotationFromAxisAngle: function(e, t) {
  40726. this.quaternion.setFromAxisAngle(e, t)
  40727. },
  40728. setRotationFromEuler: function(e) {
  40729. this.quaternion.setFromEuler(e, !0)
  40730. },
  40731. setRotationFromMatrix: function(e) {
  40732. this.quaternion.setFromRotationMatrix(e)
  40733. },
  40734. setRotationFromQuaternion: function(e) {
  40735. this.quaternion.copy(e)
  40736. },
  40737. rotateOnAxis: (y = new Ci.Quaternion,
  40738. function(e, t) {
  40739. return y.setFromAxisAngle(e, t),
  40740. this.quaternion.multiply(y),
  40741. this
  40742. }
  40743. ),
  40744. rotateX: (v = new Ci.Vector3(1,0,0),
  40745. function(e) {
  40746. return this.rotateOnAxis(v, e)
  40747. }
  40748. ),
  40749. rotateY: (m = new Ci.Vector3(0,1,0),
  40750. function(e) {
  40751. return this.rotateOnAxis(m, e)
  40752. }
  40753. ),
  40754. rotateZ: (g = new Ci.Vector3(0,0,1),
  40755. function(e) {
  40756. return this.rotateOnAxis(g, e)
  40757. }
  40758. ),
  40759. translateOnAxis: (f = new Ci.Vector3,
  40760. function(e, t) {
  40761. return f.copy(e).applyQuaternion(this.quaternion),
  40762. this.position.add(f.multiplyScalar(t)),
  40763. this
  40764. }
  40765. ),
  40766. translateX: (p = new Ci.Vector3(1,0,0),
  40767. function(e) {
  40768. return this.translateOnAxis(p, e)
  40769. }
  40770. ),
  40771. translateY: (d = new Ci.Vector3(0,1,0),
  40772. function(e) {
  40773. return this.translateOnAxis(d, e)
  40774. }
  40775. ),
  40776. translateZ: (u = new Ci.Vector3(0,0,1),
  40777. function(e) {
  40778. return this.translateOnAxis(u, e)
  40779. }
  40780. ),
  40781. localToWorld: function(e) {
  40782. return e.applyMatrix4(this.matrixWorld)
  40783. },
  40784. worldToLocal: (h = new Ci.Matrix4,
  40785. function(e) {
  40786. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  40787. }
  40788. ),
  40789. lookAt: (c = new Ci.Matrix4,
  40790. function(e) {
  40791. c.lookAt(e, this.position, this.up),
  40792. this.quaternion.setFromRotationMatrix(c)
  40793. }
  40794. ),
  40795. add: function(e) {
  40796. if (1 < arguments.length) {
  40797. for (var t = 0; t < arguments.length; t++)
  40798. this.add(arguments[t]);
  40799. return this
  40800. }
  40801. 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),
  40802. e.parent = this,
  40803. e.dispatchEvent({
  40804. type: "added"
  40805. }),
  40806. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  40807. this
  40808. },
  40809. remove: function(e) {
  40810. if (1 < arguments.length)
  40811. for (var t = 0; t < arguments.length; t++)
  40812. this.remove(arguments[t]);
  40813. var i = this.children.indexOf(e);
  40814. -1 !== i && (e.parent = null,
  40815. e.dispatchEvent({
  40816. type: "removed"
  40817. }),
  40818. this.children.splice(i, 1))
  40819. },
  40820. getObjectById: function(e) {
  40821. return this.getObjectByProperty("id", e)
  40822. },
  40823. getObjectByName: function(e) {
  40824. return this.getObjectByProperty("name", e)
  40825. },
  40826. getObjectByProperty: function(e, t) {
  40827. if (this[e] === t)
  40828. return this;
  40829. for (var i = 0, n = this.children.length; i < n; i++) {
  40830. var r = this.children[i].getObjectByProperty(e, t);
  40831. if (void 0 !== r)
  40832. return r
  40833. }
  40834. },
  40835. getWorldPosition: function(e) {
  40836. var t = e || new Ci.Vector3;
  40837. return this.updateMatrixWorld(!0),
  40838. t.setFromMatrixPosition(this.matrixWorld)
  40839. },
  40840. getWorldQuaternion: (s = new Ci.Vector3,
  40841. l = new Ci.Vector3,
  40842. function(e) {
  40843. var t = e || new Ci.Quaternion;
  40844. return this.updateMatrixWorld(!0),
  40845. this.matrixWorld.decompose(s, t, l),
  40846. t
  40847. }
  40848. ),
  40849. getWorldRotation: (a = new Ci.Quaternion,
  40850. function(e) {
  40851. var t = e || new Ci.Euler;
  40852. return this.getWorldQuaternion(a),
  40853. t.setFromQuaternion(a, this.rotation.order, !1)
  40854. }
  40855. ),
  40856. getWorldScale: (r = new Ci.Vector3,
  40857. o = new Ci.Quaternion,
  40858. function(e) {
  40859. var t = e || new Ci.Vector3;
  40860. return this.updateMatrixWorld(!0),
  40861. this.matrixWorld.decompose(r, o, t),
  40862. t
  40863. }
  40864. ),
  40865. getWorldDirection: (n = new Ci.Quaternion,
  40866. function(e) {
  40867. var t = e || new Ci.Vector3;
  40868. return this.getWorldQuaternion(n),
  40869. t.set(0, 0, 1).applyQuaternion(n)
  40870. }
  40871. ),
  40872. raycast: function() {},
  40873. traverse: function(e) {
  40874. e(this);
  40875. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  40876. t[i].traverse(e)
  40877. },
  40878. traverseVisible: function(e) {
  40879. if (!1 !== this.visible) {
  40880. e(this);
  40881. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  40882. t[i].traverseVisible(e)
  40883. }
  40884. },
  40885. traverseAncestors: function(e) {
  40886. var t = this.parent;
  40887. null !== t && (e(t),
  40888. t.traverseAncestors(e))
  40889. },
  40890. updateMatrix: function() {
  40891. this.matrix.compose(this.position, this.quaternion, this.scale),
  40892. this.matrixWorldNeedsUpdate = !0
  40893. },
  40894. updateMatrixWorld: function(e) {
  40895. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  40896. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  40897. e = !(this.matrixWorldNeedsUpdate = !1));
  40898. for (var t = 0, i = this.children.length; t < i; t++)
  40899. this.children[t].updateMatrixWorld(e)
  40900. },
  40901. toJSON: function(e) {
  40902. function t(e) {
  40903. var t = [];
  40904. for (var i in e) {
  40905. var n = e[i];
  40906. delete n.metadata,
  40907. t.push(n)
  40908. }
  40909. return t
  40910. }
  40911. var i = void 0 === e
  40912. , n = {};
  40913. i && (e = {
  40914. geometries: {},
  40915. materials: {},
  40916. textures: {},
  40917. images: {}
  40918. },
  40919. n.metadata = {
  40920. version: 4.4,
  40921. type: "Object",
  40922. generator: "Object3D.toJSON"
  40923. });
  40924. var r = {};
  40925. if (r.uuid = this.uuid,
  40926. r.type = this.type,
  40927. "" !== this.name && (r.name = this.name),
  40928. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  40929. !0 === this.castShadow && (r.castShadow = !0),
  40930. !0 === this.receiveShadow && (r.receiveShadow = !0),
  40931. !1 === this.visible && (r.visible = !1),
  40932. r.matrix = this.matrix.toArray(),
  40933. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  40934. r.geometry = this.geometry.uuid),
  40935. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  40936. r.material = this.material.uuid),
  40937. 0 < this.children.length) {
  40938. r.children = [];
  40939. for (var o = 0; o < this.children.length; o++)
  40940. r.children.push(this.children[o].toJSON(e).object)
  40941. }
  40942. if (i) {
  40943. var a = t(e.geometries)
  40944. , s = t(e.materials)
  40945. , l = t(e.textures)
  40946. , c = t(e.images);
  40947. 0 < a.length && (n.geometries = a),
  40948. 0 < s.length && (n.materials = s),
  40949. 0 < l.length && (n.textures = l),
  40950. 0 < c.length && (n.images = c)
  40951. }
  40952. return n.object = r,
  40953. n
  40954. },
  40955. clone: function(e) {
  40956. return (new this.constructor).copy(this, e)
  40957. },
  40958. copy: function(e, t) {
  40959. if (void 0 === t && (t = !0),
  40960. this.name = e.name,
  40961. this.up.copy(e.up),
  40962. this.position.copy(e.position),
  40963. this.quaternion.copy(e.quaternion),
  40964. this.scale.copy(e.scale),
  40965. this.rotationAutoUpdate = e.rotationAutoUpdate,
  40966. this.matrix.copy(e.matrix),
  40967. this.matrixWorld.copy(e.matrixWorld),
  40968. this.matrixAutoUpdate = e.matrixAutoUpdate,
  40969. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  40970. this.visible = e.visible,
  40971. this.castShadow = e.castShadow,
  40972. this.receiveShadow = e.receiveShadow,
  40973. this.frustumCulled = e.frustumCulled,
  40974. this.renderOrder = e.renderOrder,
  40975. this.userData = JSON.parse(JSON.stringify(e.userData)),
  40976. !0 === t)
  40977. for (var i = 0; i < e.children.length; i++) {
  40978. var n = e.children[i];
  40979. this.add(n.clone())
  40980. }
  40981. return this
  40982. }
  40983. },
  40984. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  40985. Ci.Object3DIdCount = 0,
  40986. Ci.Face3 = function(e, t, i, n, r, o) {
  40987. this.a = e,
  40988. this.b = t,
  40989. this.c = i,
  40990. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  40991. this.vertexNormals = Array.isArray(n) ? n : [],
  40992. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  40993. this.vertexColors = Array.isArray(r) ? r : [],
  40994. this.materialIndex = void 0 !== o ? o : 0
  40995. }
  40996. ,
  40997. Ci.Face3.prototype = {
  40998. constructor: Ci.Face3,
  40999. clone: function() {
  41000. return (new this.constructor).copy(this)
  41001. },
  41002. copy: function(e) {
  41003. this.a = e.a,
  41004. this.b = e.b,
  41005. this.c = e.c,
  41006. this.normal.copy(e.normal),
  41007. this.color.copy(e.color),
  41008. this.materialIndex = e.materialIndex;
  41009. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41010. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41011. for (t = 0,
  41012. i = e.vertexColors.length; t < i; t++)
  41013. this.vertexColors[t] = e.vertexColors[t].clone();
  41014. return this
  41015. }
  41016. },
  41017. Ci.BufferAttribute = function(e, t) {
  41018. this.uuid = Ci.Math.generateUUID(),
  41019. this.array = e,
  41020. this.itemSize = t,
  41021. this.dynamic = !1,
  41022. this.updateRange = {
  41023. offset: 0,
  41024. count: -1
  41025. },
  41026. this.version = 0
  41027. }
  41028. ,
  41029. Ci.BufferAttribute.prototype = {
  41030. constructor: Ci.BufferAttribute,
  41031. get count() {
  41032. return this.array.length / this.itemSize
  41033. },
  41034. set needsUpdate(e) {
  41035. !0 === e && this.version++
  41036. },
  41037. setDynamic: function(e) {
  41038. return this.dynamic = e,
  41039. this
  41040. },
  41041. copy: function(e) {
  41042. return this.array = new e.array.constructor(e.array),
  41043. this.itemSize = e.itemSize,
  41044. this.dynamic = e.dynamic,
  41045. this
  41046. },
  41047. copyAt: function(e, t, i) {
  41048. e *= this.itemSize,
  41049. i *= t.itemSize;
  41050. for (var n = 0, r = this.itemSize; n < r; n++)
  41051. this.array[e + n] = t.array[i + n];
  41052. return this
  41053. },
  41054. copyArray: function(e) {
  41055. return this.array.set(e),
  41056. this
  41057. },
  41058. copyColorsArray: function(e) {
  41059. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41060. var o = e[n];
  41061. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  41062. o = new Ci.Color),
  41063. t[i++] = o.r,
  41064. t[i++] = o.g,
  41065. t[i++] = o.b
  41066. }
  41067. return this
  41068. },
  41069. copyIndicesArray: function(e) {
  41070. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41071. var o = e[n];
  41072. t[i++] = o.a,
  41073. t[i++] = o.b,
  41074. t[i++] = o.c
  41075. }
  41076. return this
  41077. },
  41078. copyVector2sArray: function(e) {
  41079. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41080. var o = e[n];
  41081. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  41082. o = new Ci.Vector2),
  41083. t[i++] = o.x,
  41084. t[i++] = o.y
  41085. }
  41086. return this
  41087. },
  41088. copyVector3sArray: function(e) {
  41089. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41090. var o = e[n];
  41091. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  41092. o = new Ci.Vector3),
  41093. t[i++] = o.x,
  41094. t[i++] = o.y,
  41095. t[i++] = o.z
  41096. }
  41097. return this
  41098. },
  41099. copyVector4sArray: function(e) {
  41100. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41101. var o = e[n];
  41102. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  41103. o = new Ci.Vector4),
  41104. t[i++] = o.x,
  41105. t[i++] = o.y,
  41106. t[i++] = o.z,
  41107. t[i++] = o.w
  41108. }
  41109. return this
  41110. },
  41111. set: function(e, t) {
  41112. return void 0 === t && (t = 0),
  41113. this.array.set(e, t),
  41114. this
  41115. },
  41116. getX: function(e) {
  41117. return this.array[e * this.itemSize]
  41118. },
  41119. setX: function(e, t) {
  41120. return this.array[e * this.itemSize] = t,
  41121. this
  41122. },
  41123. getY: function(e) {
  41124. return this.array[e * this.itemSize + 1]
  41125. },
  41126. setY: function(e, t) {
  41127. return this.array[e * this.itemSize + 1] = t,
  41128. this
  41129. },
  41130. getZ: function(e) {
  41131. return this.array[e * this.itemSize + 2]
  41132. },
  41133. setZ: function(e, t) {
  41134. return this.array[e * this.itemSize + 2] = t,
  41135. this
  41136. },
  41137. getW: function(e) {
  41138. return this.array[e * this.itemSize + 3]
  41139. },
  41140. setW: function(e, t) {
  41141. return this.array[e * this.itemSize + 3] = t,
  41142. this
  41143. },
  41144. setXY: function(e, t, i) {
  41145. return e *= this.itemSize,
  41146. this.array[e + 0] = t,
  41147. this.array[e + 1] = i,
  41148. this
  41149. },
  41150. setXYZ: function(e, t, i, n) {
  41151. return e *= this.itemSize,
  41152. this.array[e + 0] = t,
  41153. this.array[e + 1] = i,
  41154. this.array[e + 2] = n,
  41155. this
  41156. },
  41157. setXYZW: function(e, t, i, n, r) {
  41158. return e *= this.itemSize,
  41159. this.array[e + 0] = t,
  41160. this.array[e + 1] = i,
  41161. this.array[e + 2] = n,
  41162. this.array[e + 3] = r,
  41163. this
  41164. },
  41165. clone: function() {
  41166. return (new this.constructor).copy(this)
  41167. }
  41168. },
  41169. Ci.Int8Attribute = function(e, t) {
  41170. return new Ci.BufferAttribute(new Int8Array(e),t)
  41171. }
  41172. ,
  41173. Ci.Uint8Attribute = function(e, t) {
  41174. return new Ci.BufferAttribute(new Uint8Array(e),t)
  41175. }
  41176. ,
  41177. Ci.Uint8ClampedAttribute = function(e, t) {
  41178. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  41179. }
  41180. ,
  41181. Ci.Int16Attribute = function(e, t) {
  41182. return new Ci.BufferAttribute(new Int16Array(e),t)
  41183. }
  41184. ,
  41185. Ci.Uint16Attribute = function(e, t) {
  41186. return new Ci.BufferAttribute(new Uint16Array(e),t)
  41187. }
  41188. ,
  41189. Ci.Int32Attribute = function(e, t) {
  41190. return new Ci.BufferAttribute(new Int32Array(e),t)
  41191. }
  41192. ,
  41193. Ci.Uint32Attribute = function(e, t) {
  41194. return new Ci.BufferAttribute(new Uint32Array(e),t)
  41195. }
  41196. ,
  41197. Ci.Float32Attribute = function(e, t) {
  41198. return new Ci.BufferAttribute(new Float32Array(e),t)
  41199. }
  41200. ,
  41201. Ci.Float64Attribute = function(e, t) {
  41202. return new Ci.BufferAttribute(new Float64Array(e),t)
  41203. }
  41204. ,
  41205. Ci.DynamicBufferAttribute = function(e, t) {
  41206. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41207. new Ci.BufferAttribute(e,t).setDynamic(!0)
  41208. }
  41209. ,
  41210. Ci.InstancedBufferAttribute = function(e, t, i) {
  41211. Ci.BufferAttribute.call(this, e, t),
  41212. this.meshPerAttribute = i || 1
  41213. }
  41214. ,
  41215. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  41216. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  41217. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  41218. return Ci.BufferAttribute.prototype.copy.call(this, e),
  41219. this.meshPerAttribute = e.meshPerAttribute,
  41220. this
  41221. }
  41222. ,
  41223. Ci.InterleavedBuffer = function(e, t) {
  41224. this.uuid = Ci.Math.generateUUID(),
  41225. this.array = e,
  41226. this.stride = t,
  41227. this.dynamic = !1,
  41228. this.updateRange = {
  41229. offset: 0,
  41230. count: -1
  41231. },
  41232. this.version = 0
  41233. }
  41234. ,
  41235. Ci.InterleavedBuffer.prototype = {
  41236. constructor: Ci.InterleavedBuffer,
  41237. get length() {
  41238. return this.array.length
  41239. },
  41240. get count() {
  41241. return this.array.length / this.stride
  41242. },
  41243. set needsUpdate(e) {
  41244. !0 === e && this.version++
  41245. },
  41246. setDynamic: function(e) {
  41247. return this.dynamic = e,
  41248. this
  41249. },
  41250. copy: function(e) {
  41251. return this.array = new e.array.constructor(e.array),
  41252. this.stride = e.stride,
  41253. this.dynamic = e.dynamic,
  41254. this
  41255. },
  41256. copyAt: function(e, t, i) {
  41257. e *= this.stride,
  41258. i *= t.stride;
  41259. for (var n = 0, r = this.stride; n < r; n++)
  41260. this.array[e + n] = t.array[i + n];
  41261. return this
  41262. },
  41263. set: function(e, t) {
  41264. return void 0 === t && (t = 0),
  41265. this.array.set(e, t),
  41266. this
  41267. },
  41268. clone: function() {
  41269. return (new this.constructor).copy(this)
  41270. }
  41271. },
  41272. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  41273. Ci.InterleavedBuffer.call(this, e, t),
  41274. this.meshPerAttribute = i || 1
  41275. }
  41276. ,
  41277. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  41278. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  41279. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41280. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  41281. this.meshPerAttribute = e.meshPerAttribute,
  41282. this
  41283. }
  41284. ,
  41285. Ci.InterleavedBufferAttribute = function(e, t, i) {
  41286. this.uuid = Ci.Math.generateUUID(),
  41287. this.data = e,
  41288. this.itemSize = t,
  41289. this.offset = i
  41290. }
  41291. ,
  41292. Ci.InterleavedBufferAttribute.prototype = {
  41293. constructor: Ci.InterleavedBufferAttribute,
  41294. get length() {
  41295. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41296. this.array.length
  41297. },
  41298. get count() {
  41299. return this.data.count
  41300. },
  41301. setX: function(e, t) {
  41302. return this.data.array[e * this.data.stride + this.offset] = t,
  41303. this
  41304. },
  41305. setY: function(e, t) {
  41306. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41307. this
  41308. },
  41309. setZ: function(e, t) {
  41310. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41311. this
  41312. },
  41313. setW: function(e, t) {
  41314. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41315. this
  41316. },
  41317. getX: function(e) {
  41318. return this.data.array[e * this.data.stride + this.offset]
  41319. },
  41320. getY: function(e) {
  41321. return this.data.array[e * this.data.stride + this.offset + 1]
  41322. },
  41323. getZ: function(e) {
  41324. return this.data.array[e * this.data.stride + this.offset + 2]
  41325. },
  41326. getW: function(e) {
  41327. return this.data.array[e * this.data.stride + this.offset + 3]
  41328. },
  41329. setXY: function(e, t, i) {
  41330. return e = e * this.data.stride + this.offset,
  41331. this.data.array[e + 0] = t,
  41332. this.data.array[e + 1] = i,
  41333. this
  41334. },
  41335. setXYZ: function(e, t, i, n) {
  41336. return e = e * this.data.stride + this.offset,
  41337. this.data.array[e + 0] = t,
  41338. this.data.array[e + 1] = i,
  41339. this.data.array[e + 2] = n,
  41340. this
  41341. },
  41342. setXYZW: function(e, t, i, n, r) {
  41343. return e = e * this.data.stride + this.offset,
  41344. this.data.array[e + 0] = t,
  41345. this.data.array[e + 1] = i,
  41346. this.data.array[e + 2] = n,
  41347. this.data.array[e + 3] = r,
  41348. this
  41349. }
  41350. },
  41351. Ci.Geometry = function() {
  41352. Object.defineProperty(this, "id", {
  41353. value: Ci.GeometryIdCount++
  41354. }),
  41355. this.uuid = Ci.Math.generateUUID(),
  41356. this.name = "",
  41357. this.type = "Geometry",
  41358. this.vertices = [],
  41359. this.colors = [],
  41360. this.faces = [],
  41361. this.faceVertexUvs = [[]],
  41362. this.morphTargets = [],
  41363. this.morphNormals = [],
  41364. this.skinWeights = [],
  41365. this.skinIndices = [],
  41366. this.lineDistances = [],
  41367. this.boundingBox = null,
  41368. this.boundingSphere = null,
  41369. this.verticesNeedUpdate = !1,
  41370. this.elementsNeedUpdate = !1,
  41371. this.uvsNeedUpdate = !1,
  41372. this.normalsNeedUpdate = !1,
  41373. this.colorsNeedUpdate = !1,
  41374. this.lineDistancesNeedUpdate = !1,
  41375. this.groupsNeedUpdate = !1
  41376. }
  41377. ,
  41378. Ci.Geometry.prototype = {
  41379. constructor: Ci.Geometry,
  41380. applyMatrix: function(e) {
  41381. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  41382. this.vertices[i].applyMatrix4(e)
  41383. }
  41384. for (i = 0,
  41385. n = this.faces.length; i < n; i++) {
  41386. var r = this.faces[i];
  41387. r.normal.applyMatrix3(t).normalize();
  41388. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  41389. r.vertexNormals[o].applyMatrix3(t).normalize()
  41390. }
  41391. return null !== this.boundingBox && this.computeBoundingBox(),
  41392. null !== this.boundingSphere && this.computeBoundingSphere(),
  41393. this.verticesNeedUpdate = !0,
  41394. this.normalsNeedUpdate = !0,
  41395. this
  41396. },
  41397. rotateX: function(e) {
  41398. return void 0 === mt && (mt = new Ci.Matrix4),
  41399. mt.makeRotationX(e),
  41400. this.applyMatrix(mt),
  41401. this
  41402. },
  41403. rotateY: function(e) {
  41404. return void 0 === gt && (gt = new Ci.Matrix4),
  41405. gt.makeRotationY(e),
  41406. this.applyMatrix(gt),
  41407. this
  41408. },
  41409. rotateZ: function(e) {
  41410. return void 0 === ft && (ft = new Ci.Matrix4),
  41411. ft.makeRotationZ(e),
  41412. this.applyMatrix(ft),
  41413. this
  41414. },
  41415. translate: function(e, t, i) {
  41416. return void 0 === pt && (pt = new Ci.Matrix4),
  41417. pt.makeTranslation(e, t, i),
  41418. this.applyMatrix(pt),
  41419. this
  41420. },
  41421. scale: function(e, t, i) {
  41422. return void 0 === dt && (dt = new Ci.Matrix4),
  41423. dt.makeScale(e, t, i),
  41424. this.applyMatrix(dt),
  41425. this
  41426. },
  41427. lookAt: function(e) {
  41428. void 0 === ut && (ut = new Ci.Object3D),
  41429. ut.lookAt(e),
  41430. ut.updateMatrix(),
  41431. this.applyMatrix(ut.matrix)
  41432. },
  41433. fromBufferGeometry: function(e) {
  41434. function t(e, t, i, n) {
  41435. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  41436. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  41437. , a = new Ci.Face3(e,t,i,r,o,n);
  41438. s.faces.push(a),
  41439. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  41440. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  41441. }
  41442. var s = this
  41443. , i = null !== e.index ? e.index.array : void 0
  41444. , n = e.attributes
  41445. , r = n.position.array
  41446. , l = void 0 !== n.normal ? n.normal.array : void 0
  41447. , c = void 0 !== n.color ? n.color.array : void 0
  41448. , h = void 0 !== n.uv ? n.uv.array : void 0
  41449. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  41450. void 0 !== u && (this.faceVertexUvs[1] = []);
  41451. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  41452. a += 2)
  41453. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  41454. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  41455. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  41456. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  41457. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  41458. if (void 0 !== i) {
  41459. var g = e.groups;
  41460. if (0 < g.length)
  41461. for (o = 0; o < g.length; o++)
  41462. for (var m = g[o], v = m.start, y = (a = v,
  41463. v + m.count); a < y; a += 3)
  41464. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  41465. else
  41466. for (o = 0; o < i.length; o += 3)
  41467. t(i[o], i[o + 1], i[o + 2])
  41468. } else
  41469. for (o = 0; o < r.length / 3; o += 3)
  41470. t(o, o + 1, o + 2);
  41471. return this.computeFaceNormals(),
  41472. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  41473. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  41474. this
  41475. },
  41476. center: function() {
  41477. this.computeBoundingBox();
  41478. var e = this.boundingBox.center().negate();
  41479. return this.translate(e.x, e.y, e.z),
  41480. e
  41481. },
  41482. normalize: function() {
  41483. this.computeBoundingSphere();
  41484. var e = this.boundingSphere.center
  41485. , t = this.boundingSphere.radius
  41486. , i = 0 === t ? 1 : 1 / t
  41487. , n = new Ci.Matrix4;
  41488. 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),
  41489. this.applyMatrix(n),
  41490. this
  41491. },
  41492. computeFaceNormals: function() {
  41493. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  41494. var r = this.faces[i]
  41495. , o = this.vertices[r.a]
  41496. , a = this.vertices[r.b]
  41497. , s = this.vertices[r.c];
  41498. e.subVectors(s, a),
  41499. t.subVectors(o, a),
  41500. e.cross(t),
  41501. e.normalize(),
  41502. r.normal.copy(e)
  41503. }
  41504. },
  41505. computeVertexNormals: function(e) {
  41506. var t, i, n, r, o, a;
  41507. for (void 0 === e && (e = !0),
  41508. a = new Array(this.vertices.length),
  41509. t = 0,
  41510. i = this.vertices.length; t < i; t++)
  41511. a[t] = new Ci.Vector3;
  41512. if (e) {
  41513. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  41514. for (n = 0,
  41515. r = this.faces.length; n < r; n++)
  41516. o = this.faces[n],
  41517. s = this.vertices[o.a],
  41518. l = this.vertices[o.b],
  41519. c = this.vertices[o.c],
  41520. h.subVectors(c, l),
  41521. u.subVectors(s, l),
  41522. h.cross(u),
  41523. a[o.a].add(h),
  41524. a[o.b].add(h),
  41525. a[o.c].add(h)
  41526. } else
  41527. for (n = 0,
  41528. r = this.faces.length; n < r; n++)
  41529. a[(o = this.faces[n]).a].add(o.normal),
  41530. a[o.b].add(o.normal),
  41531. a[o.c].add(o.normal);
  41532. for (t = 0,
  41533. i = this.vertices.length; t < i; t++)
  41534. a[t].normalize();
  41535. for (n = 0,
  41536. r = this.faces.length; n < r; n++) {
  41537. var d = (o = this.faces[n]).vertexNormals;
  41538. 3 === d.length ? (d[0].copy(a[o.a]),
  41539. d[1].copy(a[o.b]),
  41540. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  41541. d[1] = a[o.b].clone(),
  41542. d[2] = a[o.c].clone())
  41543. }
  41544. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  41545. },
  41546. computeMorphNormals: function() {
  41547. var e, t, i, n, r;
  41548. for (i = 0,
  41549. n = this.faces.length; i < n; i++)
  41550. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  41551. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  41552. e = 0,
  41553. t = r.vertexNormals.length; e < t; e++)
  41554. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  41555. var o = new Ci.Geometry;
  41556. for (o.faces = this.faces,
  41557. e = 0,
  41558. t = this.morphTargets.length; e < t; e++) {
  41559. if (!this.morphNormals[e]) {
  41560. this.morphNormals[e] = {},
  41561. this.morphNormals[e].faceNormals = [],
  41562. this.morphNormals[e].vertexNormals = [];
  41563. var a = this.morphNormals[e].faceNormals
  41564. , s = this.morphNormals[e].vertexNormals;
  41565. for (i = 0,
  41566. n = this.faces.length; i < n; i++)
  41567. l = new Ci.Vector3,
  41568. c = {
  41569. a: new Ci.Vector3,
  41570. b: new Ci.Vector3,
  41571. c: new Ci.Vector3
  41572. },
  41573. a.push(l),
  41574. s.push(c)
  41575. }
  41576. var l, c, h = this.morphNormals[e];
  41577. for (o.vertices = this.morphTargets[e].vertices,
  41578. o.computeFaceNormals(),
  41579. o.computeVertexNormals(),
  41580. i = 0,
  41581. n = this.faces.length; i < n; i++)
  41582. r = this.faces[i],
  41583. l = h.faceNormals[i],
  41584. c = h.vertexNormals[i],
  41585. l.copy(r.normal),
  41586. c.a.copy(r.vertexNormals[0]),
  41587. c.b.copy(r.vertexNormals[1]),
  41588. c.c.copy(r.vertexNormals[2])
  41589. }
  41590. for (i = 0,
  41591. n = this.faces.length; i < n; i++)
  41592. (r = this.faces[i]).normal = r.__originalFaceNormal,
  41593. r.vertexNormals = r.__originalVertexNormals
  41594. },
  41595. computeTangents: function() {
  41596. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  41597. },
  41598. computeLineDistances: function() {
  41599. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  41600. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  41601. this.lineDistances[i] = e
  41602. },
  41603. computeBoundingBox: function() {
  41604. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  41605. this.boundingBox.setFromPoints(this.vertices)
  41606. },
  41607. computeBoundingSphere: function() {
  41608. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  41609. this.boundingSphere.setFromPoints(this.vertices)
  41610. },
  41611. merge: function(e, t, i) {
  41612. if (e instanceof Ci.Geometry != 0) {
  41613. 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];
  41614. void 0 === i && (i = 0),
  41615. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  41616. for (var u = 0, d = a.length; u < d; u++) {
  41617. var p = a[u].clone();
  41618. void 0 !== t && p.applyMatrix4(t),
  41619. o.push(p)
  41620. }
  41621. for (u = 0,
  41622. d = l.length; u < d; u++) {
  41623. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  41624. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  41625. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  41626. for (var C = 0, I = y.length; C < I; C++)
  41627. g = y[C].clone(),
  41628. void 0 !== n && g.applyMatrix3(n).normalize(),
  41629. f.vertexNormals.push(g);
  41630. f.color.copy(v.color);
  41631. for (C = 0,
  41632. I = A.length; C < I; C++)
  41633. m = A[C],
  41634. f.vertexColors.push(m.clone());
  41635. f.materialIndex = v.materialIndex + i,
  41636. s.push(f)
  41637. }
  41638. for (u = 0,
  41639. d = h.length; u < d; u++) {
  41640. var E = h[u]
  41641. , _ = [];
  41642. if (void 0 !== E) {
  41643. for (C = 0,
  41644. I = E.length; C < I; C++)
  41645. _.push(E[C].clone());
  41646. c.push(_)
  41647. }
  41648. }
  41649. } else
  41650. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  41651. },
  41652. mergeMesh: function(e) {
  41653. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  41654. void this.merge(e.geometry, e.matrix))
  41655. },
  41656. mergeVertices: function() {
  41657. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  41658. for (i = 0,
  41659. n = this.vertices.length; i < n; i++)
  41660. e = this.vertices[i],
  41661. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  41662. c.push(this.vertices[i]),
  41663. h[i] = c.length - 1) : h[i] = h[l[t]];
  41664. var d = [];
  41665. for (i = 0,
  41666. n = this.faces.length; i < n; i++) {
  41667. (r = this.faces[i]).a = h[r.a],
  41668. r.b = h[r.b],
  41669. r.c = h[r.c],
  41670. o = [r.a, r.b, r.c];
  41671. for (var p = 0; p < 3; p++)
  41672. if (o[p] === o[(p + 1) % 3]) {
  41673. p,
  41674. d.push(i);
  41675. break
  41676. }
  41677. }
  41678. for (i = d.length - 1; 0 <= i; i--) {
  41679. var f = d[i];
  41680. for (this.faces.splice(f, 1),
  41681. a = 0,
  41682. s = this.faceVertexUvs.length; a < s; a++)
  41683. this.faceVertexUvs[a].splice(f, 1)
  41684. }
  41685. var g = this.vertices.length - c.length;
  41686. return this.vertices = c,
  41687. g
  41688. },
  41689. sortFacesByMaterialIndex: function() {
  41690. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  41691. e[i]._id = i;
  41692. e.sort(function(e, t) {
  41693. return e.materialIndex - t.materialIndex
  41694. });
  41695. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  41696. o && o.length === t && (n = []),
  41697. a && a.length === t && (r = []);
  41698. for (i = 0; i < t; i++) {
  41699. var s = e[i]._id;
  41700. n && n.push(o[s]),
  41701. r && r.push(a[s])
  41702. }
  41703. n && (this.faceVertexUvs[0] = n),
  41704. r && (this.faceVertexUvs[1] = r)
  41705. },
  41706. toJSON: function() {
  41707. function e(e, t, i) {
  41708. return i ? e | 1 << t : e & ~(1 << t)
  41709. }
  41710. function t(e) {
  41711. var t = e.x.toString() + e.y.toString() + e.z.toString();
  41712. return void 0 !== d[t] || (d[t] = u.length / 3,
  41713. u.push(e.x, e.y, e.z)),
  41714. d[t]
  41715. }
  41716. function i(e) {
  41717. var t = e.r.toString() + e.g.toString() + e.b.toString();
  41718. return void 0 !== f[t] || (f[t] = p.length,
  41719. p.push(e.getHex())),
  41720. f[t]
  41721. }
  41722. function n(e) {
  41723. var t = e.x.toString() + e.y.toString();
  41724. return void 0 !== m[t] || (m[t] = g.length / 2,
  41725. g.push(e.x, e.y)),
  41726. m[t]
  41727. }
  41728. var r = {
  41729. metadata: {
  41730. version: 4.4,
  41731. type: "Geometry",
  41732. generator: "Geometry.toJSON"
  41733. }
  41734. };
  41735. if (r.uuid = this.uuid,
  41736. r.type = this.type,
  41737. "" !== this.name && (r.name = this.name),
  41738. void 0 !== this.parameters) {
  41739. var o = this.parameters;
  41740. for (var a in o)
  41741. void 0 !== o[a] && (r[a] = o[a]);
  41742. return r
  41743. }
  41744. for (var s = [], l = 0; l < this.vertices.length; l++) {
  41745. var c = this.vertices[l];
  41746. s.push(c.x, c.y, c.z)
  41747. }
  41748. var h = []
  41749. , u = []
  41750. , d = {}
  41751. , p = []
  41752. , f = {}
  41753. , g = []
  41754. , m = {};
  41755. for (l = 0; l < this.faces.length; l++) {
  41756. var v = this.faces[l]
  41757. , y = void 0 !== this.faceVertexUvs[0][l]
  41758. , A = 0 < v.normal.length()
  41759. , C = 0 < v.vertexNormals.length
  41760. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  41761. , E = 0 < v.vertexColors.length
  41762. , _ = 0;
  41763. 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),
  41764. h.push(_),
  41765. h.push(v.a, v.b, v.c),
  41766. h.push(v.materialIndex),
  41767. y) {
  41768. var b = this.faceVertexUvs[0][l];
  41769. h.push(n(b[0]), n(b[1]), n(b[2]))
  41770. }
  41771. if (A && h.push(t(v.normal)),
  41772. C) {
  41773. var w = v.vertexNormals;
  41774. h.push(t(w[0]), t(w[1]), t(w[2]))
  41775. }
  41776. if (I && h.push(i(v.color)),
  41777. E) {
  41778. var T = v.vertexColors;
  41779. h.push(i(T[0]), i(T[1]), i(T[2]))
  41780. }
  41781. }
  41782. return r.data = {},
  41783. r.data.vertices = s,
  41784. r.data.normals = u,
  41785. 0 < p.length && (r.data.colors = p),
  41786. 0 < g.length && (r.data.uvs = [g]),
  41787. r.data.faces = h,
  41788. r
  41789. },
  41790. clone: function() {
  41791. return (new Ci.Geometry).copy(this)
  41792. },
  41793. copy: function(e) {
  41794. this.vertices = [],
  41795. this.faces = [],
  41796. this.faceVertexUvs = [[]];
  41797. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  41798. this.vertices.push(t[i].clone());
  41799. var r = e.faces;
  41800. for (i = 0,
  41801. n = r.length; i < n; i++)
  41802. this.faces.push(r[i].clone());
  41803. for (i = 0,
  41804. n = e.faceVertexUvs.length; i < n; i++) {
  41805. var o = e.faceVertexUvs[i];
  41806. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  41807. for (var a = 0, s = o.length; a < s; a++) {
  41808. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  41809. var d = l[h];
  41810. c.push(d.clone())
  41811. }
  41812. this.faceVertexUvs[i].push(c)
  41813. }
  41814. }
  41815. return this
  41816. },
  41817. dispose: function() {
  41818. this.dispatchEvent({
  41819. type: "dispose"
  41820. })
  41821. }
  41822. },
  41823. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  41824. Ci.GeometryIdCount = 0,
  41825. Ci.DirectGeometry = function() {
  41826. Object.defineProperty(this, "id", {
  41827. value: Ci.GeometryIdCount++
  41828. }),
  41829. this.uuid = Ci.Math.generateUUID(),
  41830. this.name = "",
  41831. this.type = "DirectGeometry",
  41832. this.indices = [],
  41833. this.vertices = [],
  41834. this.normals = [],
  41835. this.colors = [],
  41836. this.uvs = [],
  41837. this.uvs2 = [],
  41838. this.groups = [],
  41839. this.morphTargets = {},
  41840. this.skinWeights = [],
  41841. this.skinIndices = [],
  41842. this.boundingBox = null,
  41843. this.boundingSphere = null,
  41844. this.verticesNeedUpdate = !1,
  41845. this.normalsNeedUpdate = !1,
  41846. this.colorsNeedUpdate = !1,
  41847. this.uvsNeedUpdate = !1,
  41848. this.groupsNeedUpdate = !1
  41849. }
  41850. ,
  41851. Ci.DirectGeometry.prototype = {
  41852. constructor: Ci.DirectGeometry,
  41853. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  41854. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  41855. computeFaceNormals: function() {
  41856. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  41857. },
  41858. computeVertexNormals: function() {
  41859. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  41860. },
  41861. computeGroups: function(e) {
  41862. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  41863. var a = r[o];
  41864. a.materialIndex !== i && (i = a.materialIndex,
  41865. void 0 !== t && (t.count = 3 * o - t.start,
  41866. n.push(t)),
  41867. t = {
  41868. start: 3 * o,
  41869. materialIndex: i
  41870. })
  41871. }
  41872. void 0 !== t && (t.count = 3 * o - t.start,
  41873. n.push(t)),
  41874. this.groups = n
  41875. },
  41876. fromGeometry: function(e) {
  41877. 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;
  41878. if (0 < l) {
  41879. t = [];
  41880. for (var c = 0; c < l; c++)
  41881. t[c] = [];
  41882. this.morphTargets.position = t
  41883. }
  41884. var h, u = e.morphNormals, d = u.length;
  41885. if (0 < d) {
  41886. h = [];
  41887. for (c = 0; c < d; c++)
  41888. h[c] = [];
  41889. this.morphTargets.normal = h
  41890. }
  41891. var p = e.skinIndices
  41892. , f = e.skinWeights
  41893. , g = p.length === n.length
  41894. , m = f.length === n.length;
  41895. for (c = 0; c < i.length; c++) {
  41896. var v = i[c];
  41897. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  41898. var y = v.vertexNormals;
  41899. if (3 === y.length)
  41900. this.normals.push(y[0], y[1], y[2]);
  41901. else {
  41902. var A = v.normal;
  41903. this.normals.push(A, A, A)
  41904. }
  41905. var C, I = v.vertexColors;
  41906. if (3 === I.length)
  41907. this.colors.push(I[0], I[1], I[2]);
  41908. else {
  41909. var E = v.color;
  41910. this.colors.push(E, E, E)
  41911. }
  41912. if (!0 === o)
  41913. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  41914. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  41915. if (!0 === a)
  41916. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  41917. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  41918. for (var _ = 0; _ < l; _++) {
  41919. var b = s[_].vertices;
  41920. t[_].push(b[v.a], b[v.b], b[v.c])
  41921. }
  41922. for (_ = 0; _ < d; _++) {
  41923. var w = u[_].vertexNormals[c];
  41924. h[_].push(w.a, w.b, w.c)
  41925. }
  41926. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  41927. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  41928. }
  41929. return this.computeGroups(e),
  41930. this.verticesNeedUpdate = e.verticesNeedUpdate,
  41931. this.normalsNeedUpdate = e.normalsNeedUpdate,
  41932. this.colorsNeedUpdate = e.colorsNeedUpdate,
  41933. this.uvsNeedUpdate = e.uvsNeedUpdate,
  41934. this.groupsNeedUpdate = e.groupsNeedUpdate,
  41935. this
  41936. },
  41937. dispose: function() {
  41938. this.dispatchEvent({
  41939. type: "dispose"
  41940. })
  41941. }
  41942. },
  41943. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  41944. Ci.BufferGeometry = function() {
  41945. Object.defineProperty(this, "id", {
  41946. value: Ci.GeometryIdCount++
  41947. }),
  41948. this.uuid = Ci.Math.generateUUID(),
  41949. this.name = "",
  41950. this.type = "BufferGeometry",
  41951. this.index = null,
  41952. this.attributes = {},
  41953. this.morphAttributes = {},
  41954. this.groups = [],
  41955. this.boundingBox = null,
  41956. this.boundingSphere = null,
  41957. this.drawRange = {
  41958. start: 0,
  41959. count: 1 / 0
  41960. }
  41961. }
  41962. ,
  41963. Ci.BufferGeometry.prototype = {
  41964. constructor: Ci.BufferGeometry,
  41965. getIndex: function() {
  41966. return this.index
  41967. },
  41968. setIndex: function(e) {
  41969. this.index = e
  41970. },
  41971. addAttribute: function(e, t) {
  41972. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  41973. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  41974. void this.setIndex(t)) : (this.attributes[e] = t,
  41975. this)
  41976. },
  41977. getAttribute: function(e) {
  41978. return this.attributes[e]
  41979. },
  41980. removeAttribute: function(e) {
  41981. return delete this.attributes[e],
  41982. this
  41983. },
  41984. addGroup: function(e, t, i) {
  41985. this.groups.push({
  41986. start: e,
  41987. count: t,
  41988. materialIndex: void 0 !== i ? i : 0
  41989. })
  41990. },
  41991. clearGroups: function() {
  41992. this.groups = []
  41993. },
  41994. setDrawRange: function(e, t) {
  41995. this.drawRange.start = e,
  41996. this.drawRange.count = t
  41997. },
  41998. applyMatrix: function(e) {
  41999. var t = this.attributes.position;
  42000. void 0 !== t && (e.applyToVector3Array(t.array),
  42001. t.needsUpdate = !0);
  42002. var i = this.attributes.normal;
  42003. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42004. i.needsUpdate = !0);
  42005. return null !== this.boundingBox && this.computeBoundingBox(),
  42006. null !== this.boundingSphere && this.computeBoundingSphere(),
  42007. this
  42008. },
  42009. rotateX: function(e) {
  42010. return void 0 === ht && (ht = new Ci.Matrix4),
  42011. ht.makeRotationX(e),
  42012. this.applyMatrix(ht),
  42013. this
  42014. },
  42015. rotateY: function(e) {
  42016. return void 0 === ct && (ct = new Ci.Matrix4),
  42017. ct.makeRotationY(e),
  42018. this.applyMatrix(ct),
  42019. this
  42020. },
  42021. rotateZ: function(e) {
  42022. return void 0 === lt && (lt = new Ci.Matrix4),
  42023. lt.makeRotationZ(e),
  42024. this.applyMatrix(lt),
  42025. this
  42026. },
  42027. translate: function(e, t, i) {
  42028. return void 0 === st && (st = new Ci.Matrix4),
  42029. st.makeTranslation(e, t, i),
  42030. this.applyMatrix(st),
  42031. this
  42032. },
  42033. scale: function(e, t, i) {
  42034. return void 0 === at && (at = new Ci.Matrix4),
  42035. at.makeScale(e, t, i),
  42036. this.applyMatrix(at),
  42037. this
  42038. },
  42039. lookAt: function(e) {
  42040. void 0 === ot && (ot = new Ci.Object3D),
  42041. ot.lookAt(e),
  42042. ot.updateMatrix(),
  42043. this.applyMatrix(ot.matrix)
  42044. },
  42045. center: function() {
  42046. this.computeBoundingBox();
  42047. var e = this.boundingBox.center().negate();
  42048. return this.translate(e.x, e.y, e.z),
  42049. e
  42050. },
  42051. setFromObject: function(e) {
  42052. var t = e.geometry;
  42053. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  42054. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  42055. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  42056. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42057. this.addAttribute("color", n.copyColorsArray(t.colors)),
  42058. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42059. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  42060. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  42061. }
  42062. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42063. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42064. } else
  42065. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  42066. return this
  42067. },
  42068. updateFromObject: function(e) {
  42069. var t, i = e.geometry;
  42070. if (e instanceof Ci.Mesh) {
  42071. var n = i.__directGeometry;
  42072. if (void 0 === n)
  42073. return this.fromGeometry(i);
  42074. n.verticesNeedUpdate = i.verticesNeedUpdate,
  42075. n.normalsNeedUpdate = i.normalsNeedUpdate,
  42076. n.colorsNeedUpdate = i.colorsNeedUpdate,
  42077. n.uvsNeedUpdate = i.uvsNeedUpdate,
  42078. n.groupsNeedUpdate = i.groupsNeedUpdate,
  42079. i.verticesNeedUpdate = !1,
  42080. i.normalsNeedUpdate = !1,
  42081. i.colorsNeedUpdate = !1,
  42082. i.uvsNeedUpdate = !1,
  42083. i.groupsNeedUpdate = !1,
  42084. i = n
  42085. }
  42086. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  42087. t.needsUpdate = !0),
  42088. i.verticesNeedUpdate = !1);
  42089. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  42090. t.needsUpdate = !0),
  42091. i.normalsNeedUpdate = !1);
  42092. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  42093. t.needsUpdate = !0),
  42094. i.colorsNeedUpdate = !1);
  42095. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  42096. t.needsUpdate = !0),
  42097. i.uvsNeedUpdate = !1);
  42098. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  42099. t.needsUpdate = !0),
  42100. i.lineDistancesNeedUpdate = !1);
  42101. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  42102. this.groups = i.groups,
  42103. i.groupsNeedUpdate = !1),
  42104. this
  42105. },
  42106. fromGeometry: function(e) {
  42107. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  42108. this.fromDirectGeometry(e.__directGeometry)
  42109. },
  42110. fromDirectGeometry: function(e) {
  42111. var t = new Float32Array(3 * e.vertices.length);
  42112. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42113. 0 < e.normals.length) {
  42114. var i = new Float32Array(3 * e.normals.length);
  42115. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42116. }
  42117. if (0 < e.colors.length) {
  42118. var n = new Float32Array(3 * e.colors.length);
  42119. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  42120. }
  42121. if (0 < e.uvs.length) {
  42122. var r = new Float32Array(2 * e.uvs.length);
  42123. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  42124. }
  42125. if (0 < e.uvs2.length) {
  42126. var o = new Float32Array(2 * e.uvs2.length);
  42127. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  42128. }
  42129. if (0 < e.indices.length) {
  42130. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  42131. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  42132. }
  42133. for (var s in this.groups = e.groups,
  42134. e.morphTargets) {
  42135. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  42136. var d = c[h]
  42137. , p = new Ci.Float32Attribute(3 * d.length,3);
  42138. l.push(p.copyVector3sArray(d))
  42139. }
  42140. this.morphAttributes[s] = l
  42141. }
  42142. if (0 < e.skinIndices.length) {
  42143. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  42144. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  42145. }
  42146. if (0 < e.skinWeights.length) {
  42147. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  42148. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  42149. }
  42150. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42151. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42152. this
  42153. },
  42154. computeBoundingBox: (new Ci.Vector3,
  42155. function() {
  42156. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  42157. var e = this.attributes.position.array;
  42158. e && this.boundingBox.setFromArray(e),
  42159. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42160. this.boundingBox.max.set(0, 0, 0)),
  42161. (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)
  42162. }
  42163. ),
  42164. computeBoundingSphere: (nt = new Ci.Box3,
  42165. rt = new Ci.Vector3,
  42166. function() {
  42167. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  42168. var e = this.attributes.position.array;
  42169. if (e) {
  42170. var t = this.boundingSphere.center;
  42171. nt.setFromArray(e),
  42172. nt.center(t);
  42173. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  42174. rt.fromArray(e, n),
  42175. i = Math.max(i, t.distanceToSquared(rt));
  42176. this.boundingSphere.radius = Math.sqrt(i),
  42177. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42178. }
  42179. }
  42180. ),
  42181. computeFaceNormals: function() {},
  42182. computeVertexNormals: function() {
  42183. var e = this.index
  42184. , t = this.attributes
  42185. , i = this.groups;
  42186. if (t.position) {
  42187. var n = t.position.array;
  42188. if (void 0 === t.normal)
  42189. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  42190. else
  42191. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  42192. r[o] = 0;
  42193. 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;
  42194. if (e) {
  42195. var m = e.array;
  42196. 0 === i.length && this.addGroup(0, m.length);
  42197. for (var v = 0, y = i.length; v < y; ++v) {
  42198. var A = i[v]
  42199. , C = A.start;
  42200. for (o = C,
  42201. a = C + A.count; o < a; o += 3)
  42202. s = 3 * m[o + 0],
  42203. l = 3 * m[o + 1],
  42204. c = 3 * m[o + 2],
  42205. u.fromArray(n, s),
  42206. d.fromArray(n, l),
  42207. p.fromArray(n, c),
  42208. f.subVectors(p, d),
  42209. g.subVectors(u, d),
  42210. f.cross(g),
  42211. h[s] += f.x,
  42212. h[1 + s] += f.y,
  42213. h[2 + s] += f.z,
  42214. h[l] += f.x,
  42215. h[1 + l] += f.y,
  42216. h[2 + l] += f.z,
  42217. h[c] += f.x,
  42218. h[1 + c] += f.y,
  42219. h[2 + c] += f.z
  42220. }
  42221. } else
  42222. for (o = 0,
  42223. a = n.length; o < a; o += 9)
  42224. u.fromArray(n, o),
  42225. d.fromArray(n, o + 3),
  42226. p.fromArray(n, o + 6),
  42227. f.subVectors(p, d),
  42228. g.subVectors(u, d),
  42229. f.cross(g),
  42230. h[o] = f.x,
  42231. h[o + 1] = f.y,
  42232. h[o + 2] = f.z,
  42233. h[o + 3] = f.x,
  42234. h[o + 4] = f.y,
  42235. h[o + 5] = f.z,
  42236. h[o + 6] = f.x,
  42237. h[o + 7] = f.y,
  42238. h[o + 8] = f.z;
  42239. this.normalizeNormals(),
  42240. t.normal.needsUpdate = !0
  42241. }
  42242. },
  42243. merge: function(e, t) {
  42244. if (e instanceof Ci.BufferGeometry != 0) {
  42245. void 0 === t && (t = 0);
  42246. var i = this.attributes;
  42247. for (var n in i)
  42248. if (void 0 !== e.attributes[n])
  42249. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  42250. l++)
  42251. r[l] = a[s];
  42252. return this
  42253. }
  42254. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  42255. },
  42256. normalizeNormals: function() {
  42257. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42258. e = r[o],
  42259. t = r[o + 1],
  42260. i = r[o + 2],
  42261. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42262. r[o] *= n,
  42263. r[o + 1] *= n,
  42264. r[o + 2] *= n
  42265. },
  42266. toNonIndexed: function() {
  42267. if (null === this.index)
  42268. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42269. this;
  42270. var e = new Ci.BufferGeometry
  42271. , t = this.index.array
  42272. , i = this.attributes;
  42273. for (var n in i) {
  42274. 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++) {
  42275. l = t[h] * a;
  42276. for (var d = 0; d < a; d++)
  42277. s[c++] = o[l++]
  42278. }
  42279. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  42280. }
  42281. return e
  42282. },
  42283. toJSON: function() {
  42284. var e = {
  42285. metadata: {
  42286. version: 4.4,
  42287. type: "BufferGeometry",
  42288. generator: "BufferGeometry.toJSON"
  42289. }
  42290. };
  42291. if (e.uuid = this.uuid,
  42292. e.type = this.type,
  42293. "" !== this.name && (e.name = this.name),
  42294. void 0 !== this.parameters) {
  42295. var t = this.parameters;
  42296. for (var i in t)
  42297. void 0 !== t[i] && (e[i] = t[i]);
  42298. return e
  42299. }
  42300. e.data = {
  42301. attributes: {}
  42302. };
  42303. var n = this.index;
  42304. if (null !== n) {
  42305. var r = Array.prototype.slice.call(n.array);
  42306. e.data.index = {
  42307. type: n.array.constructor.name,
  42308. array: r
  42309. }
  42310. }
  42311. var o = this.attributes;
  42312. for (var i in o) {
  42313. var a = o[i];
  42314. r = Array.prototype.slice.call(a.array);
  42315. e.data.attributes[i] = {
  42316. itemSize: a.itemSize,
  42317. type: a.array.constructor.name,
  42318. array: r
  42319. }
  42320. }
  42321. var s = this.groups;
  42322. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  42323. var l = this.boundingSphere;
  42324. return null !== l && (e.data.boundingSphere = {
  42325. center: l.center.toArray(),
  42326. radius: l.radius
  42327. }),
  42328. e
  42329. },
  42330. clone: function() {
  42331. return (new Ci.BufferGeometry).copy(this)
  42332. },
  42333. copy: function(e) {
  42334. var t = e.index;
  42335. null !== t && this.setIndex(t.clone());
  42336. var i = e.attributes;
  42337. for (var n in i) {
  42338. var r = i[n];
  42339. this.addAttribute(n, r.clone())
  42340. }
  42341. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42342. var l = o[a];
  42343. this.addGroup(l.start, l.count)
  42344. }
  42345. return this
  42346. },
  42347. dispose: function() {
  42348. this.dispatchEvent({
  42349. type: "dispose"
  42350. })
  42351. }
  42352. },
  42353. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  42354. Ci.BufferGeometry.MaxIndex = 65535,
  42355. Ci.InstancedBufferGeometry = function() {
  42356. Ci.BufferGeometry.call(this),
  42357. this.type = "InstancedBufferGeometry",
  42358. this.maxInstancedCount = void 0
  42359. }
  42360. ,
  42361. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  42362. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  42363. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  42364. this.groups.push({
  42365. start: e,
  42366. count: t,
  42367. instances: i
  42368. })
  42369. }
  42370. ,
  42371. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  42372. var t = e.index;
  42373. null !== t && this.setIndex(t.clone());
  42374. var i = e.attributes;
  42375. for (var n in i) {
  42376. var r = i[n];
  42377. this.addAttribute(n, r.clone())
  42378. }
  42379. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42380. var l = o[a];
  42381. this.addGroup(l.start, l.count, l.instances)
  42382. }
  42383. return this
  42384. }
  42385. ,
  42386. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  42387. Ci.Uniform = function(e, t) {
  42388. this.type = e,
  42389. this.value = t,
  42390. this.dynamic = !1
  42391. }
  42392. ,
  42393. Ci.Uniform.prototype = {
  42394. constructor: Ci.Uniform,
  42395. onUpdate: function(e) {
  42396. return this.dynamic = !0,
  42397. this.onUpdateCallback = e,
  42398. this
  42399. }
  42400. },
  42401. Ci.AnimationClip = function(e, t, i) {
  42402. this.name = e || Ci.Math.generateUUID(),
  42403. this.tracks = i,
  42404. this.duration = void 0 !== t ? t : -1,
  42405. this.duration < 0 && this.resetDuration(),
  42406. this.trim(),
  42407. this.optimize()
  42408. }
  42409. ,
  42410. Ci.AnimationClip.prototype = {
  42411. constructor: Ci.AnimationClip,
  42412. resetDuration: function() {
  42413. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  42414. var n = this.tracks[t];
  42415. e = Math.max(e, n.times[n.times.length - 1])
  42416. }
  42417. this.duration = e
  42418. },
  42419. trim: function() {
  42420. for (var e = 0; e < this.tracks.length; e++)
  42421. this.tracks[e].trim(0, this.duration);
  42422. return this
  42423. },
  42424. optimize: function() {
  42425. for (var e = 0; e < this.tracks.length; e++)
  42426. this.tracks[e].optimize();
  42427. return this
  42428. }
  42429. },
  42430. Object.assign(Ci.AnimationClip, {
  42431. parse: function(e) {
  42432. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  42433. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  42434. return new Ci.AnimationClip(e.name,e.duration,t)
  42435. },
  42436. toJSON: function(e) {
  42437. for (var t = [], i = e.tracks, n = {
  42438. name: e.name,
  42439. duration: e.duration,
  42440. tracks: t
  42441. }, r = 0, o = i.length; r !== o; ++r)
  42442. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  42443. return n
  42444. },
  42445. CreateFromMorphTargetSequence: function(e, t, i) {
  42446. for (var n = t.length, r = [], o = 0; o < n; o++) {
  42447. var a = []
  42448. , s = [];
  42449. a.push((o + n - 1) % n, o, (o + 1) % n),
  42450. s.push(0, 1, 0);
  42451. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  42452. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  42453. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  42454. 0 === a[0] && (a.push(n),
  42455. s.push(s[0])),
  42456. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  42457. }
  42458. return new Ci.AnimationClip(e,-1,r)
  42459. },
  42460. findByName: function(e, t) {
  42461. for (var i = 0; i < e.length; i++)
  42462. if (e[i].name === t)
  42463. return e[i];
  42464. return null
  42465. },
  42466. CreateClipsFromMorphTargetSequences: function(e, t) {
  42467. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  42468. var a = e[r]
  42469. , s = a.name.match(n);
  42470. if (s && 1 < s.length) {
  42471. var l = i[h = s[1]];
  42472. l || (i[h] = l = []),
  42473. l.push(a)
  42474. }
  42475. }
  42476. var c = [];
  42477. for (var h in i)
  42478. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  42479. return c
  42480. },
  42481. parseAnimation: function(e, t, i) {
  42482. if (!e)
  42483. return console.error(" no animation in JSONLoader data"),
  42484. null;
  42485. function n(e, t, i, n, r) {
  42486. if (0 !== i.length) {
  42487. var o = []
  42488. , a = [];
  42489. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  42490. 0 !== o.length && r.push(new e(t,o,a))
  42491. }
  42492. }
  42493. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  42494. var h = l[c].keys;
  42495. if (h && 0 != h.length)
  42496. if (h[0].morphTargets) {
  42497. for (var u = {}, d = 0; d < h.length; d++)
  42498. if (h[d].morphTargets)
  42499. for (var p = 0; p < h[d].morphTargets.length; p++)
  42500. u[h[d].morphTargets[p]] = -1;
  42501. for (var f in u) {
  42502. var g = []
  42503. , m = [];
  42504. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  42505. var v = h[d];
  42506. g.push(v.time),
  42507. m.push(v.morphTarget === f ? 1 : 0)
  42508. }
  42509. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  42510. }
  42511. a = u.length * (s || 1)
  42512. } else {
  42513. var y = ".bones[" + t[c].name + "]";
  42514. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  42515. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  42516. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  42517. }
  42518. }
  42519. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  42520. }
  42521. }),
  42522. Ci.AnimationMixer = function(e) {
  42523. this._root = e,
  42524. this._initMemoryManager(),
  42525. this._accuIndex = 0,
  42526. this.time = 0,
  42527. this.timeScale = 1
  42528. }
  42529. ,
  42530. Ci.AnimationMixer.prototype = {
  42531. constructor: Ci.AnimationMixer,
  42532. clipAction: function(e, t) {
  42533. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  42534. if (void 0 !== a) {
  42535. var s = a.actionByRoot[n];
  42536. if (void 0 !== s)
  42537. return s;
  42538. if (o = (i = a.knownActions[0])._clip,
  42539. e !== r && e !== o)
  42540. throw new Error("Different clips with the same name detected!")
  42541. }
  42542. if (null === o)
  42543. return null;
  42544. var l = new Ci.AnimationMixer._Action(this,o,t);
  42545. return this._bindAction(l, i),
  42546. this._addInactiveAction(l, r, n),
  42547. l
  42548. },
  42549. existingAction: function(e, t) {
  42550. var i = (t || this._root).uuid
  42551. , n = "string" == typeof e ? e : e.name
  42552. , r = this._actionsByClip[n];
  42553. return void 0 !== r && r.actionByRoot[i] || null
  42554. },
  42555. stopAllAction: function() {
  42556. var e = this._actions
  42557. , t = this._nActiveActions
  42558. , i = this._bindings
  42559. , n = this._nActiveBindings;
  42560. this._nActiveActions = 0;
  42561. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  42562. e[r].reset();
  42563. for (r = 0; r !== n; ++r)
  42564. i[r].useCount = 0;
  42565. return this
  42566. },
  42567. update: function(e) {
  42568. e *= this.timeScale;
  42569. 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) {
  42570. var s = t[a];
  42571. s.enabled && s._update(n, e, r, o)
  42572. }
  42573. var l = this._bindings
  42574. , c = this._nActiveBindings;
  42575. for (a = 0; a !== c; ++a)
  42576. l[a].apply(o);
  42577. return this
  42578. },
  42579. getRoot: function() {
  42580. return this._root
  42581. },
  42582. uncacheClip: function(e) {
  42583. var t = this._actions
  42584. , i = e.name
  42585. , n = this._actionsByClip
  42586. , r = n[i];
  42587. if (void 0 !== r) {
  42588. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  42589. var l = o[a];
  42590. this._deactivateAction(l);
  42591. var c = l._cacheIndex
  42592. , h = t[t.length - 1];
  42593. l._cacheIndex = null,
  42594. l._byClipCacheIndex = null,
  42595. t[h._cacheIndex = c] = h,
  42596. t.pop(),
  42597. this._removeInactiveBindingsForAction(l)
  42598. }
  42599. delete n[i]
  42600. }
  42601. },
  42602. uncacheRoot: function(e) {
  42603. var t = e.uuid
  42604. , i = this._actionsByClip;
  42605. for (var n in i) {
  42606. var r = i[n].actionByRoot[t];
  42607. void 0 !== r && (this._deactivateAction(r),
  42608. this._removeInactiveAction(r))
  42609. }
  42610. var o = this._bindingsByRootAndName[t];
  42611. if (void 0 !== o)
  42612. for (var a in o) {
  42613. var s = o[a];
  42614. s.restoreOriginalState(),
  42615. this._removeInactiveBinding(s)
  42616. }
  42617. },
  42618. uncacheAction: function(e, t) {
  42619. var i = this.existingAction(e, t);
  42620. null !== i && (this._deactivateAction(i),
  42621. this._removeInactiveAction(i))
  42622. }
  42623. },
  42624. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  42625. Ci.AnimationMixer._Action = function(e, t, i) {
  42626. this._mixer = e,
  42627. this._clip = t,
  42628. this._localRoot = i || null;
  42629. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  42630. endingStart: Ci.ZeroCurvatureEnding,
  42631. endingEnd: Ci.ZeroCurvatureEnding
  42632. }, s = 0; s !== r; ++s) {
  42633. var l = n[s].createInterpolant(null);
  42634. (o[s] = l).settings = a
  42635. }
  42636. this._interpolantSettings = a,
  42637. this._interpolants = o,
  42638. this._propertyBindings = new Array(r),
  42639. this._cacheIndex = null,
  42640. this._byClipCacheIndex = null,
  42641. this._timeScaleInterpolant = null,
  42642. this._weightInterpolant = null,
  42643. this.loop = Ci.LoopRepeat,
  42644. this._loopCount = -1,
  42645. this._startTime = null,
  42646. this.time = 0,
  42647. this.timeScale = 1,
  42648. this._effectiveTimeScale = 1,
  42649. this.weight = 1,
  42650. this._effectiveWeight = 1,
  42651. this.repetitions = 1 / 0,
  42652. this.paused = !1,
  42653. this.enabled = !0,
  42654. this.clampWhenFinished = !1,
  42655. this.zeroSlopeAtStart = !0,
  42656. this.zeroSlopeAtEnd = !0
  42657. }
  42658. ,
  42659. Ci.AnimationMixer._Action.prototype = {
  42660. constructor: Ci.AnimationMixer._Action,
  42661. play: function() {
  42662. return this._mixer._activateAction(this),
  42663. this
  42664. },
  42665. stop: function() {
  42666. return this._mixer._deactivateAction(this),
  42667. this.reset()
  42668. },
  42669. reset: function() {
  42670. return this.paused = !1,
  42671. this.enabled = !0,
  42672. this.time = 0,
  42673. this._loopCount = -1,
  42674. this._startTime = null,
  42675. this.stopFading().stopWarping()
  42676. },
  42677. isRunning: function() {
  42678. return this._startTime,
  42679. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  42680. },
  42681. isScheduled: function() {
  42682. return this._mixer._isActiveAction(this)
  42683. },
  42684. startAt: function(e) {
  42685. return this._startTime = e,
  42686. this
  42687. },
  42688. setLoop: function(e, t) {
  42689. return this.loop = e,
  42690. this.repetitions = t,
  42691. this
  42692. },
  42693. setEffectiveWeight: function(e) {
  42694. return this.weight = e,
  42695. this._effectiveWeight = this.enabled ? e : 0,
  42696. this.stopFading()
  42697. },
  42698. getEffectiveWeight: function() {
  42699. return this._effectiveWeight
  42700. },
  42701. fadeIn: function(e) {
  42702. return this._scheduleFading(e, 0, 1)
  42703. },
  42704. fadeOut: function(e) {
  42705. return this._scheduleFading(e, 1, 0)
  42706. },
  42707. crossFadeFrom: function(e, t, i) {
  42708. if (this._mixer,
  42709. e.fadeOut(t),
  42710. this.fadeIn(t),
  42711. i) {
  42712. var n = this._clip.duration
  42713. , r = e._clip.duration
  42714. , o = r / n
  42715. , a = n / r;
  42716. e.warp(1, o, t),
  42717. this.warp(a, 1, t)
  42718. }
  42719. return this
  42720. },
  42721. crossFadeTo: function(e, t, i) {
  42722. return e.crossFadeFrom(this, t, i)
  42723. },
  42724. stopFading: function() {
  42725. var e = this._weightInterpolant;
  42726. return null !== e && (this._weightInterpolant = null,
  42727. this._mixer._takeBackControlInterpolant(e)),
  42728. this
  42729. },
  42730. setEffectiveTimeScale: function(e) {
  42731. return this.timeScale = e,
  42732. this._effectiveTimeScale = this.paused ? 0 : e,
  42733. this.stopWarping()
  42734. },
  42735. getEffectiveTimeScale: function() {
  42736. return this._effectiveTimeScale
  42737. },
  42738. setDuration: function(e) {
  42739. return this.timeScale = this._clip.duration / e,
  42740. this.stopWarping()
  42741. },
  42742. syncWith: function(e) {
  42743. return this.time = e.time,
  42744. this.timeScale = e.timeScale,
  42745. this.stopWarping()
  42746. },
  42747. halt: function(e) {
  42748. return this.warp(this._currentTimeScale, 0, e)
  42749. },
  42750. warp: function(e, t, i) {
  42751. var n = this._mixer
  42752. , r = n.time
  42753. , o = this._timeScaleInterpolant
  42754. , a = this.timeScale;
  42755. null === o && (o = n._lendControlInterpolant(),
  42756. this._timeScaleInterpolant = o);
  42757. var s = o.parameterPositions
  42758. , l = o.sampleValues;
  42759. return s[0] = r,
  42760. s[1] = r + i,
  42761. l[0] = e / a,
  42762. l[1] = t / a,
  42763. this
  42764. },
  42765. stopWarping: function() {
  42766. var e = this._timeScaleInterpolant;
  42767. return null !== e && (this._timeScaleInterpolant = null,
  42768. this._mixer._takeBackControlInterpolant(e)),
  42769. this
  42770. },
  42771. getMixer: function() {
  42772. return this._mixer
  42773. },
  42774. getClip: function() {
  42775. return this._clip
  42776. },
  42777. getRoot: function() {
  42778. return this._localRoot || this._mixer._root
  42779. },
  42780. _update: function(e, t, i, n) {
  42781. var r = this._startTime;
  42782. if (null !== r) {
  42783. var o = (e - r) * i;
  42784. if (o < 0 || 0 === i)
  42785. return;
  42786. this._startTime = null,
  42787. t = i * o
  42788. }
  42789. t *= this._updateTimeScale(e);
  42790. var a = this._updateTime(t)
  42791. , s = this._updateWeight(e);
  42792. if (0 < s)
  42793. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  42794. l[h].evaluate(a),
  42795. c[h].accumulate(n, s)
  42796. },
  42797. _updateWeight: function(e) {
  42798. var t = 0;
  42799. if (this.enabled) {
  42800. t = this.weight;
  42801. var i = this._weightInterpolant;
  42802. if (null !== i) {
  42803. var n = i.evaluate(e)[0];
  42804. t *= n,
  42805. e > i.parameterPositions[1] && (this.stopFading(),
  42806. 0 === n && (this.enabled = !1))
  42807. }
  42808. }
  42809. return this._effectiveWeight = t
  42810. },
  42811. _updateTimeScale: function(e) {
  42812. var t = 0;
  42813. if (!this.paused) {
  42814. t = this.timeScale;
  42815. var i = this._timeScaleInterpolant;
  42816. if (null !== i)
  42817. t *= i.evaluate(e)[0],
  42818. e > i.parameterPositions[1] && (this.stopWarping(),
  42819. 0 === t ? this.pause = !0 : this.timeScale = t)
  42820. }
  42821. return this._effectiveTimeScale = t
  42822. },
  42823. _updateTime: function(e) {
  42824. var t = this.time + e;
  42825. if (0 === e)
  42826. return t;
  42827. var i = this._clip.duration
  42828. , n = this.loop
  42829. , r = this._loopCount
  42830. , o = !1;
  42831. switch (n) {
  42832. case Ci.LoopOnce:
  42833. if (-1 === r && (this.loopCount = 0,
  42834. this._setEndings(!0, !0, !1)),
  42835. i <= t)
  42836. t = i;
  42837. else {
  42838. if (!(t < 0))
  42839. break;
  42840. t = 0
  42841. }
  42842. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  42843. this._mixer.dispatchEvent({
  42844. type: "finished",
  42845. action: this,
  42846. direction: e < 0 ? -1 : 1
  42847. });
  42848. break;
  42849. case Ci.LoopPingPong:
  42850. o = !0;
  42851. case Ci.LoopRepeat:
  42852. if (-1 === r && (0 < e ? (r = 0,
  42853. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  42854. i <= t || t < 0) {
  42855. var a = Math.floor(t / i);
  42856. t -= i * a,
  42857. r += Math.abs(a);
  42858. var s = this.repetitions - r;
  42859. if (s < 0) {
  42860. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  42861. t = 0 < e ? i : 0,
  42862. this._mixer.dispatchEvent({
  42863. type: "finished",
  42864. action: this,
  42865. direction: 0 < e ? 1 : -1
  42866. });
  42867. break
  42868. }
  42869. if (0 == s) {
  42870. var l = e < 0;
  42871. this._setEndings(l, !l, o)
  42872. } else
  42873. this._setEndings(!1, !1, o);
  42874. this._loopCount = r,
  42875. this._mixer.dispatchEvent({
  42876. type: "loop",
  42877. action: this,
  42878. loopDelta: a
  42879. })
  42880. }
  42881. if (n === Ci.LoopPingPong && 1 == (1 & r))
  42882. return i - (this.time = t)
  42883. }
  42884. return this.time = t
  42885. },
  42886. _setEndings: function(e, t, i) {
  42887. var n = this._interpolantSettings;
  42888. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  42889. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  42890. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  42891. },
  42892. _scheduleFading: function(e, t, i) {
  42893. var n = this._mixer
  42894. , r = n.time
  42895. , o = this._weightInterpolant;
  42896. null === o && (o = n._lendControlInterpolant(),
  42897. this._weightInterpolant = o);
  42898. var a = o.parameterPositions
  42899. , s = o.sampleValues;
  42900. return a[0] = r,
  42901. s[0] = t,
  42902. a[1] = r + e,
  42903. s[1] = i,
  42904. this
  42905. }
  42906. },
  42907. Object.assign(Ci.AnimationMixer.prototype, {
  42908. _bindAction: function(e, t) {
  42909. var i = e._localRoot || this._root
  42910. , n = e._clip.tracks
  42911. , r = n.length
  42912. , o = e._propertyBindings
  42913. , a = e._interpolants
  42914. , s = i.uuid
  42915. , l = this._bindingsByRootAndName
  42916. , c = l[s];
  42917. void 0 === c && (c = {},
  42918. l[s] = c);
  42919. for (var h = 0; h !== r; ++h) {
  42920. var u = n[h]
  42921. , d = u.name
  42922. , p = c[d];
  42923. if (void 0 !== p)
  42924. o[h] = p;
  42925. else {
  42926. if (void 0 !== (p = o[h])) {
  42927. null === p._cacheIndex && (++p.referenceCount,
  42928. this._addInactiveBinding(p, s, d));
  42929. continue
  42930. }
  42931. var f = t && t._propertyBindings[h].binding.parsedPath;
  42932. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  42933. this._addInactiveBinding(p, s, d),
  42934. o[h] = p
  42935. }
  42936. a[h].resultBuffer = p.buffer
  42937. }
  42938. },
  42939. _activateAction: function(e) {
  42940. if (!this._isActiveAction(e)) {
  42941. if (null === e._cacheIndex) {
  42942. var t = (e._localRoot || this._root).uuid
  42943. , i = e._clip.name
  42944. , n = this._actionsByClip[i];
  42945. this._bindAction(e, n && n.knownActions[0]),
  42946. this._addInactiveAction(e, i, t)
  42947. }
  42948. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  42949. var s = r[o];
  42950. 0 == s.useCount++ && (this._lendBinding(s),
  42951. s.saveOriginalState())
  42952. }
  42953. this._lendAction(e)
  42954. }
  42955. },
  42956. _deactivateAction: function(e) {
  42957. if (this._isActiveAction(e)) {
  42958. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  42959. var r = t[i];
  42960. 0 == --r.useCount && (r.restoreOriginalState(),
  42961. this._takeBackBinding(r))
  42962. }
  42963. this._takeBackAction(e)
  42964. }
  42965. },
  42966. _initMemoryManager: function() {
  42967. this._actions = [],
  42968. this._nActiveActions = 0,
  42969. this._actionsByClip = {},
  42970. this._bindings = [],
  42971. this._nActiveBindings = 0,
  42972. this._bindingsByRootAndName = {},
  42973. this._controlInterpolants = [],
  42974. this._nActiveControlInterpolants = 0;
  42975. var e = this;
  42976. this.stats = {
  42977. actions: {
  42978. get total() {
  42979. return e._actions.length
  42980. },
  42981. get inUse() {
  42982. return e._nActiveActions
  42983. }
  42984. },
  42985. bindings: {
  42986. get total() {
  42987. return e._bindings.length
  42988. },
  42989. get inUse() {
  42990. return e._nActiveBindings
  42991. }
  42992. },
  42993. controlInterpolants: {
  42994. get total() {
  42995. return e._controlInterpolants.length
  42996. },
  42997. get inUse() {
  42998. return e._nActiveControlInterpolants
  42999. }
  43000. }
  43001. }
  43002. },
  43003. _isActiveAction: function(e) {
  43004. var t = e._cacheIndex;
  43005. return null !== t && t < this._nActiveActions
  43006. },
  43007. _addInactiveAction: function(e, t, i) {
  43008. var n = this._actions
  43009. , r = this._actionsByClip
  43010. , o = r[t];
  43011. if (void 0 === o)
  43012. o = {
  43013. knownActions: [e],
  43014. actionByRoot: {}
  43015. },
  43016. e._byClipCacheIndex = 0,
  43017. r[t] = o;
  43018. else {
  43019. var a = o.knownActions;
  43020. e._byClipCacheIndex = a.length,
  43021. a.push(e)
  43022. }
  43023. e._cacheIndex = n.length,
  43024. n.push(e),
  43025. o.actionByRoot[i] = e
  43026. },
  43027. _removeInactiveAction: function(e) {
  43028. var t = this._actions
  43029. , i = t[t.length - 1]
  43030. , n = e._cacheIndex;
  43031. t[i._cacheIndex = n] = i,
  43032. t.pop(),
  43033. e._cacheIndex = null;
  43034. var r = e._clip.name
  43035. , o = this._actionsByClip
  43036. , a = o[r]
  43037. , s = a.knownActions
  43038. , l = s[s.length - 1]
  43039. , c = e._byClipCacheIndex;
  43040. s[l._byClipCacheIndex = c] = l,
  43041. s.pop(),
  43042. e._byClipCacheIndex = null,
  43043. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  43044. 0 === s.length && delete o[r],
  43045. this._removeInactiveBindingsForAction(e)
  43046. },
  43047. _removeInactiveBindingsForAction: function(e) {
  43048. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43049. var r = t[i];
  43050. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  43051. }
  43052. },
  43053. _lendAction: function(e) {
  43054. var t = this._actions
  43055. , i = e._cacheIndex
  43056. , n = this._nActiveActions++
  43057. , r = t[n];
  43058. t[e._cacheIndex = n] = e,
  43059. t[r._cacheIndex = i] = r
  43060. },
  43061. _takeBackAction: function(e) {
  43062. var t = this._actions
  43063. , i = e._cacheIndex
  43064. , n = --this._nActiveActions
  43065. , r = t[n];
  43066. t[e._cacheIndex = n] = e,
  43067. t[r._cacheIndex = i] = r
  43068. },
  43069. _addInactiveBinding: function(e, t, i) {
  43070. var n = this._bindingsByRootAndName
  43071. , r = n[t]
  43072. , o = this._bindings;
  43073. void 0 === r && (r = {},
  43074. n[t] = r),
  43075. (r[i] = e)._cacheIndex = o.length,
  43076. o.push(e)
  43077. },
  43078. _removeInactiveBinding: function(e) {
  43079. var t = this._bindings
  43080. , i = e.binding
  43081. , n = i.rootNode.uuid
  43082. , r = i.path
  43083. , o = this._bindingsByRootAndName
  43084. , a = o[n]
  43085. , s = t[t.length - 1]
  43086. , l = e._cacheIndex;
  43087. t[s._cacheIndex = l] = s,
  43088. t.pop(),
  43089. delete a[r];
  43090. e: {
  43091. for (var c in a)
  43092. break e;
  43093. delete o[n]
  43094. }
  43095. },
  43096. _lendBinding: function(e) {
  43097. var t = this._bindings
  43098. , i = e._cacheIndex
  43099. , n = this._nActiveBindings++
  43100. , r = t[n];
  43101. t[e._cacheIndex = n] = e,
  43102. t[r._cacheIndex = i] = r
  43103. },
  43104. _takeBackBinding: function(e) {
  43105. var t = this._bindings
  43106. , i = e._cacheIndex
  43107. , n = --this._nActiveBindings
  43108. , r = t[n];
  43109. t[e._cacheIndex = n] = e,
  43110. t[r._cacheIndex = i] = r
  43111. },
  43112. _lendControlInterpolant: function() {
  43113. var e = this._controlInterpolants
  43114. , t = this._nActiveControlInterpolants++
  43115. , i = e[t];
  43116. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  43117. i
  43118. },
  43119. _takeBackControlInterpolant: function(e) {
  43120. var t = this._controlInterpolants
  43121. , i = e.__cacheIndex
  43122. , n = --this._nActiveControlInterpolants
  43123. , r = t[n];
  43124. t[e.__cacheIndex = n] = e,
  43125. t[r.__cacheIndex = i] = r
  43126. },
  43127. _controlInterpolantsResultBuffer: new Float32Array(1)
  43128. }),
  43129. Ci.AnimationObjectGroup = function(e) {
  43130. this.uuid = Ci.Math.generateUUID(),
  43131. this._objects = Array.prototype.slice.call(arguments),
  43132. this.nCachedObjects_ = 0;
  43133. var t = {};
  43134. this._indicesByUUID = t;
  43135. for (var i = 0, n = arguments.length; i !== n; ++i)
  43136. t[arguments[i].uuid] = i;
  43137. this._paths = [],
  43138. this._parsedPaths = [],
  43139. this._bindings = [],
  43140. this._bindingsIndicesByPath = {};
  43141. var r = this;
  43142. this.stats = {
  43143. objects: {
  43144. get total() {
  43145. return r._objects.length
  43146. },
  43147. get inUse() {
  43148. return this.total - r.nCachedObjects_
  43149. }
  43150. },
  43151. get bindingsPerObject() {
  43152. return r._bindings.length
  43153. }
  43154. }
  43155. }
  43156. ,
  43157. Ci.AnimationObjectGroup.prototype = {
  43158. constructor: Ci.AnimationObjectGroup,
  43159. add: function(e) {
  43160. 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) {
  43161. var u = arguments[c]
  43162. , d = u.uuid
  43163. , p = r[d];
  43164. if (void 0 === p) {
  43165. p = i++,
  43166. r[d] = p,
  43167. t.push(u);
  43168. for (var f = 0, g = l; f !== g; ++f)
  43169. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  43170. } else if (p < n) {
  43171. var m = t[p]
  43172. , v = --n
  43173. , y = t[v];
  43174. t[r[y.uuid] = p] = y,
  43175. t[r[d] = v] = u;
  43176. for (f = 0,
  43177. g = l; f !== g; ++f) {
  43178. var A = s[f]
  43179. , C = A[v]
  43180. , I = A[p];
  43181. A[p] = C,
  43182. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  43183. A[v] = I
  43184. }
  43185. } else
  43186. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43187. }
  43188. this.nCachedObjects_ = n
  43189. },
  43190. remove: function(e) {
  43191. for (var t = this._objects, i = (t.length,
  43192. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43193. var l = arguments[a]
  43194. , c = l.uuid
  43195. , h = n[c];
  43196. if (void 0 !== h && i <= h) {
  43197. var u = i++
  43198. , d = t[u];
  43199. t[n[d.uuid] = h] = d,
  43200. t[n[c] = u] = l;
  43201. for (var p = 0, f = o; p !== f; ++p) {
  43202. var g = r[p]
  43203. , m = g[u]
  43204. , v = g[h];
  43205. g[h] = m,
  43206. g[u] = v
  43207. }
  43208. }
  43209. }
  43210. this.nCachedObjects_ = i
  43211. },
  43212. uncache: function(e) {
  43213. 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) {
  43214. var c = arguments[s].uuid
  43215. , h = r[c];
  43216. if (void 0 !== h)
  43217. if (delete r[c],
  43218. h < n) {
  43219. var u = --n
  43220. , d = t[u]
  43221. , p = t[y = --i];
  43222. t[r[d.uuid] = h] = d,
  43223. t[r[p.uuid] = u] = p,
  43224. t.pop();
  43225. for (var f = 0, g = a; f !== g; ++f) {
  43226. var m = (A = o[f])[u]
  43227. , v = A[y];
  43228. A[h] = m,
  43229. A[u] = v,
  43230. A.pop()
  43231. }
  43232. } else {
  43233. var y;
  43234. t[r[(p = t[y = --i]).uuid] = h] = p,
  43235. t.pop();
  43236. for (f = 0,
  43237. g = a; f !== g; ++f) {
  43238. var A;
  43239. (A = o[f])[h] = A[y],
  43240. A.pop()
  43241. }
  43242. }
  43243. }
  43244. this.nCachedObjects_ = n
  43245. },
  43246. subscribe_: function(e, t) {
  43247. var i = this._bindingsIndicesByPath
  43248. , n = i[e]
  43249. , r = this._bindings;
  43250. if (void 0 !== n)
  43251. return r[n];
  43252. var o = this._paths
  43253. , a = this._parsedPaths
  43254. , s = this._objects
  43255. , l = s.length
  43256. , c = this.nCachedObjects_
  43257. , h = new Array(l);
  43258. n = r.length,
  43259. i[e] = n,
  43260. o.push(e),
  43261. a.push(t),
  43262. r.push(h);
  43263. for (var u = c, d = s.length; u !== d; ++u) {
  43264. var p = s[u];
  43265. h[u] = new Ci.PropertyBinding(p,e,t)
  43266. }
  43267. return h
  43268. },
  43269. unsubscribe_: function(e) {
  43270. var t = this._bindingsIndicesByPath
  43271. , i = t[e];
  43272. if (void 0 !== i) {
  43273. var n = this._paths
  43274. , r = this._parsedPaths
  43275. , o = this._bindings
  43276. , a = o.length - 1
  43277. , s = o[a];
  43278. o[t[e[a]] = i] = s,
  43279. o.pop(),
  43280. r[i] = r[a],
  43281. r.pop(),
  43282. n[i] = n[a],
  43283. n.pop()
  43284. }
  43285. }
  43286. },
  43287. Ci.AnimationUtils = {
  43288. arraySlice: function(e, t, i) {
  43289. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43290. },
  43291. convertArray: function(e, t, i) {
  43292. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43293. },
  43294. isTypedArray: function(e) {
  43295. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43296. },
  43297. getKeyframeOrder: function(i) {
  43298. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  43299. t[n] = n;
  43300. return t.sort(function(e, t) {
  43301. return i[e] - i[t]
  43302. }),
  43303. t
  43304. },
  43305. sortedArray: function(e, t, i) {
  43306. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  43307. for (var s = i[o] * t, l = 0; l !== t; ++l)
  43308. r[a++] = e[s + l];
  43309. return r
  43310. },
  43311. flattenJSON: function(e, t, i, n) {
  43312. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  43313. o = e[r++];
  43314. if (void 0 !== o) {
  43315. var a = o[n];
  43316. if (void 0 !== a)
  43317. if (Array.isArray(a))
  43318. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43319. i.push.apply(i, a)),
  43320. void 0 !== (o = e[r++]); )
  43321. ;
  43322. else if (void 0 !== a.toArray)
  43323. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43324. a.toArray(i, i.length)),
  43325. void 0 !== (o = e[r++]); )
  43326. ;
  43327. else
  43328. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43329. i.push(a)),
  43330. void 0 !== (o = e[r++]); )
  43331. ;
  43332. }
  43333. }
  43334. },
  43335. Ci.KeyframeTrack = function(e, t, i, n) {
  43336. if (void 0 === e)
  43337. throw new Error("track name is undefined");
  43338. if (void 0 === t || 0 === t.length)
  43339. throw new Error("no keyframes in track named " + e);
  43340. this.name = e,
  43341. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  43342. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  43343. this.setInterpolation(n || this.DefaultInterpolation),
  43344. this.validate(),
  43345. this.optimize()
  43346. }
  43347. ,
  43348. Ci.KeyframeTrack.prototype = {
  43349. constructor: Ci.KeyframeTrack,
  43350. TimeBufferType: Float32Array,
  43351. ValueBufferType: Float32Array,
  43352. DefaultInterpolation: Ci.InterpolateLinear,
  43353. InterpolantFactoryMethodDiscrete: function(e) {
  43354. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  43355. },
  43356. InterpolantFactoryMethodLinear: function(e) {
  43357. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43358. },
  43359. InterpolantFactoryMethodSmooth: function(e) {
  43360. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  43361. },
  43362. setInterpolation: function(e) {
  43363. var t = void 0;
  43364. switch (e) {
  43365. case Ci.InterpolateDiscrete:
  43366. t = this.InterpolantFactoryMethodDiscrete;
  43367. break;
  43368. case Ci.InterpolateLinear:
  43369. t = this.InterpolantFactoryMethodLinear;
  43370. break;
  43371. case Ci.InterpolateSmooth:
  43372. t = this.InterpolantFactoryMethodSmooth
  43373. }
  43374. if (void 0 !== t)
  43375. this.createInterpolant = t;
  43376. else {
  43377. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  43378. if (void 0 === this.createInterpolant) {
  43379. if (e === this.DefaultInterpolation)
  43380. throw new Error(i);
  43381. this.setInterpolation(this.DefaultInterpolation)
  43382. }
  43383. console.warn(i)
  43384. }
  43385. },
  43386. getInterpolation: function() {
  43387. switch (this.createInterpolant) {
  43388. case this.InterpolantFactoryMethodDiscrete:
  43389. return Ci.InterpolateDiscrete;
  43390. case this.InterpolantFactoryMethodLinear:
  43391. return Ci.InterpolateLinear;
  43392. case this.InterpolantFactoryMethodSmooth:
  43393. return Ci.InterpolateSmooth
  43394. }
  43395. },
  43396. getValueSize: function() {
  43397. return this.values.length / this.times.length
  43398. },
  43399. shift: function(e) {
  43400. if (0 !== e)
  43401. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43402. t[i] += e;
  43403. return this
  43404. },
  43405. scale: function(e) {
  43406. if (1 !== e)
  43407. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43408. t[i] *= e;
  43409. return this
  43410. },
  43411. trim: function(e, t) {
  43412. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  43413. ++r;
  43414. for (; -1 !== o && i[o] > t; )
  43415. --o;
  43416. if (++o,
  43417. 0 !== r || o !== n) {
  43418. o <= r && (r = (o = Math.max(o, 1)) - 1);
  43419. var a = this.getValueSize();
  43420. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  43421. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  43422. }
  43423. return this
  43424. },
  43425. validate: function() {
  43426. var e = !0
  43427. , t = this.getValueSize();
  43428. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  43429. e = !1);
  43430. var i = this.times
  43431. , n = this.values
  43432. , r = i.length;
  43433. 0 === r && (console.error("track is empty", this),
  43434. e = !1);
  43435. for (var o = null, a = 0; a !== r; a++) {
  43436. var s = i[a];
  43437. if ("number" == typeof s && isNaN(s)) {
  43438. console.error("time is not a valid number", this, a, s),
  43439. e = !1;
  43440. break
  43441. }
  43442. if (null !== o && s < o) {
  43443. console.error("out of order keys", this, a, s, o),
  43444. e = !1;
  43445. break
  43446. }
  43447. o = s
  43448. }
  43449. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  43450. a = 0;
  43451. for (var l = n.length; a !== l; ++a) {
  43452. var c = n[a];
  43453. if (isNaN(c)) {
  43454. console.error("value is not a valid number", this, a, c),
  43455. e = !1;
  43456. break
  43457. }
  43458. }
  43459. }
  43460. return e
  43461. },
  43462. optimize: function() {
  43463. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  43464. var a = !1
  43465. , s = e[r];
  43466. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  43467. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  43468. var d = t[l + u];
  43469. if (d !== t[c + u] || d !== t[h + u]) {
  43470. a = !0;
  43471. break
  43472. }
  43473. }
  43474. if (a) {
  43475. if (r !== n) {
  43476. e[n] = e[r];
  43477. var p = r * i
  43478. , f = n * i;
  43479. for (u = 0; u !== i; ++u)
  43480. t[f + u] = t[p + u]
  43481. }
  43482. ++n
  43483. }
  43484. }
  43485. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  43486. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  43487. this
  43488. }
  43489. },
  43490. Object.assign(Ci.KeyframeTrack, {
  43491. parse: function(e) {
  43492. if (void 0 === e.type)
  43493. throw new Error("track type undefined, can not parse");
  43494. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  43495. if (void 0 === e.times) {
  43496. console.warn("legacy JSON format detected, converting");
  43497. var i = []
  43498. , n = [];
  43499. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  43500. e.times = i,
  43501. e.values = n
  43502. }
  43503. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  43504. },
  43505. toJSON: function(e) {
  43506. var t, i = e.constructor;
  43507. if (void 0 !== i.toJSON)
  43508. t = i.toJSON(e);
  43509. else {
  43510. t = {
  43511. name: e.name,
  43512. times: Ci.AnimationUtils.convertArray(e.times, Array),
  43513. values: Ci.AnimationUtils.convertArray(e.values, Array)
  43514. };
  43515. var n = e.getInterpolation();
  43516. n !== e.DefaultInterpolation && (t.interpolation = n)
  43517. }
  43518. return t.type = e.ValueTypeName,
  43519. t
  43520. },
  43521. _getTrackTypeForValueTypeName: function(e) {
  43522. switch (e.toLowerCase()) {
  43523. case "scalar":
  43524. case "double":
  43525. case "float":
  43526. case "number":
  43527. case "integer":
  43528. return Ci.NumberKeyframeTrack;
  43529. case "vector":
  43530. case "vector2":
  43531. case "vector3":
  43532. case "vector4":
  43533. return Ci.VectorKeyframeTrack;
  43534. case "color":
  43535. return Ci.ColorKeyframeTrack;
  43536. case "quaternion":
  43537. return Ci.QuaternionKeyframeTrack;
  43538. case "bool":
  43539. case "boolean":
  43540. return Ci.BooleanKeyframeTrack;
  43541. case "string":
  43542. return Ci.StringKeyframeTrack
  43543. }
  43544. throw new Error("Unsupported typeName: " + e)
  43545. }
  43546. }),
  43547. Ci.PropertyBinding = function(e, t, i) {
  43548. this.path = t,
  43549. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  43550. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  43551. this.rootNode = e
  43552. }
  43553. ,
  43554. Ci.PropertyBinding.prototype = {
  43555. constructor: Ci.PropertyBinding,
  43556. getValue: function(e, t) {
  43557. this.bind(),
  43558. this.getValue(e, t)
  43559. },
  43560. setValue: function(e, t) {
  43561. this.bind(),
  43562. this.setValue(e, t)
  43563. },
  43564. bind: function() {
  43565. var e = this.node
  43566. , t = this.parsedPath
  43567. , i = t.objectName
  43568. , n = t.propertyName
  43569. , r = t.propertyIndex;
  43570. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  43571. this.node = e),
  43572. this.getValue = this._getValue_unavailable,
  43573. this.setValue = this._setValue_unavailable,
  43574. e) {
  43575. if (i) {
  43576. var o = t.objectIndex;
  43577. switch (i) {
  43578. case "materials":
  43579. if (!e.material)
  43580. return void console.error(" can not bind to material as node does not have a material", this);
  43581. if (!e.material.materials)
  43582. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  43583. e = e.material.materials;
  43584. break;
  43585. case "bones":
  43586. if (!e.skeleton)
  43587. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  43588. e = e.skeleton.bones;
  43589. for (var a = 0; a < e.length; a++)
  43590. if (e[a].name === o) {
  43591. o = a;
  43592. break
  43593. }
  43594. break;
  43595. default:
  43596. if (void 0 === e[i])
  43597. return void console.error(" can not bind to objectName of node, undefined", this);
  43598. e = e[i]
  43599. }
  43600. if (void 0 !== o) {
  43601. if (void 0 === e[o])
  43602. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  43603. e = e[o]
  43604. }
  43605. }
  43606. var s = e[n];
  43607. if (s) {
  43608. var l = this.Versioning.None;
  43609. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  43610. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  43611. this.targetObject = e);
  43612. var c = this.BindingType.Direct;
  43613. if (void 0 !== r) {
  43614. if ("morphTargetInfluences" === n) {
  43615. if (!e.geometry)
  43616. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  43617. if (!e.geometry.morphTargets)
  43618. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  43619. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  43620. if (e.geometry.morphTargets[a].name === r) {
  43621. r = a;
  43622. break
  43623. }
  43624. }
  43625. c = this.BindingType.ArrayElement,
  43626. this.resolvedProperty = s,
  43627. this.propertyIndex = r
  43628. } else
  43629. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  43630. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  43631. this.resolvedProperty = s) : this.propertyName = n;
  43632. this.getValue = this.GetterByBindingType[c],
  43633. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  43634. } else {
  43635. var h = t.nodeName;
  43636. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  43637. }
  43638. } else
  43639. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  43640. },
  43641. unbind: function() {
  43642. this.node = null,
  43643. this.getValue = this._getValue_unbound,
  43644. this.setValue = this._setValue_unbound
  43645. }
  43646. },
  43647. Object.assign(Ci.PropertyBinding.prototype, {
  43648. _getValue_unavailable: function() {},
  43649. _setValue_unavailable: function() {},
  43650. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  43651. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  43652. BindingType: {
  43653. Direct: 0,
  43654. EntireArray: 1,
  43655. ArrayElement: 2,
  43656. HasFromToArray: 3
  43657. },
  43658. Versioning: {
  43659. None: 0,
  43660. NeedsUpdate: 1,
  43661. MatrixWorldNeedsUpdate: 2
  43662. },
  43663. GetterByBindingType: [function(e, t) {
  43664. e[t] = this.node[this.propertyName]
  43665. }
  43666. , function(e, t) {
  43667. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43668. e[t++] = i[n]
  43669. }
  43670. , function(e, t) {
  43671. e[t] = this.resolvedProperty[this.propertyIndex]
  43672. }
  43673. , function(e, t) {
  43674. this.resolvedProperty.toArray(e, t)
  43675. }
  43676. ],
  43677. SetterByBindingTypeAndVersioning: [[function(e, t) {
  43678. this.node[this.propertyName] = e[t]
  43679. }
  43680. , function(e, t) {
  43681. this.node[this.propertyName] = e[t],
  43682. this.targetObject.needsUpdate = !0
  43683. }
  43684. , function(e, t) {
  43685. this.node[this.propertyName] = e[t],
  43686. this.targetObject.matrixWorldNeedsUpdate = !0
  43687. }
  43688. ], [function(e, t) {
  43689. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43690. i[n] = e[t++]
  43691. }
  43692. , function(e, t) {
  43693. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43694. i[n] = e[t++];
  43695. this.targetObject.needsUpdate = !0
  43696. }
  43697. , function(e, t) {
  43698. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43699. i[n] = e[t++];
  43700. this.targetObject.matrixWorldNeedsUpdate = !0
  43701. }
  43702. ], [function(e, t) {
  43703. this.resolvedProperty[this.propertyIndex] = e[t]
  43704. }
  43705. , function(e, t) {
  43706. this.resolvedProperty[this.propertyIndex] = e[t],
  43707. this.targetObject.needsUpdate = !0
  43708. }
  43709. , function(e, t) {
  43710. this.resolvedProperty[this.propertyIndex] = e[t],
  43711. this.targetObject.matrixWorldNeedsUpdate = !0
  43712. }
  43713. ], [function(e, t) {
  43714. this.resolvedProperty.fromArray(e, t)
  43715. }
  43716. , function(e, t) {
  43717. this.resolvedProperty.fromArray(e, t),
  43718. this.targetObject.needsUpdate = !0
  43719. }
  43720. , function(e, t) {
  43721. this.resolvedProperty.fromArray(e, t),
  43722. this.targetObject.matrixWorldNeedsUpdate = !0
  43723. }
  43724. ]]
  43725. }),
  43726. Ci.PropertyBinding.Composite = function(e, t, i) {
  43727. var n = i || Ci.PropertyBinding.parseTrackName(t);
  43728. this._targetGroup = e,
  43729. this._bindings = e.subscribe_(t, n)
  43730. }
  43731. ,
  43732. Ci.PropertyBinding.Composite.prototype = {
  43733. constructor: Ci.PropertyBinding.Composite,
  43734. getValue: function(e, t) {
  43735. this.bind();
  43736. var i = this._targetGroup.nCachedObjects_
  43737. , n = this._bindings[i];
  43738. void 0 !== n && n.getValue(e, t)
  43739. },
  43740. setValue: function(e, t) {
  43741. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  43742. i[n].setValue(e, t)
  43743. },
  43744. bind: function() {
  43745. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  43746. e[t].bind()
  43747. },
  43748. unbind: function() {
  43749. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  43750. e[t].unbind()
  43751. }
  43752. },
  43753. Ci.PropertyBinding.create = function(e, t, i) {
  43754. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  43755. }
  43756. ,
  43757. Ci.PropertyBinding.parseTrackName = function(e) {
  43758. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  43759. , i = t.exec(e);
  43760. if (!i)
  43761. throw new Error("cannot parse trackName at all: " + e);
  43762. i.index === t.lastIndex && t.lastIndex++;
  43763. var n = {
  43764. nodeName: i[3],
  43765. objectName: i[5],
  43766. objectIndex: i[7],
  43767. propertyName: i[9],
  43768. propertyIndex: i[11]
  43769. };
  43770. if (null === n.propertyName || 0 === n.propertyName.length)
  43771. throw new Error("can not parse propertyName from trackName: " + e);
  43772. return n
  43773. }
  43774. ,
  43775. Ci.PropertyBinding.findNode = function(e, r) {
  43776. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  43777. return e;
  43778. if (e.skeleton) {
  43779. var t = function(e) {
  43780. for (var t = 0; t < e.bones.length; t++) {
  43781. var i = e.bones[t];
  43782. if (i.name === r)
  43783. return i
  43784. }
  43785. return null
  43786. }(e.skeleton);
  43787. if (t)
  43788. return t
  43789. }
  43790. if (e.children) {
  43791. var o = function(e) {
  43792. for (var t = 0; t < e.length; t++) {
  43793. var i = e[t];
  43794. if (i.name === r || i.uuid === r)
  43795. return i;
  43796. var n = o(i.children);
  43797. if (n)
  43798. return n
  43799. }
  43800. return null
  43801. }
  43802. , i = o(e.children);
  43803. if (i)
  43804. return i
  43805. }
  43806. return null
  43807. }
  43808. ,
  43809. Ci.PropertyMixer = function(e, t, i) {
  43810. this.binding = e,
  43811. this.valueSize = i;
  43812. var n, r = Float64Array;
  43813. switch (t) {
  43814. case "quaternion":
  43815. n = this._slerp;
  43816. break;
  43817. case "string":
  43818. case "bool":
  43819. r = Array,
  43820. n = this._select;
  43821. break;
  43822. default:
  43823. n = this._lerp
  43824. }
  43825. this.buffer = new r(4 * i),
  43826. this._mixBufferRegion = n,
  43827. this.cumulativeWeight = 0,
  43828. this.useCount = 0,
  43829. this.referenceCount = 0
  43830. }
  43831. ,
  43832. Ci.PropertyMixer.prototype = {
  43833. constructor: Ci.PropertyMixer,
  43834. accumulate: function(e, t) {
  43835. var i = this.buffer
  43836. , n = this.valueSize
  43837. , r = e * n + n
  43838. , o = this.cumulativeWeight;
  43839. if (0 === o) {
  43840. for (var a = 0; a !== n; ++a)
  43841. i[r + a] = i[a];
  43842. o = t
  43843. } else {
  43844. var s = t / (o += t);
  43845. this._mixBufferRegion(i, r, 0, s, n)
  43846. }
  43847. this.cumulativeWeight = o
  43848. },
  43849. apply: function(e) {
  43850. var t = this.valueSize
  43851. , i = this.buffer
  43852. , n = e * t + t
  43853. , r = this.cumulativeWeight
  43854. , o = this.binding;
  43855. if (this.cumulativeWeight = 0,
  43856. r < 1) {
  43857. var a = 3 * t;
  43858. this._mixBufferRegion(i, n, a, 1 - r, t)
  43859. }
  43860. for (var s = t, l = t + t; s !== l; ++s)
  43861. if (i[s] !== i[s + t]) {
  43862. o.setValue(i, n);
  43863. break
  43864. }
  43865. },
  43866. saveOriginalState: function() {
  43867. var e = this.binding
  43868. , t = this.buffer
  43869. , i = this.valueSize
  43870. , n = 3 * i;
  43871. e.getValue(t, n);
  43872. for (var r = i, o = n; r !== o; ++r)
  43873. t[r] = t[n + r % i];
  43874. this.cumulativeWeight = 0
  43875. },
  43876. restoreOriginalState: function() {
  43877. var e = 3 * this.valueSize;
  43878. this.binding.setValue(this.buffer, e)
  43879. },
  43880. _select: function(e, t, i, n, r) {
  43881. if (.5 <= n)
  43882. for (var o = 0; o !== r; ++o)
  43883. e[t + o] = e[i + o]
  43884. },
  43885. _slerp: function(e, t, i, n, r) {
  43886. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  43887. },
  43888. _lerp: function(e, t, i, n, r) {
  43889. for (var o = 1 - n, a = 0; a !== r; ++a) {
  43890. var s = t + a;
  43891. e[s] = e[s] * o + e[i + a] * n
  43892. }
  43893. }
  43894. },
  43895. Ci.BooleanKeyframeTrack = function(e, t, i) {
  43896. Ci.KeyframeTrack.call(this, e, t, i)
  43897. }
  43898. ,
  43899. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  43900. constructor: Ci.BooleanKeyframeTrack,
  43901. ValueTypeName: "bool",
  43902. ValueBufferType: Array,
  43903. DefaultInterpolation: Ci.IntepolateDiscrete,
  43904. InterpolantFactoryMethodLinear: void 0,
  43905. InterpolantFactoryMethodSmooth: void 0
  43906. }),
  43907. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  43908. Ci.KeyframeTrack.call(this, e, t, i, n)
  43909. }
  43910. ,
  43911. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  43912. constructor: Ci.NumberKeyframeTrack,
  43913. ValueTypeName: "number"
  43914. }),
  43915. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  43916. Ci.KeyframeTrack.call(this, e, t, i, n)
  43917. }
  43918. ,
  43919. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  43920. constructor: Ci.QuaternionKeyframeTrack,
  43921. ValueTypeName: "quaternion",
  43922. DefaultInterpolation: Ci.InterpolateLinear,
  43923. InterpolantFactoryMethodLinear: function(e) {
  43924. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43925. },
  43926. InterpolantFactoryMethodSmooth: void 0
  43927. }),
  43928. Ci.StringKeyframeTrack = function(e, t, i, n) {
  43929. Ci.KeyframeTrack.call(this, e, t, i, n)
  43930. }
  43931. ,
  43932. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  43933. constructor: Ci.StringKeyframeTrack,
  43934. ValueTypeName: "string",
  43935. ValueBufferType: Array,
  43936. DefaultInterpolation: Ci.IntepolateDiscrete,
  43937. InterpolantFactoryMethodLinear: void 0,
  43938. InterpolantFactoryMethodSmooth: void 0
  43939. }),
  43940. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  43941. Ci.KeyframeTrack.call(this, e, t, i, n)
  43942. }
  43943. ,
  43944. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  43945. constructor: Ci.VectorKeyframeTrack,
  43946. ValueTypeName: "vector"
  43947. }),
  43948. Ci.Audio = function(e) {
  43949. Ci.Object3D.call(this),
  43950. this.type = "Audio",
  43951. this.context = e.context,
  43952. this.source = this.context.createBufferSource(),
  43953. this.source.onended = this.onEnded.bind(this),
  43954. this.gain = this.context.createGain(),
  43955. this.gain.connect(e.getInput()),
  43956. this.autoplay = !1,
  43957. this.startTime = 0,
  43958. this.playbackRate = 1,
  43959. this.isPlaying = !1,
  43960. this.hasPlaybackControl = !0,
  43961. this.sourceType = "empty",
  43962. this.filter = null
  43963. }
  43964. ,
  43965. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  43966. Ci.Audio.prototype.constructor = Ci.Audio,
  43967. Ci.Audio.prototype.getOutput = function() {
  43968. return this.gain
  43969. }
  43970. ,
  43971. Ci.Audio.prototype.load = function(e) {
  43972. var t = new Ci.AudioBuffer(this.context);
  43973. return t.load(e),
  43974. this.setBuffer(t),
  43975. this
  43976. }
  43977. ,
  43978. Ci.Audio.prototype.setNodeSource = function(e) {
  43979. return this.hasPlaybackControl = !1,
  43980. this.sourceType = "audioNode",
  43981. this.source = e,
  43982. this.connect(),
  43983. this
  43984. }
  43985. ,
  43986. Ci.Audio.prototype.setBuffer = function(e) {
  43987. var t = this;
  43988. return e.onReady(function(e) {
  43989. t.source.buffer = e,
  43990. t.sourceType = "buffer",
  43991. t.autoplay && t.play()
  43992. }),
  43993. this
  43994. }
  43995. ,
  43996. Ci.Audio.prototype.play = function() {
  43997. if (!0 !== this.isPlaying)
  43998. if (!1 !== this.hasPlaybackControl) {
  43999. var e = this.context.createBufferSource();
  44000. e.buffer = this.source.buffer,
  44001. e.loop = this.source.loop,
  44002. e.onended = this.source.onended,
  44003. e.start(0, this.startTime),
  44004. e.playbackRate.value = this.playbackRate,
  44005. this.isPlaying = !0,
  44006. this.source = e,
  44007. this.connect()
  44008. } else
  44009. console.warn("THREE.Audio: this Audio has no playback control.");
  44010. else
  44011. console.warn("THREE.Audio: Audio is already playing.")
  44012. }
  44013. ,
  44014. Ci.Audio.prototype.pause = function() {
  44015. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44016. void (this.startTime = this.context.currentTime))
  44017. }
  44018. ,
  44019. Ci.Audio.prototype.stop = function() {
  44020. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44021. void (this.startTime = 0))
  44022. }
  44023. ,
  44024. Ci.Audio.prototype.connect = function() {
  44025. null !== this.filter ? (this.source.connect(this.filter),
  44026. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44027. }
  44028. ,
  44029. Ci.Audio.prototype.disconnect = function() {
  44030. null !== this.filter ? (this.source.disconnect(this.filter),
  44031. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44032. }
  44033. ,
  44034. Ci.Audio.prototype.getFilter = function() {
  44035. return this.filter
  44036. }
  44037. ,
  44038. Ci.Audio.prototype.setFilter = function(e) {
  44039. void 0 === e && (e = null),
  44040. !0 === this.isPlaying ? (this.disconnect(),
  44041. this.filter = e,
  44042. this.connect()) : this.filter = e
  44043. }
  44044. ,
  44045. Ci.Audio.prototype.setPlaybackRate = function(e) {
  44046. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44047. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  44048. }
  44049. ,
  44050. Ci.Audio.prototype.getPlaybackRate = function() {
  44051. return this.playbackRate
  44052. }
  44053. ,
  44054. Ci.Audio.prototype.onEnded = function() {
  44055. this.isPlaying = !1
  44056. }
  44057. ,
  44058. Ci.Audio.prototype.setLoop = function(e) {
  44059. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44060. }
  44061. ,
  44062. Ci.Audio.prototype.getLoop = function() {
  44063. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44064. !1) : this.source.loop
  44065. }
  44066. ,
  44067. Ci.Audio.prototype.setVolume = function(e) {
  44068. this.gain.gain.value = e
  44069. }
  44070. ,
  44071. Ci.Audio.prototype.getVolume = function() {
  44072. return this.gain.gain.value
  44073. }
  44074. ,
  44075. Ci.AudioAnalyser = function(e, t) {
  44076. this.analyser = e.context.createAnalyser(),
  44077. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44078. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44079. e.getOutput().connect(this.analyser)
  44080. }
  44081. ,
  44082. Ci.AudioAnalyser.prototype = {
  44083. constructor: Ci.AudioAnalyser,
  44084. getData: function() {
  44085. return this.analyser.getByteFrequencyData(this.data),
  44086. this.data
  44087. }
  44088. },
  44089. Ci.AudioBuffer = function(e) {
  44090. this.context = e,
  44091. this.ready = !1,
  44092. this.readyCallbacks = []
  44093. }
  44094. ,
  44095. Ci.AudioBuffer.prototype.load = function(e) {
  44096. var i = this
  44097. , t = new XMLHttpRequest;
  44098. return t.open("GET", e, !0),
  44099. t.responseType = "arraybuffer",
  44100. t.onload = function(e) {
  44101. i.context.decodeAudioData(this.response, function(e) {
  44102. i.buffer = e,
  44103. i.ready = !0;
  44104. for (var t = 0; t < i.readyCallbacks.length; t++)
  44105. i.readyCallbacks[t](i.buffer);
  44106. i.readyCallbacks = []
  44107. })
  44108. }
  44109. ,
  44110. t.send(),
  44111. this
  44112. }
  44113. ,
  44114. Ci.AudioBuffer.prototype.onReady = function(e) {
  44115. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44116. }
  44117. ,
  44118. Ci.PositionalAudio = function(e) {
  44119. Ci.Audio.call(this, e),
  44120. this.panner = this.context.createPanner(),
  44121. this.panner.connect(this.gain)
  44122. }
  44123. ,
  44124. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  44125. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  44126. Ci.PositionalAudio.prototype.getOutput = function() {
  44127. return this.panner
  44128. }
  44129. ,
  44130. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  44131. this.panner.refDistance = e
  44132. }
  44133. ,
  44134. Ci.PositionalAudio.prototype.getRefDistance = function() {
  44135. return this.panner.refDistance
  44136. }
  44137. ,
  44138. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44139. this.panner.rolloffFactor = e
  44140. }
  44141. ,
  44142. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  44143. return this.panner.rolloffFactor
  44144. }
  44145. ,
  44146. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  44147. this.panner.distanceModel = e
  44148. }
  44149. ,
  44150. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  44151. return this.panner.distanceModel
  44152. }
  44153. ,
  44154. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  44155. this.panner.maxDistance = e
  44156. }
  44157. ,
  44158. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  44159. return this.panner.maxDistance
  44160. }
  44161. ,
  44162. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  44163. function(e) {
  44164. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  44165. it.setFromMatrixPosition(this.matrixWorld),
  44166. this.panner.setPosition(it.x, it.y, it.z)
  44167. }
  44168. ),
  44169. Ci.AudioListener = function() {
  44170. Ci.Object3D.call(this),
  44171. this.type = "AudioListener",
  44172. this.context = new (window.AudioContext || window.webkitAudioContext),
  44173. this.gain = this.context.createGain(),
  44174. this.gain.connect(this.context.destination),
  44175. this.filter = null
  44176. }
  44177. ,
  44178. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  44179. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  44180. Ci.AudioListener.prototype.getInput = function() {
  44181. return this.gain
  44182. }
  44183. ,
  44184. Ci.AudioListener.prototype.removeFilter = function() {
  44185. null !== this.filter && (this.gain.disconnect(this.filter),
  44186. this.filter.disconnect(this.context.destination),
  44187. this.gain.connect(this.context.destination),
  44188. this.filter = null)
  44189. }
  44190. ,
  44191. Ci.AudioListener.prototype.setFilter = function(e) {
  44192. null !== this.filter ? (this.gain.disconnect(this.filter),
  44193. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44194. this.filter = e,
  44195. this.gain.connect(this.filter),
  44196. this.filter.connect(this.context.destination)
  44197. }
  44198. ,
  44199. Ci.AudioListener.prototype.getFilter = function() {
  44200. return this.filter
  44201. }
  44202. ,
  44203. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  44204. this.gain.gain.value = e
  44205. }
  44206. ,
  44207. Ci.AudioListener.prototype.getMasterVolume = function() {
  44208. return this.gain.gain.value
  44209. }
  44210. ,
  44211. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  44212. $e = new Ci.Quaternion,
  44213. et = new Ci.Vector3,
  44214. tt = new Ci.Vector3,
  44215. function(e) {
  44216. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  44217. var t = this.context.listener
  44218. , i = this.up;
  44219. this.matrixWorld.decompose(Je, $e, et),
  44220. tt.set(0, 0, -1).applyQuaternion($e),
  44221. t.setPosition(Je.x, Je.y, Je.z),
  44222. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  44223. }
  44224. ),
  44225. Ci.Camera = function() {
  44226. Ci.Object3D.call(this),
  44227. this.type = "Camera",
  44228. this.matrixWorldInverse = new Ci.Matrix4,
  44229. this.projectionMatrix = new Ci.Matrix4
  44230. }
  44231. ,
  44232. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  44233. Ci.Camera.prototype.constructor = Ci.Camera,
  44234. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  44235. function(e) {
  44236. var t = e || new Ci.Vector3;
  44237. return this.getWorldQuaternion(Qe),
  44238. t.set(0, 0, -1).applyQuaternion(Qe)
  44239. }
  44240. ),
  44241. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  44242. function(e) {
  44243. Ke.lookAt(this.position, e, this.up),
  44244. this.quaternion.setFromRotationMatrix(Ke)
  44245. }
  44246. ),
  44247. Ci.Camera.prototype.clone = function() {
  44248. return (new this.constructor).copy(this)
  44249. }
  44250. ,
  44251. Ci.Camera.prototype.copy = function(e) {
  44252. return Ci.Object3D.prototype.copy.call(this, e),
  44253. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44254. this.projectionMatrix.copy(e.projectionMatrix),
  44255. this
  44256. }
  44257. ,
  44258. Ci.CubeCamera = function(e, t, i) {
  44259. Ci.Object3D.call(this),
  44260. this.type = "CubeCamera";
  44261. var r = new Ci.PerspectiveCamera(90,1,e,t);
  44262. r.up.set(0, -1, 0),
  44263. r.lookAt(new Ci.Vector3(1,0,0)),
  44264. this.add(r);
  44265. var o = new Ci.PerspectiveCamera(90,1,e,t);
  44266. o.up.set(0, -1, 0),
  44267. o.lookAt(new Ci.Vector3(-1,0,0)),
  44268. this.add(o);
  44269. var a = new Ci.PerspectiveCamera(90,1,e,t);
  44270. a.up.set(0, 0, 1),
  44271. a.lookAt(new Ci.Vector3(0,1,0)),
  44272. this.add(a);
  44273. var s = new Ci.PerspectiveCamera(90,1,e,t);
  44274. s.up.set(0, 0, -1),
  44275. s.lookAt(new Ci.Vector3(0,-1,0)),
  44276. this.add(s);
  44277. var l = new Ci.PerspectiveCamera(90,1,e,t);
  44278. l.up.set(0, -1, 0),
  44279. l.lookAt(new Ci.Vector3(0,0,1)),
  44280. this.add(l);
  44281. var c = new Ci.PerspectiveCamera(90,1,e,t);
  44282. c.up.set(0, -1, 0),
  44283. c.lookAt(new Ci.Vector3(0,0,-1)),
  44284. this.add(c);
  44285. var n = {
  44286. format: Ci.RGBFormat,
  44287. magFilter: Ci.LinearFilter,
  44288. minFilter: Ci.LinearFilter
  44289. };
  44290. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  44291. this.updateCubeMap = function(e, t) {
  44292. null === this.parent && this.updateMatrixWorld();
  44293. var i = this.renderTarget
  44294. , n = i.texture.generateMipmaps;
  44295. i.texture.generateMipmaps = !1,
  44296. i.activeCubeFace = 0,
  44297. e.render(t, r, i),
  44298. i.activeCubeFace = 1,
  44299. e.render(t, o, i),
  44300. i.activeCubeFace = 2,
  44301. e.render(t, a, i),
  44302. i.activeCubeFace = 3,
  44303. e.render(t, s, i),
  44304. i.activeCubeFace = 4,
  44305. e.render(t, l, i),
  44306. i.texture.generateMipmaps = n,
  44307. i.activeCubeFace = 5,
  44308. e.render(t, c, i),
  44309. e.setRenderTarget(null)
  44310. }
  44311. }
  44312. ,
  44313. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  44314. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  44315. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  44316. Ci.Camera.call(this),
  44317. this.type = "OrthographicCamera",
  44318. this.zoom = 1,
  44319. this.left = e,
  44320. this.right = t,
  44321. this.top = i,
  44322. this.bottom = n,
  44323. this.near = void 0 !== r ? r : .1,
  44324. this.far = void 0 !== o ? o : 2e3,
  44325. this.updateProjectionMatrix()
  44326. }
  44327. ,
  44328. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  44329. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  44330. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  44331. var e = (this.right - this.left) / (2 * this.zoom)
  44332. , t = (this.top - this.bottom) / (2 * this.zoom)
  44333. , i = (this.right + this.left) / 2
  44334. , n = (this.top + this.bottom) / 2;
  44335. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44336. }
  44337. ,
  44338. Ci.OrthographicCamera.prototype.copy = function(e) {
  44339. return Ci.Camera.prototype.copy.call(this, e),
  44340. this.left = e.left,
  44341. this.right = e.right,
  44342. this.top = e.top,
  44343. this.bottom = e.bottom,
  44344. this.near = e.near,
  44345. this.far = e.far,
  44346. this.zoom = e.zoom,
  44347. this
  44348. }
  44349. ,
  44350. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  44351. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44352. return t.object.zoom = this.zoom,
  44353. t.object.left = this.left,
  44354. t.object.right = this.right,
  44355. t.object.top = this.top,
  44356. t.object.bottom = this.bottom,
  44357. t.object.near = this.near,
  44358. t.object.far = this.far,
  44359. t
  44360. }
  44361. ,
  44362. Ci.PerspectiveCamera = function(e, t, i, n) {
  44363. Ci.Camera.call(this),
  44364. this.type = "PerspectiveCamera",
  44365. this.focalLength = 10,
  44366. this.zoom = 1,
  44367. this.fov = void 0 !== e ? e : 50,
  44368. this.aspect = void 0 !== t ? t : 1,
  44369. this.near = void 0 !== i ? i : .1,
  44370. this.far = void 0 !== n ? n : 2e3,
  44371. this.updateProjectionMatrix()
  44372. }
  44373. ,
  44374. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  44375. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  44376. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  44377. void 0 === t && (t = 24),
  44378. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  44379. this.updateProjectionMatrix()
  44380. }
  44381. ,
  44382. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  44383. this.fullWidth = e,
  44384. this.fullHeight = t,
  44385. this.x = i,
  44386. this.y = n,
  44387. this.width = r,
  44388. this.height = o,
  44389. this.updateProjectionMatrix()
  44390. }
  44391. ,
  44392. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  44393. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  44394. if (this.fullWidth) {
  44395. var t = this.fullWidth / this.fullHeight
  44396. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  44397. , n = -i
  44398. , r = t * n
  44399. , o = t * i
  44400. , a = Math.abs(o - r)
  44401. , s = Math.abs(i - n);
  44402. 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)
  44403. } else
  44404. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  44405. }
  44406. ,
  44407. Ci.PerspectiveCamera.prototype.copy = function(e) {
  44408. return Ci.Camera.prototype.copy.call(this, e),
  44409. this.focalLength = e.focalLength,
  44410. this.zoom = e.zoom,
  44411. this.fov = e.fov,
  44412. this.aspect = e.aspect,
  44413. this.near = e.near,
  44414. this.far = e.far,
  44415. this
  44416. }
  44417. ,
  44418. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  44419. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44420. return t.object.focalLength = this.focalLength,
  44421. t.object.zoom = this.zoom,
  44422. t.object.fov = this.fov,
  44423. t.object.aspect = this.aspect,
  44424. t.object.near = this.near,
  44425. t.object.far = this.far,
  44426. t
  44427. }
  44428. ,
  44429. Ci.StereoCamera = function() {
  44430. this.type = "StereoCamera",
  44431. this.aspect = 1,
  44432. this.cameraL = new Ci.PerspectiveCamera,
  44433. this.cameraL.layers.enable(1),
  44434. this.cameraL.matrixAutoUpdate = !1,
  44435. this.cameraR = new Ci.PerspectiveCamera,
  44436. this.cameraR.layers.enable(2),
  44437. this.cameraR.matrixAutoUpdate = !1
  44438. }
  44439. ,
  44440. Ci.StereoCamera.prototype = {
  44441. constructor: Ci.StereoCamera,
  44442. update: (Xe = new Ci.Matrix4,
  44443. Ze = new Ci.Matrix4,
  44444. function(e) {
  44445. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  44446. Ge = e.focalLength,
  44447. We = e.fov,
  44448. je = e.aspect * this.aspect,
  44449. Ye = e.near,
  44450. qe = e.far;
  44451. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  44452. Ze.elements[12] = -.032,
  44453. Xe.elements[12] = .032,
  44454. t = -o * je + r,
  44455. i = o * je + r,
  44456. n.elements[0] = 2 * Ye / (i - t),
  44457. n.elements[8] = (i + t) / (i - t),
  44458. this.cameraL.projectionMatrix.copy(n),
  44459. t = -o * je - r,
  44460. i = o * je - r,
  44461. n.elements[0] = 2 * Ye / (i - t),
  44462. n.elements[8] = (i + t) / (i - t),
  44463. this.cameraR.projectionMatrix.copy(n)
  44464. }
  44465. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  44466. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  44467. }
  44468. )
  44469. },
  44470. Ci.Light = function(e, t) {
  44471. Ci.Object3D.call(this),
  44472. this.type = "Light",
  44473. this.color = new Ci.Color(e),
  44474. this.intensity = void 0 !== t ? t : 1,
  44475. this.receiveShadow = void 0
  44476. }
  44477. ,
  44478. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  44479. Ci.Light.prototype.constructor = Ci.Light,
  44480. Ci.Light.prototype.copy = function(e) {
  44481. return Ci.Object3D.prototype.copy.call(this, e),
  44482. this.color.copy(e.color),
  44483. this.intensity = e.intensity,
  44484. this
  44485. }
  44486. ,
  44487. Ci.Light.prototype.toJSON = function(e) {
  44488. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44489. return t.object.color = this.color.getHex(),
  44490. t.object.intensity = this.intensity,
  44491. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  44492. void 0 !== this.distance && (t.object.distance = this.distance),
  44493. void 0 !== this.angle && (t.object.angle = this.angle),
  44494. void 0 !== this.decay && (t.object.decay = this.decay),
  44495. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  44496. t
  44497. }
  44498. ,
  44499. Ci.LightShadow = function(e) {
  44500. this.camera = e,
  44501. this.bias = 0,
  44502. this.radius = 1,
  44503. this.mapSize = new Ci.Vector2(512,512),
  44504. this.map = null,
  44505. this.matrix = new Ci.Matrix4
  44506. }
  44507. ,
  44508. Ci.LightShadow.prototype = {
  44509. constructor: Ci.LightShadow,
  44510. copy: function(e) {
  44511. return this.camera = e.camera.clone(),
  44512. this.bias = e.bias,
  44513. this.radius = e.radius,
  44514. this.mapSize.copy(e.mapSize),
  44515. this
  44516. },
  44517. clone: function() {
  44518. return (new this.constructor).copy(this)
  44519. }
  44520. },
  44521. Ci.AmbientLight = function(e, t) {
  44522. Ci.Light.call(this, e, t),
  44523. this.type = "AmbientLight",
  44524. this.castShadow = void 0
  44525. }
  44526. ,
  44527. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  44528. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  44529. Ci.DirectionalLight = function(e, t) {
  44530. Ci.Light.call(this, e, t),
  44531. this.type = "DirectionalLight",
  44532. this.position.set(0, 1, 0),
  44533. this.updateMatrix(),
  44534. this.target = new Ci.Object3D,
  44535. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  44536. }
  44537. ,
  44538. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  44539. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  44540. Ci.DirectionalLight.prototype.copy = function(e) {
  44541. return Ci.Light.prototype.copy.call(this, e),
  44542. this.target = e.target.clone(),
  44543. this.shadow = e.shadow.clone(),
  44544. this
  44545. }
  44546. ,
  44547. Ci.HemisphereLight = function(e, t, i) {
  44548. Ci.Light.call(this, e, i),
  44549. this.type = "HemisphereLight",
  44550. this.castShadow = void 0,
  44551. this.position.set(0, 1, 0),
  44552. this.updateMatrix(),
  44553. this.groundColor = new Ci.Color(t)
  44554. }
  44555. ,
  44556. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  44557. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  44558. Ci.HemisphereLight.prototype.copy = function(e) {
  44559. return Ci.Light.prototype.copy.call(this, e),
  44560. this.groundColor.copy(e.groundColor),
  44561. this
  44562. }
  44563. ,
  44564. Ci.PointLight = function(e, t, i, n) {
  44565. Ci.Light.call(this, e, t),
  44566. this.type = "PointLight",
  44567. this.distance = void 0 !== i ? i : 0,
  44568. this.decay = void 0 !== n ? n : 1,
  44569. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  44570. }
  44571. ,
  44572. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  44573. Ci.PointLight.prototype.constructor = Ci.PointLight,
  44574. Object.defineProperty(Ci.PointLight.prototype, "power", {
  44575. get: function() {
  44576. return 4 * this.intensity * Math.PI
  44577. },
  44578. set: function(e) {
  44579. this.intensity = e / (4 * Math.PI)
  44580. }
  44581. }),
  44582. Ci.PointLight.prototype.copy = function(e) {
  44583. return Ci.Light.prototype.copy.call(this, e),
  44584. this.distance = e.distance,
  44585. this.decay = e.decay,
  44586. this.shadow = e.shadow.clone(),
  44587. this
  44588. }
  44589. ,
  44590. Ci.SpotLight = function(e, t, i, n, r, o) {
  44591. Ci.Light.call(this, e, t),
  44592. this.type = "SpotLight",
  44593. this.position.set(0, 1, 0),
  44594. this.updateMatrix(),
  44595. this.target = new Ci.Object3D,
  44596. this.distance = void 0 !== i ? i : 0,
  44597. this.angle = void 0 !== n ? n : Math.PI / 3,
  44598. this.penumbra = void 0 !== r ? r : 0,
  44599. this.decay = void 0 !== o ? o : 1,
  44600. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  44601. }
  44602. ,
  44603. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  44604. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  44605. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  44606. get: function() {
  44607. return this.intensity * Math.PI
  44608. },
  44609. set: function(e) {
  44610. this.intensity = e / Math.PI
  44611. }
  44612. }),
  44613. Ci.SpotLight.prototype.copy = function(e) {
  44614. return Ci.Light.prototype.copy.call(this, e),
  44615. this.distance = e.distance,
  44616. this.angle = e.angle,
  44617. this.penumbra = e.penumbra,
  44618. this.decay = e.decay,
  44619. this.target = e.target.clone(),
  44620. this.shadow = e.shadow.clone(),
  44621. this
  44622. }
  44623. ,
  44624. Ci.Cache = {
  44625. enabled: !1,
  44626. files: {},
  44627. add: function(e, t) {
  44628. !1 !== this.enabled && (this.files[e] = t)
  44629. },
  44630. get: function(e) {
  44631. if (!1 !== this.enabled)
  44632. return this.files[e]
  44633. },
  44634. remove: function(e) {
  44635. delete this.files[e]
  44636. },
  44637. clear: function() {
  44638. this.files = {}
  44639. }
  44640. },
  44641. Ci.Loader = function() {
  44642. this.onLoadStart = function() {}
  44643. ,
  44644. this.onLoadProgress = function() {}
  44645. ,
  44646. this.onLoadComplete = function() {}
  44647. }
  44648. ,
  44649. Ci.Loader.prototype = {
  44650. constructor: Ci.Loader,
  44651. crossOrigin: void 0,
  44652. extractUrlBase: function(e) {
  44653. var t = e.split("/");
  44654. return 1 === t.length ? "./" : (t.pop(),
  44655. t.join("/") + "/")
  44656. },
  44657. initMaterials: function(e, t, i) {
  44658. for (var n = [], r = 0; r < e.length; ++r)
  44659. n[r] = this.createMaterial(e[r], t, i);
  44660. return n
  44661. },
  44662. createMaterial: function(e, c, h) {
  44663. function t(e, t, i, n, r) {
  44664. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  44665. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  44666. He.load(a)),
  44667. void 0 !== t && (o.repeat.fromArray(t),
  44668. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  44669. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  44670. void 0 !== i && o.offset.fromArray(i),
  44671. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  44672. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  44673. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  44674. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  44675. void 0 !== r && (o.anisotropy = r);
  44676. var l = Ci.Math.generateUUID();
  44677. return u[l] = o,
  44678. l
  44679. }
  44680. void 0 === Ue && (Ue = new Ci.Color),
  44681. void 0 === He && (He = new Ci.TextureLoader),
  44682. void 0 === ze && (ze = new Ci.MaterialLoader);
  44683. var u = {}
  44684. , i = {
  44685. uuid: Ci.Math.generateUUID(),
  44686. type: "MeshLambertMaterial"
  44687. };
  44688. for (var n in e) {
  44689. var r = e[n];
  44690. switch (n) {
  44691. case "DbgColor":
  44692. case "DbgIndex":
  44693. case "opticalDensity":
  44694. case "illumination":
  44695. break;
  44696. case "DbgName":
  44697. i.name = r;
  44698. break;
  44699. case "blending":
  44700. i.blending = Ci[r];
  44701. break;
  44702. case "colorAmbient":
  44703. case "mapAmbient":
  44704. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  44705. break;
  44706. case "colorDiffuse":
  44707. i.color = Ue.fromArray(r).getHex();
  44708. break;
  44709. case "colorSpecular":
  44710. i.specular = Ue.fromArray(r).getHex();
  44711. break;
  44712. case "colorEmissive":
  44713. i.emissive = Ue.fromArray(r).getHex();
  44714. break;
  44715. case "specularCoef":
  44716. i.shininess = r;
  44717. break;
  44718. case "shading":
  44719. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  44720. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  44721. break;
  44722. case "mapDiffuse":
  44723. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  44724. break;
  44725. case "mapDiffuseRepeat":
  44726. case "mapDiffuseOffset":
  44727. case "mapDiffuseWrap":
  44728. case "mapDiffuseAnisotropy":
  44729. break;
  44730. case "mapLight":
  44731. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  44732. break;
  44733. case "mapLightRepeat":
  44734. case "mapLightOffset":
  44735. case "mapLightWrap":
  44736. case "mapLightAnisotropy":
  44737. break;
  44738. case "mapAO":
  44739. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  44740. break;
  44741. case "mapAORepeat":
  44742. case "mapAOOffset":
  44743. case "mapAOWrap":
  44744. case "mapAOAnisotropy":
  44745. break;
  44746. case "mapBump":
  44747. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  44748. break;
  44749. case "mapBumpScale":
  44750. i.bumpScale = r;
  44751. break;
  44752. case "mapBumpRepeat":
  44753. case "mapBumpOffset":
  44754. case "mapBumpWrap":
  44755. case "mapBumpAnisotropy":
  44756. break;
  44757. case "mapNormal":
  44758. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  44759. break;
  44760. case "mapNormalFactor":
  44761. i.normalScale = [r, r];
  44762. break;
  44763. case "mapNormalRepeat":
  44764. case "mapNormalOffset":
  44765. case "mapNormalWrap":
  44766. case "mapNormalAnisotropy":
  44767. break;
  44768. case "mapSpecular":
  44769. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  44770. break;
  44771. case "mapSpecularRepeat":
  44772. case "mapSpecularOffset":
  44773. case "mapSpecularWrap":
  44774. case "mapSpecularAnisotropy":
  44775. break;
  44776. case "mapAlpha":
  44777. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  44778. break;
  44779. case "mapAlphaRepeat":
  44780. case "mapAlphaOffset":
  44781. case "mapAlphaWrap":
  44782. case "mapAlphaAnisotropy":
  44783. break;
  44784. case "flipSided":
  44785. i.side = Ci.BackSide;
  44786. break;
  44787. case "doubleSided":
  44788. i.side = Ci.DoubleSide;
  44789. break;
  44790. case "transparency":
  44791. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  44792. i.opacity = r;
  44793. break;
  44794. case "depthTest":
  44795. case "depthWrite":
  44796. case "colorWrite":
  44797. case "opacity":
  44798. case "reflectivity":
  44799. case "transparent":
  44800. case "visible":
  44801. case "wireframe":
  44802. i[n] = r;
  44803. break;
  44804. case "vertexColors":
  44805. !0 === r && (i.vertexColors = Ci.VertexColors),
  44806. "face" === r && (i.vertexColors = Ci.FaceColors);
  44807. break;
  44808. default:
  44809. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  44810. }
  44811. }
  44812. return "MeshBasicMaterial" === i.type && delete i.emissive,
  44813. "MeshPhongMaterial" !== i.type && delete i.specular,
  44814. i.opacity < 1 && (i.transparent = !0),
  44815. ze.setTextures(u),
  44816. ze.parse(i)
  44817. }
  44818. },
  44819. Ci.Loader.Handlers = {
  44820. handlers: [],
  44821. add: function(e, t) {
  44822. this.handlers.push(e, t)
  44823. },
  44824. get: function(e) {
  44825. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  44826. var r = t[i]
  44827. , o = t[i + 1];
  44828. if (r.test(e))
  44829. return o
  44830. }
  44831. return null
  44832. }
  44833. },
  44834. Ci.XHRLoader = function(e) {
  44835. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  44836. }
  44837. ,
  44838. Ci.XHRLoader.prototype = {
  44839. constructor: Ci.XHRLoader,
  44840. load: function(i, n, t, r) {
  44841. void 0 !== this.path && (i = this.path + i);
  44842. var o = this
  44843. , e = Ci.Cache.get(i);
  44844. if (void 0 !== e)
  44845. return n && setTimeout(function() {
  44846. n(e)
  44847. }, 0),
  44848. e;
  44849. var a = new XMLHttpRequest;
  44850. return a.overrideMimeType("text/plain"),
  44851. a.open("GET", i, !0),
  44852. a.addEventListener("load", function(e) {
  44853. var t = e.target.response;
  44854. Ci.Cache.add(i, t),
  44855. 200 === this.status ? (n && n(t),
  44856. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  44857. n && n(t),
  44858. o.manager.itemEnd(i)) : (r && r(e),
  44859. o.manager.itemError(i))
  44860. }, !1),
  44861. void 0 !== t && a.addEventListener("progress", function(e) {
  44862. t(e)
  44863. }, !1),
  44864. a.addEventListener("error", function(e) {
  44865. r && r(e),
  44866. o.manager.itemError(i)
  44867. }, !1),
  44868. void 0 !== this.responseType && (a.responseType = this.responseType),
  44869. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  44870. a.send(null),
  44871. o.manager.itemStart(i),
  44872. a
  44873. },
  44874. setPath: function(e) {
  44875. this.path = e
  44876. },
  44877. setResponseType: function(e) {
  44878. this.responseType = e
  44879. },
  44880. setWithCredentials: function(e) {
  44881. this.withCredentials = e
  44882. }
  44883. },
  44884. Ci.FontLoader = function(e) {
  44885. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  44886. }
  44887. ,
  44888. Ci.FontLoader.prototype = {
  44889. constructor: Ci.FontLoader,
  44890. load: function(e, t, i, n) {
  44891. new Ci.XHRLoader(this.manager).load(e, function(e) {
  44892. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  44893. }, i, n)
  44894. }
  44895. },
  44896. Ci.ImageLoader = function(e) {
  44897. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  44898. }
  44899. ,
  44900. Ci.ImageLoader.prototype = {
  44901. constructor: Ci.ImageLoader,
  44902. load: function(t, i, n, r) {
  44903. void 0 !== this.path && (t = this.path + t);
  44904. var o = this
  44905. , e = Ci.Cache.get(t);
  44906. if (void 0 !== e)
  44907. return o.manager.itemStart(t),
  44908. i ? setTimeout(function() {
  44909. i(e),
  44910. o.manager.itemEnd(t)
  44911. }, 0) : o.manager.itemEnd(t),
  44912. e;
  44913. var a = document.createElement("img");
  44914. return a.addEventListener("load", function(e) {
  44915. Ci.Cache.add(t, this),
  44916. i && i(this),
  44917. o.manager.itemEnd(t)
  44918. }, !1),
  44919. void 0 !== n && a.addEventListener("progress", function(e) {
  44920. n(e)
  44921. }, !1),
  44922. a.addEventListener("error", function(e) {
  44923. r && r(e),
  44924. o.manager.itemError(t)
  44925. }, !1),
  44926. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  44927. o.manager.itemStart(t),
  44928. a.src = t,
  44929. a
  44930. },
  44931. setCrossOrigin: function(e) {
  44932. this.crossOrigin = e
  44933. },
  44934. setPath: function(e) {
  44935. this.path = e
  44936. }
  44937. },
  44938. Ci.JSONLoader = function(e) {
  44939. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  44940. e = void 0),
  44941. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  44942. this.withCredentials = !1
  44943. }
  44944. ,
  44945. Ci.JSONLoader.prototype = {
  44946. constructor: Ci.JSONLoader,
  44947. get statusDomElement() {
  44948. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  44949. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  44950. this._statusDomElement
  44951. },
  44952. load: function(o, a, e, t) {
  44953. var s = this
  44954. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  44955. , i = new Ci.XHRLoader(this.manager);
  44956. i.setWithCredentials(this.withCredentials),
  44957. i.load(o, function(e) {
  44958. var t = JSON.parse(e)
  44959. , i = t.metadata;
  44960. if (void 0 !== i) {
  44961. var n = i.type;
  44962. if (void 0 !== n) {
  44963. if ("object" === n.toLowerCase())
  44964. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  44965. if ("scene" === n.toLowerCase())
  44966. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  44967. }
  44968. }
  44969. var r = s.parse(t, l);
  44970. a(r.geometry, r.materials)
  44971. }, e, t)
  44972. },
  44973. setTexturePath: function(e) {
  44974. this.texturePath = e
  44975. },
  44976. parse: function(D, e) {
  44977. var N = new Ci.Geometry
  44978. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  44979. if (function(e) {
  44980. function t(e, t) {
  44981. return e & 1 << t
  44982. }
  44983. 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;
  44984. if (void 0 !== D.uvs) {
  44985. for (i = 0; i < D.uvs.length; i++)
  44986. D.uvs[i].length && L++;
  44987. for (i = 0; i < L; i++)
  44988. N.faceVertexUvs[i] = []
  44989. }
  44990. for (o = 0,
  44991. a = R.length; o < a; )
  44992. (A = new Ci.Vector3).x = R[o++] * e,
  44993. A.y = R[o++] * e,
  44994. A.z = R[o++] * e,
  44995. N.vertices.push(A);
  44996. for (o = 0,
  44997. a = M.length; o < a; )
  44998. if (d = t(u = M[o++], 0),
  44999. p = t(u, 1),
  45000. f = t(u, 3),
  45001. g = t(u, 4),
  45002. m = t(u, 5),
  45003. v = t(u, 6),
  45004. y = t(u, 7),
  45005. d) {
  45006. if ((I = new Ci.Face3).a = M[o],
  45007. I.b = M[o + 1],
  45008. I.c = M[o + 3],
  45009. (E = new Ci.Face3).a = M[o + 1],
  45010. E.b = M[o + 2],
  45011. E.c = M[o + 3],
  45012. o += 4,
  45013. p && (h = M[o++],
  45014. I.materialIndex = h,
  45015. E.materialIndex = h),
  45016. r = N.faces.length,
  45017. f)
  45018. for (i = 0; i < L; i++)
  45019. for (w = D.uvs[i],
  45020. N.faceVertexUvs[i][r] = [],
  45021. N.faceVertexUvs[i][r + 1] = [],
  45022. n = 0; n < 4; n++)
  45023. x = w[2 * (c = M[o++])],
  45024. S = w[2 * c + 1],
  45025. T = new Ci.Vector2(x,S),
  45026. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45027. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45028. if (g && (l = 3 * M[o++],
  45029. I.normal.set(P[l++], P[l++], P[l]),
  45030. E.normal.copy(I.normal)),
  45031. m)
  45032. for (i = 0; i < 4; i++)
  45033. l = 3 * M[o++],
  45034. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45035. 2 !== i && I.vertexNormals.push(b),
  45036. 0 !== i && E.vertexNormals.push(b);
  45037. if (v && (_ = O[s = M[o++]],
  45038. I.color.setHex(_),
  45039. E.color.setHex(_)),
  45040. y)
  45041. for (i = 0; i < 4; i++)
  45042. _ = O[s = M[o++]],
  45043. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  45044. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  45045. N.faces.push(I),
  45046. N.faces.push(E)
  45047. } else {
  45048. if ((C = new Ci.Face3).a = M[o++],
  45049. C.b = M[o++],
  45050. C.c = M[o++],
  45051. p && (h = M[o++],
  45052. C.materialIndex = h),
  45053. r = N.faces.length,
  45054. f)
  45055. for (i = 0; i < L; i++)
  45056. for (w = D.uvs[i],
  45057. N.faceVertexUvs[i][r] = [],
  45058. n = 0; n < 3; n++)
  45059. x = w[2 * (c = M[o++])],
  45060. S = w[2 * c + 1],
  45061. T = new Ci.Vector2(x,S),
  45062. N.faceVertexUvs[i][r].push(T);
  45063. if (g && (l = 3 * M[o++],
  45064. C.normal.set(P[l++], P[l++], P[l])),
  45065. m)
  45066. for (i = 0; i < 3; i++)
  45067. l = 3 * M[o++],
  45068. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45069. C.vertexNormals.push(b);
  45070. if (v && (s = M[o++],
  45071. C.color.setHex(O[s])),
  45072. y)
  45073. for (i = 0; i < 3; i++)
  45074. s = M[o++],
  45075. C.vertexColors.push(new Ci.Color(O[s]));
  45076. N.faces.push(C)
  45077. }
  45078. }(t),
  45079. function() {
  45080. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  45081. if (D.skinWeights)
  45082. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  45083. var n = D.skinWeights[t]
  45084. , r = 1 < e ? D.skinWeights[t + 1] : 0
  45085. , o = 2 < e ? D.skinWeights[t + 2] : 0
  45086. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  45087. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  45088. }
  45089. if (D.skinIndices)
  45090. for (t = 0,
  45091. i = D.skinIndices.length; t < i; t += e) {
  45092. var s = D.skinIndices[t]
  45093. , l = 1 < e ? D.skinIndices[t + 1] : 0
  45094. , c = 2 < e ? D.skinIndices[t + 2] : 0
  45095. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  45096. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  45097. }
  45098. N.bones = D.bones,
  45099. 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.")
  45100. }(),
  45101. function(e) {
  45102. if (void 0 !== D.morphTargets)
  45103. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  45104. N.morphTargets[t] = {},
  45105. N.morphTargets[t].name = D.morphTargets[t].name,
  45106. N.morphTargets[t].vertices = [];
  45107. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  45108. var s = new Ci.Vector3;
  45109. s.x = r[o] * e,
  45110. s.y = r[o + 1] * e,
  45111. s.z = r[o + 2] * e,
  45112. n.push(s)
  45113. }
  45114. }
  45115. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  45116. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45117. var l = N.faces
  45118. , c = D.morphColors[0].colors;
  45119. for (t = 0,
  45120. i = l.length; t < i; t++)
  45121. l[t].color.fromArray(c, 3 * t)
  45122. }
  45123. }(t),
  45124. function() {
  45125. var e = []
  45126. , t = [];
  45127. void 0 !== D.animation && t.push(D.animation),
  45128. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  45129. for (var i = 0; i < t.length; i++) {
  45130. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  45131. n && e.push(n)
  45132. }
  45133. if (N.morphTargets) {
  45134. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  45135. e = e.concat(r)
  45136. }
  45137. 0 < e.length && (N.animations = e)
  45138. }(),
  45139. N.computeFaceNormals(),
  45140. N.computeBoundingSphere(),
  45141. void 0 === D.materials || 0 === D.materials.length)
  45142. return {
  45143. geometry: N
  45144. };
  45145. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  45146. return {
  45147. geometry: N,
  45148. materials: i
  45149. }
  45150. }
  45151. },
  45152. Ci.LoadingManager = function(e, t, i) {
  45153. var n = this
  45154. , r = !1
  45155. , o = 0
  45156. , a = 0;
  45157. this.onStart = void 0,
  45158. this.onLoad = e,
  45159. this.onProgress = t,
  45160. this.onError = i,
  45161. this.itemStart = function(e) {
  45162. a++,
  45163. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  45164. r = !0
  45165. }
  45166. ,
  45167. this.itemEnd = function(e) {
  45168. o++,
  45169. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45170. o === a && (r = !1,
  45171. void 0 !== n.onLoad && n.onLoad())
  45172. }
  45173. ,
  45174. this.itemError = function(e) {
  45175. void 0 !== n.onError && n.onError(e)
  45176. }
  45177. }
  45178. ,
  45179. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  45180. Ci.BufferGeometryLoader = function(e) {
  45181. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45182. }
  45183. ,
  45184. Ci.BufferGeometryLoader.prototype = {
  45185. constructor: Ci.BufferGeometryLoader,
  45186. load: function(e, t, i, n) {
  45187. var r = this;
  45188. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45189. t(r.parse(JSON.parse(e)))
  45190. }, i, n)
  45191. },
  45192. parse: function(e) {
  45193. var t = new Ci.BufferGeometry
  45194. , i = e.data.index
  45195. , n = {
  45196. Int8Array: Int8Array,
  45197. Uint8Array: Uint8Array,
  45198. Uint8ClampedArray: Uint8ClampedArray,
  45199. Int16Array: Int16Array,
  45200. Uint16Array: Uint16Array,
  45201. Int32Array: Int32Array,
  45202. Uint32Array: Uint32Array,
  45203. Float32Array: Float32Array,
  45204. Float64Array: Float64Array
  45205. };
  45206. if (void 0 !== i) {
  45207. var r = new n[i.type](i.array);
  45208. t.setIndex(new Ci.BufferAttribute(r,1))
  45209. }
  45210. var o = e.data.attributes;
  45211. for (var a in o) {
  45212. var s = o[a];
  45213. r = new n[s.type](s.array);
  45214. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  45215. }
  45216. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  45217. if (void 0 !== l)
  45218. for (var c = 0, h = l.length; c !== h; ++c) {
  45219. var u = l[c];
  45220. t.addGroup(u.start, u.count, u.materialIndex)
  45221. }
  45222. var d = e.data.boundingSphere;
  45223. if (void 0 !== d) {
  45224. var p = new Ci.Vector3;
  45225. void 0 !== d.center && p.fromArray(d.center),
  45226. t.boundingSphere = new Ci.Sphere(p,d.radius)
  45227. }
  45228. return t
  45229. }
  45230. },
  45231. Ci.MaterialLoader = function(e) {
  45232. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45233. this.textures = {}
  45234. }
  45235. ,
  45236. Ci.MaterialLoader.prototype = {
  45237. constructor: Ci.MaterialLoader,
  45238. load: function(e, t, i, n) {
  45239. var r = this;
  45240. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45241. t(r.parse(JSON.parse(e)))
  45242. }, i, n)
  45243. },
  45244. setTextures: function(e) {
  45245. this.textures = e
  45246. },
  45247. getTexture: function(e) {
  45248. var t = this.textures;
  45249. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  45250. t[e]
  45251. },
  45252. parse: function(e) {
  45253. var t = new Ci[e.type];
  45254. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  45255. void 0 !== e.name && (t.name = e.name),
  45256. void 0 !== e.color && t.color.setHex(e.color),
  45257. void 0 !== e.roughness && (t.roughness = e.roughness),
  45258. void 0 !== e.metalness && (t.metalness = e.metalness),
  45259. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  45260. void 0 !== e.specular && t.specular.setHex(e.specular),
  45261. void 0 !== e.shininess && (t.shininess = e.shininess),
  45262. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  45263. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  45264. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  45265. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  45266. void 0 !== e.shading && (t.shading = e.shading),
  45267. void 0 !== e.blending && (t.blending = e.blending),
  45268. void 0 !== e.side && (t.side = e.side),
  45269. void 0 !== e.opacity && (t.opacity = e.opacity),
  45270. void 0 !== e.transparent && (t.transparent = e.transparent),
  45271. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  45272. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  45273. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  45274. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  45275. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  45276. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  45277. void 0 !== e.size && (t.size = e.size),
  45278. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  45279. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  45280. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  45281. t.transparent = !0),
  45282. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  45283. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  45284. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  45285. void 0 !== e.normalScale) {
  45286. var i = e.normalScale;
  45287. !1 === Array.isArray(i) && (i = [i, i]),
  45288. t.normalScale = (new Ci.Vector2).fromArray(i)
  45289. }
  45290. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  45291. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  45292. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  45293. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  45294. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  45295. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  45296. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  45297. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  45298. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  45299. t.combine = Ci.MultiplyOperation),
  45300. e.reflectivity && (t.reflectivity = e.reflectivity),
  45301. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  45302. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  45303. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  45304. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  45305. void 0 !== e.materials)
  45306. for (var n = 0, r = e.materials.length; n < r; n++)
  45307. t.materials.push(this.parse(e.materials[n]));
  45308. return t
  45309. }
  45310. },
  45311. Ci.ObjectLoader = function(e) {
  45312. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45313. this.texturePath = ""
  45314. }
  45315. ,
  45316. Ci.ObjectLoader.prototype = {
  45317. constructor: Ci.ObjectLoader,
  45318. load: function(e, t, i, n) {
  45319. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  45320. var r = this;
  45321. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45322. r.parse(JSON.parse(e), t)
  45323. }, i, n)
  45324. },
  45325. setTexturePath: function(e) {
  45326. this.texturePath = e
  45327. },
  45328. setCrossOrigin: function(e) {
  45329. this.crossOrigin = e
  45330. },
  45331. parse: function(e, t) {
  45332. var i = this.parseGeometries(e.geometries)
  45333. , n = this.parseImages(e.images, function() {
  45334. void 0 !== t && t(a)
  45335. })
  45336. , r = this.parseTextures(e.textures, n)
  45337. , o = this.parseMaterials(e.materials, r)
  45338. , a = this.parseObject(e.object, i, o);
  45339. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  45340. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  45341. a
  45342. },
  45343. parseGeometries: function(e) {
  45344. var t = {};
  45345. if (void 0 !== e)
  45346. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  45347. var a, s = e[r];
  45348. switch (s.type) {
  45349. case "PlaneGeometry":
  45350. case "PlaneBufferGeometry":
  45351. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  45352. break;
  45353. case "BoxGeometry":
  45354. case "BoxBufferGeometry":
  45355. case "CubeGeometry":
  45356. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  45357. break;
  45358. case "CircleGeometry":
  45359. case "CircleBufferGeometry":
  45360. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  45361. break;
  45362. case "CylinderGeometry":
  45363. case "CylinderBufferGeometry":
  45364. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  45365. break;
  45366. case "SphereGeometry":
  45367. case "SphereBufferGeometry":
  45368. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  45369. break;
  45370. case "DodecahedronGeometry":
  45371. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  45372. break;
  45373. case "IcosahedronGeometry":
  45374. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  45375. break;
  45376. case "OctahedronGeometry":
  45377. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  45378. break;
  45379. case "TetrahedronGeometry":
  45380. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  45381. break;
  45382. case "RingGeometry":
  45383. case "RingBufferGeometry":
  45384. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  45385. break;
  45386. case "TorusGeometry":
  45387. case "TorusBufferGeometry":
  45388. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  45389. break;
  45390. case "TorusKnotGeometry":
  45391. case "TorusKnotBufferGeometry":
  45392. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  45393. break;
  45394. case "LatheGeometry":
  45395. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  45396. break;
  45397. case "BufferGeometry":
  45398. a = n.parse(s);
  45399. break;
  45400. case "Geometry":
  45401. a = i.parse(s.data, this.texturePath).geometry;
  45402. break;
  45403. default:
  45404. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  45405. continue
  45406. }
  45407. a.uuid = s.uuid,
  45408. void 0 !== s.name && (a.name = s.name),
  45409. t[s.uuid] = a
  45410. }
  45411. return t
  45412. },
  45413. parseMaterials: function(e, t) {
  45414. var i = {};
  45415. if (void 0 !== e) {
  45416. var n = new Ci.MaterialLoader;
  45417. n.setTextures(t);
  45418. for (var r = 0, o = e.length; r < o; r++) {
  45419. var a = n.parse(e[r]);
  45420. i[a.uuid] = a
  45421. }
  45422. }
  45423. return i
  45424. },
  45425. parseAnimations: function(e) {
  45426. for (var t = [], i = 0; i < e.length; i++) {
  45427. var n = Ci.AnimationClip.parse(e[i]);
  45428. t.push(n)
  45429. }
  45430. return t
  45431. },
  45432. parseImages: function(e, t) {
  45433. function i(e) {
  45434. return n.manager.itemStart(e),
  45435. a.load(e, function() {
  45436. n.manager.itemEnd(e)
  45437. })
  45438. }
  45439. var n = this
  45440. , r = {};
  45441. if (void 0 !== e && 0 < e.length) {
  45442. var o = new Ci.LoadingManager(t)
  45443. , a = new Ci.ImageLoader(o);
  45444. a.setCrossOrigin(this.crossOrigin);
  45445. for (var s = 0, l = e.length; s < l; s++) {
  45446. var c = e[s]
  45447. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  45448. r[c.uuid] = i(h)
  45449. }
  45450. }
  45451. return r
  45452. },
  45453. parseTextures: function(e, t) {
  45454. function i(e) {
  45455. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  45456. Ci[e])
  45457. }
  45458. var n = {};
  45459. if (void 0 !== e)
  45460. for (var r = 0, o = e.length; r < o; r++) {
  45461. var a = e[r];
  45462. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  45463. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  45464. var s = new Ci.Texture(t[a.image]);
  45465. s.needsUpdate = !0,
  45466. s.uuid = a.uuid,
  45467. void 0 !== a.name && (s.name = a.name),
  45468. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  45469. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  45470. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  45471. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  45472. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  45473. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  45474. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  45475. s.wrapT = i(a.wrap[1])),
  45476. n[a.uuid] = s
  45477. }
  45478. return n
  45479. },
  45480. parseObject: (ke = new Ci.Matrix4,
  45481. function(e, t, i) {
  45482. function n(e) {
  45483. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  45484. t[e]
  45485. }
  45486. function r(e) {
  45487. if (void 0 !== e)
  45488. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  45489. i[e]
  45490. }
  45491. var o;
  45492. switch (e.type) {
  45493. case "Scene":
  45494. o = new Ci.Scene;
  45495. break;
  45496. case "PerspectiveCamera":
  45497. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  45498. break;
  45499. case "OrthographicCamera":
  45500. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  45501. break;
  45502. case "AmbientLight":
  45503. o = new Ci.AmbientLight(e.color,e.intensity);
  45504. break;
  45505. case "DirectionalLight":
  45506. o = new Ci.DirectionalLight(e.color,e.intensity);
  45507. break;
  45508. case "PointLight":
  45509. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  45510. break;
  45511. case "SpotLight":
  45512. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  45513. break;
  45514. case "HemisphereLight":
  45515. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  45516. break;
  45517. case "Mesh":
  45518. var a = n(e.geometry)
  45519. , s = r(e.material);
  45520. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  45521. break;
  45522. case "LOD":
  45523. o = new Ci.LOD;
  45524. break;
  45525. case "Line":
  45526. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  45527. break;
  45528. case "PointCloud":
  45529. case "Points":
  45530. o = new Ci.Points(n(e.geometry),r(e.material));
  45531. break;
  45532. case "Sprite":
  45533. o = new Ci.Sprite(r(e.material));
  45534. break;
  45535. case "Group":
  45536. o = new Ci.Group;
  45537. break;
  45538. default:
  45539. o = new Ci.Object3D
  45540. }
  45541. if (o.uuid = e.uuid,
  45542. void 0 !== e.name && (o.name = e.name),
  45543. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  45544. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  45545. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  45546. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  45547. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  45548. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  45549. void 0 !== e.visible && (o.visible = e.visible),
  45550. void 0 !== e.userData && (o.userData = e.userData),
  45551. void 0 !== e.children)
  45552. for (var l in e.children)
  45553. o.add(this.parseObject(e.children[l], t, i));
  45554. if ("LOD" === e.type)
  45555. for (var c = e.levels, h = 0; h < c.length; h++) {
  45556. var u = c[h];
  45557. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  45558. }
  45559. return o
  45560. }
  45561. )
  45562. },
  45563. Ci.TextureLoader = function(e) {
  45564. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45565. }
  45566. ,
  45567. Ci.TextureLoader.prototype = {
  45568. constructor: Ci.TextureLoader,
  45569. load: function(e, t, i, n) {
  45570. var r = new Ci.Texture
  45571. , o = new Ci.ImageLoader(this.manager);
  45572. return o.setCrossOrigin(this.crossOrigin),
  45573. o.setPath(this.path),
  45574. o.load(e, function(e) {
  45575. r.image = e,
  45576. r.needsUpdate = !0,
  45577. void 0 !== t && t(r)
  45578. }, i, n),
  45579. r
  45580. },
  45581. setCrossOrigin: function(e) {
  45582. this.crossOrigin = e
  45583. },
  45584. setPath: function(e) {
  45585. this.path = e
  45586. }
  45587. },
  45588. Ci.CubeTextureLoader = function(e) {
  45589. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45590. }
  45591. ,
  45592. Ci.CubeTextureLoader.prototype = {
  45593. constructor: Ci.CubeTextureLoader,
  45594. load: function(e, i, t, n) {
  45595. function r(t) {
  45596. a.load(e[t], function(e) {
  45597. o.images[t] = e,
  45598. 6 === ++s && (o.needsUpdate = !0,
  45599. i && i(o))
  45600. }, void 0, n)
  45601. }
  45602. var o = new Ci.CubeTexture
  45603. , a = new Ci.ImageLoader(this.manager);
  45604. a.setCrossOrigin(this.crossOrigin),
  45605. a.setPath(this.path);
  45606. for (var s = 0, l = 0; l < e.length; ++l)
  45607. r(l);
  45608. return o
  45609. },
  45610. setCrossOrigin: function(e) {
  45611. this.crossOrigin = e
  45612. },
  45613. setPath: function(e) {
  45614. this.path = e
  45615. }
  45616. },
  45617. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  45618. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45619. this._parser = null
  45620. }
  45621. ,
  45622. Ci.BinaryTextureLoader.prototype = {
  45623. constructor: Ci.BinaryTextureLoader,
  45624. load: function(e, i, t, n) {
  45625. var r = this
  45626. , o = new Ci.DataTexture
  45627. , a = new Ci.XHRLoader(this.manager);
  45628. return a.setResponseType("arraybuffer"),
  45629. a.load(e, function(e) {
  45630. var t = r._parser(e);
  45631. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  45632. o.image.height = t.height,
  45633. o.image.data = t.data),
  45634. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  45635. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  45636. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  45637. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  45638. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  45639. void 0 !== t.format && (o.format = t.format),
  45640. void 0 !== t.type && (o.type = t.type),
  45641. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  45642. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  45643. o.needsUpdate = !0,
  45644. i && i(o, t))
  45645. }, t, n),
  45646. o
  45647. }
  45648. },
  45649. Ci.CompressedTextureLoader = function(e) {
  45650. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45651. this._parser = null
  45652. }
  45653. ,
  45654. Ci.CompressedTextureLoader.prototype = {
  45655. constructor: Ci.CompressedTextureLoader,
  45656. load: function(e, o, t, n) {
  45657. function i(i) {
  45658. r.load(e[i], function(e) {
  45659. var t = a._parser(e, !0);
  45660. s[i] = {
  45661. width: t.width,
  45662. height: t.height,
  45663. format: t.format,
  45664. mipmaps: t.mipmaps
  45665. },
  45666. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  45667. l.format = t.format,
  45668. l.needsUpdate = !0,
  45669. o && o(l))
  45670. }, t, n)
  45671. }
  45672. var a = this
  45673. , s = []
  45674. , l = new Ci.CompressedTexture;
  45675. l.image = s;
  45676. var r = new Ci.XHRLoader(this.manager);
  45677. if (r.setPath(this.path),
  45678. r.setResponseType("arraybuffer"),
  45679. Array.isArray(e))
  45680. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  45681. i(h);
  45682. else
  45683. r.load(e, function(e) {
  45684. var t = a._parser(e, !0);
  45685. if (t.isCubemap)
  45686. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  45687. s[n] = {
  45688. mipmaps: []
  45689. };
  45690. for (var r = 0; r < t.mipmapCount; r++)
  45691. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  45692. s[n].format = t.format,
  45693. s[n].width = t.width,
  45694. s[n].height = t.height
  45695. }
  45696. else
  45697. l.image.width = t.width,
  45698. l.image.height = t.height,
  45699. l.mipmaps = t.mipmaps;
  45700. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  45701. l.format = t.format,
  45702. l.needsUpdate = !0,
  45703. o && o(l)
  45704. }, t, n);
  45705. return l
  45706. },
  45707. setPath: function(e) {
  45708. this.path = e
  45709. }
  45710. },
  45711. Ci.Material = function() {
  45712. Object.defineProperty(this, "id", {
  45713. value: Ci.MaterialIdCount++
  45714. }),
  45715. this.uuid = Ci.Math.generateUUID(),
  45716. this.name = "",
  45717. this.type = "Material",
  45718. this.side = Ci.FrontSide,
  45719. this.opacity = 1,
  45720. this.transparent = !1,
  45721. this.blending = Ci.NormalBlending,
  45722. this.blendSrc = Ci.SrcAlphaFactor,
  45723. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  45724. this.blendEquation = Ci.AddEquation,
  45725. this.blendSrcAlpha = null,
  45726. this.blendDstAlpha = null,
  45727. this.blendEquationAlpha = null,
  45728. this.depthFunc = Ci.LessEqualDepth,
  45729. this.depthTest = !0,
  45730. this.depthWrite = !0,
  45731. this.colorWrite = !0,
  45732. this.precision = null,
  45733. this.polygonOffset = !1,
  45734. this.polygonOffsetFactor = 0,
  45735. this.polygonOffsetUnits = 0,
  45736. this.alphaTest = 0,
  45737. this.premultipliedAlpha = !1,
  45738. this.overdraw = 0,
  45739. this.visible = !0,
  45740. this._needsUpdate = !0
  45741. }
  45742. ,
  45743. Ci.Material.prototype = {
  45744. constructor: Ci.Material,
  45745. get needsUpdate() {
  45746. return this._needsUpdate
  45747. },
  45748. set needsUpdate(e) {
  45749. !0 === e && this.update(),
  45750. this._needsUpdate = e
  45751. },
  45752. setValues: function(e) {
  45753. if (void 0 !== e)
  45754. for (var t in e) {
  45755. var i = e[t];
  45756. if (void 0 !== i) {
  45757. var n = this[t];
  45758. 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.")
  45759. } else
  45760. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  45761. }
  45762. },
  45763. toJSON: function(e) {
  45764. function t(e) {
  45765. var t = [];
  45766. for (var i in e) {
  45767. var n = e[i];
  45768. delete n.metadata,
  45769. t.push(n)
  45770. }
  45771. return t
  45772. }
  45773. var i = void 0 === e;
  45774. i && (e = {
  45775. textures: {},
  45776. images: {}
  45777. });
  45778. var n = {
  45779. metadata: {
  45780. version: 4.4,
  45781. type: "Material",
  45782. generator: "Material.toJSON"
  45783. }
  45784. };
  45785. if (n.uuid = this.uuid,
  45786. n.type = this.type,
  45787. "" !== this.name && (n.name = this.name),
  45788. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  45789. .5 !== this.roughness && (n.roughness = this.roughness),
  45790. .5 !== this.metalness && (n.metalness = this.metalness),
  45791. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  45792. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  45793. void 0 !== this.shininess && (n.shininess = this.shininess),
  45794. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  45795. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  45796. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  45797. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  45798. n.bumpScale = this.bumpScale),
  45799. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  45800. n.normalScale = this.normalScale.toArray()),
  45801. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  45802. n.displacementScale = this.displacementScale,
  45803. n.displacementBias = this.displacementBias),
  45804. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  45805. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  45806. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  45807. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  45808. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  45809. n.reflectivity = this.reflectivity),
  45810. void 0 !== this.size && (n.size = this.size),
  45811. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  45812. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  45813. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  45814. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  45815. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  45816. this.opacity < 1 && (n.opacity = this.opacity),
  45817. !0 === this.transparent && (n.transparent = this.transparent),
  45818. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  45819. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  45820. !0 === this.wireframe && (n.wireframe = this.wireframe),
  45821. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  45822. i) {
  45823. var r = t(e.textures)
  45824. , o = t(e.images);
  45825. 0 < r.length && (n.textures = r),
  45826. 0 < o.length && (n.images = o)
  45827. }
  45828. return n
  45829. },
  45830. clone: function() {
  45831. return (new this.constructor).copy(this)
  45832. },
  45833. copy: function(e) {
  45834. return this.name = e.name,
  45835. this.side = e.side,
  45836. this.opacity = e.opacity,
  45837. this.transparent = e.transparent,
  45838. this.blending = e.blending,
  45839. this.blendSrc = e.blendSrc,
  45840. this.blendDst = e.blendDst,
  45841. this.blendEquation = e.blendEquation,
  45842. this.blendSrcAlpha = e.blendSrcAlpha,
  45843. this.blendDstAlpha = e.blendDstAlpha,
  45844. this.blendEquationAlpha = e.blendEquationAlpha,
  45845. this.depthFunc = e.depthFunc,
  45846. this.depthTest = e.depthTest,
  45847. this.depthWrite = e.depthWrite,
  45848. this.colorWrite = e.colorWrite,
  45849. this.precision = e.precision,
  45850. this.polygonOffset = e.polygonOffset,
  45851. this.polygonOffsetFactor = e.polygonOffsetFactor,
  45852. this.polygonOffsetUnits = e.polygonOffsetUnits,
  45853. this.alphaTest = e.alphaTest,
  45854. this.premultipliedAlpha = e.premultipliedAlpha,
  45855. this.overdraw = e.overdraw,
  45856. this.visible = e.visible,
  45857. this
  45858. },
  45859. update: function() {
  45860. this.dispatchEvent({
  45861. type: "update"
  45862. })
  45863. },
  45864. dispose: function() {
  45865. this.dispatchEvent({
  45866. type: "dispose"
  45867. })
  45868. }
  45869. },
  45870. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  45871. Ci.MaterialIdCount = 0,
  45872. Ci.LineBasicMaterial = function(e) {
  45873. Ci.Material.call(this),
  45874. this.type = "LineBasicMaterial",
  45875. this.color = new Ci.Color(16777215),
  45876. this.linewidth = 1,
  45877. this.linecap = "round",
  45878. this.linejoin = "round",
  45879. this.blending = Ci.NormalBlending,
  45880. this.vertexColors = Ci.NoColors,
  45881. this.fog = !0,
  45882. this.setValues(e)
  45883. }
  45884. ,
  45885. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  45886. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  45887. Ci.LineBasicMaterial.prototype.copy = function(e) {
  45888. return Ci.Material.prototype.copy.call(this, e),
  45889. this.color.copy(e.color),
  45890. this.linewidth = e.linewidth,
  45891. this.linecap = e.linecap,
  45892. this.linejoin = e.linejoin,
  45893. this.vertexColors = e.vertexColors,
  45894. this.fog = e.fog,
  45895. this
  45896. }
  45897. ,
  45898. Ci.LineDashedMaterial = function(e) {
  45899. Ci.Material.call(this),
  45900. this.type = "LineDashedMaterial",
  45901. this.color = new Ci.Color(16777215),
  45902. this.linewidth = 1,
  45903. this.scale = 1,
  45904. this.dashSize = 3,
  45905. this.gapSize = 1,
  45906. this.blending = Ci.NormalBlending,
  45907. this.vertexColors = Ci.NoColors,
  45908. this.fog = !0,
  45909. this.setValues(e)
  45910. }
  45911. ,
  45912. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  45913. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  45914. Ci.LineDashedMaterial.prototype.copy = function(e) {
  45915. return Ci.Material.prototype.copy.call(this, e),
  45916. this.color.copy(e.color),
  45917. this.linewidth = e.linewidth,
  45918. this.scale = e.scale,
  45919. this.dashSize = e.dashSize,
  45920. this.gapSize = e.gapSize,
  45921. this.vertexColors = e.vertexColors,
  45922. this.fog = e.fog,
  45923. this
  45924. }
  45925. ,
  45926. Ci.MeshBasicMaterial = function(e) {
  45927. Ci.Material.call(this),
  45928. this.type = "MeshBasicMaterial",
  45929. this.color = new Ci.Color(16777215),
  45930. this.map = null,
  45931. this.aoMap = null,
  45932. this.aoMapIntensity = 1,
  45933. this.specularMap = null,
  45934. this.alphaMap = null,
  45935. this.envMap = null,
  45936. this.combine = Ci.MultiplyOperation,
  45937. this.reflectivity = 1,
  45938. this.refractionRatio = .98,
  45939. this.fog = !0,
  45940. this.shading = Ci.SmoothShading,
  45941. this.blending = Ci.NormalBlending,
  45942. this.wireframe = !1,
  45943. this.wireframeLinewidth = 1,
  45944. this.wireframeLinecap = "round",
  45945. this.wireframeLinejoin = "round",
  45946. this.vertexColors = Ci.NoColors,
  45947. this.skinning = !1,
  45948. this.morphTargets = !1,
  45949. this.setValues(e)
  45950. }
  45951. ,
  45952. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  45953. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  45954. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  45955. return Ci.Material.prototype.copy.call(this, e),
  45956. this.color.copy(e.color),
  45957. this.map = e.map,
  45958. this.aoMap = e.aoMap,
  45959. this.aoMapIntensity = e.aoMapIntensity,
  45960. this.specularMap = e.specularMap,
  45961. this.alphaMap = e.alphaMap,
  45962. this.envMap = e.envMap,
  45963. this.combine = e.combine,
  45964. this.reflectivity = e.reflectivity,
  45965. this.refractionRatio = e.refractionRatio,
  45966. this.fog = e.fog,
  45967. this.shading = e.shading,
  45968. this.wireframe = e.wireframe,
  45969. this.wireframeLinewidth = e.wireframeLinewidth,
  45970. this.wireframeLinecap = e.wireframeLinecap,
  45971. this.wireframeLinejoin = e.wireframeLinejoin,
  45972. this.vertexColors = e.vertexColors,
  45973. this.skinning = e.skinning,
  45974. this.morphTargets = e.morphTargets,
  45975. this
  45976. }
  45977. ,
  45978. Ci.MeshLambertMaterial = function(e) {
  45979. Ci.Material.call(this),
  45980. this.type = "MeshLambertMaterial",
  45981. this.color = new Ci.Color(16777215),
  45982. this.map = null,
  45983. this.lightMap = null,
  45984. this.lightMapIntensity = 1,
  45985. this.aoMap = null,
  45986. this.aoMapIntensity = 1,
  45987. this.emissive = new Ci.Color(0),
  45988. this.emissiveIntensity = 1,
  45989. this.emissiveMap = null,
  45990. this.specularMap = null,
  45991. this.alphaMap = null,
  45992. this.envMap = null,
  45993. this.combine = Ci.MultiplyOperation,
  45994. this.reflectivity = 1,
  45995. this.refractionRatio = .98,
  45996. this.fog = !0,
  45997. this.blending = Ci.NormalBlending,
  45998. this.wireframe = !1,
  45999. this.wireframeLinewidth = 1,
  46000. this.wireframeLinecap = "round",
  46001. this.wireframeLinejoin = "round",
  46002. this.vertexColors = Ci.NoColors,
  46003. this.skinning = !1,
  46004. this.morphTargets = !1,
  46005. this.morphNormals = !1,
  46006. this.setValues(e)
  46007. }
  46008. ,
  46009. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46010. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46011. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46012. return Ci.Material.prototype.copy.call(this, e),
  46013. this.color.copy(e.color),
  46014. this.map = e.map,
  46015. this.lightMap = e.lightMap,
  46016. this.lightMapIntensity = e.lightMapIntensity,
  46017. this.aoMap = e.aoMap,
  46018. this.aoMapIntensity = e.aoMapIntensity,
  46019. this.emissive.copy(e.emissive),
  46020. this.emissiveMap = e.emissiveMap,
  46021. this.emissiveIntensity = e.emissiveIntensity,
  46022. this.specularMap = e.specularMap,
  46023. this.alphaMap = e.alphaMap,
  46024. this.envMap = e.envMap,
  46025. this.combine = e.combine,
  46026. this.reflectivity = e.reflectivity,
  46027. this.refractionRatio = e.refractionRatio,
  46028. this.fog = e.fog,
  46029. this.wireframe = e.wireframe,
  46030. this.wireframeLinewidth = e.wireframeLinewidth,
  46031. this.wireframeLinecap = e.wireframeLinecap,
  46032. this.wireframeLinejoin = e.wireframeLinejoin,
  46033. this.vertexColors = e.vertexColors,
  46034. this.skinning = e.skinning,
  46035. this.morphTargets = e.morphTargets,
  46036. this.morphNormals = e.morphNormals,
  46037. this
  46038. }
  46039. ,
  46040. Ci.MeshPhongMaterial = function(e) {
  46041. Ci.Material.call(this),
  46042. this.type = "MeshPhongMaterial",
  46043. this.color = new Ci.Color(16777215),
  46044. this.specular = new Ci.Color(1118481),
  46045. this.shininess = 30,
  46046. this.map = null,
  46047. this.lightMap = null,
  46048. this.lightMapIntensity = 1,
  46049. this.aoMap = null,
  46050. this.aoMapIntensity = 1,
  46051. this.emissive = new Ci.Color(0),
  46052. this.emissiveIntensity = 1,
  46053. this.emissiveMap = null,
  46054. this.bumpMap = null,
  46055. this.bumpScale = 1,
  46056. this.normalMap = null,
  46057. this.normalScale = new Ci.Vector2(1,1),
  46058. this.displacementMap = null,
  46059. this.displacementScale = 1,
  46060. this.displacementBias = 0,
  46061. this.specularMap = null,
  46062. this.alphaMap = null,
  46063. this.envMap = null,
  46064. this.combine = Ci.MultiplyOperation,
  46065. this.reflectivity = 1,
  46066. this.refractionRatio = .98,
  46067. this.fog = !0,
  46068. this.shading = Ci.SmoothShading,
  46069. this.blending = Ci.NormalBlending,
  46070. this.wireframe = !1,
  46071. this.wireframeLinewidth = 1,
  46072. this.wireframeLinecap = "round",
  46073. this.wireframeLinejoin = "round",
  46074. this.vertexColors = Ci.NoColors,
  46075. this.skinning = !1,
  46076. this.morphTargets = !1,
  46077. this.morphNormals = !1,
  46078. this.setValues(e)
  46079. }
  46080. ,
  46081. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  46082. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  46083. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  46084. return Ci.Material.prototype.copy.call(this, e),
  46085. this.color.copy(e.color),
  46086. this.specular.copy(e.specular),
  46087. this.shininess = e.shininess,
  46088. this.map = e.map,
  46089. this.lightMap = e.lightMap,
  46090. this.lightMapIntensity = e.lightMapIntensity,
  46091. this.aoMap = e.aoMap,
  46092. this.aoMapIntensity = e.aoMapIntensity,
  46093. this.emissive.copy(e.emissive),
  46094. this.emissiveMap = e.emissiveMap,
  46095. this.emissiveIntensity = e.emissiveIntensity,
  46096. this.bumpMap = e.bumpMap,
  46097. this.bumpScale = e.bumpScale,
  46098. this.normalMap = e.normalMap,
  46099. this.normalScale.copy(e.normalScale),
  46100. this.displacementMap = e.displacementMap,
  46101. this.displacementScale = e.displacementScale,
  46102. this.displacementBias = e.displacementBias,
  46103. this.specularMap = e.specularMap,
  46104. this.alphaMap = e.alphaMap,
  46105. this.envMap = e.envMap,
  46106. this.combine = e.combine,
  46107. this.reflectivity = e.reflectivity,
  46108. this.refractionRatio = e.refractionRatio,
  46109. this.fog = e.fog,
  46110. this.shading = e.shading,
  46111. this.wireframe = e.wireframe,
  46112. this.wireframeLinewidth = e.wireframeLinewidth,
  46113. this.wireframeLinecap = e.wireframeLinecap,
  46114. this.wireframeLinejoin = e.wireframeLinejoin,
  46115. this.vertexColors = e.vertexColors,
  46116. this.skinning = e.skinning,
  46117. this.morphTargets = e.morphTargets,
  46118. this.morphNormals = e.morphNormals,
  46119. this
  46120. }
  46121. ,
  46122. Ci.MeshStandardMaterial = function(e) {
  46123. Ci.Material.call(this),
  46124. this.type = "MeshStandardMaterial",
  46125. this.color = new Ci.Color(16777215),
  46126. this.roughness = .5,
  46127. this.metalness = .5,
  46128. this.map = null,
  46129. this.lightMap = null,
  46130. this.lightMapIntensity = 1,
  46131. this.aoMap = null,
  46132. this.aoMapIntensity = 1,
  46133. this.emissive = new Ci.Color(0),
  46134. this.emissiveIntensity = 1,
  46135. this.emissiveMap = null,
  46136. this.bumpMap = null,
  46137. this.bumpScale = 1,
  46138. this.normalMap = null,
  46139. this.normalScale = new Ci.Vector2(1,1),
  46140. this.displacementMap = null,
  46141. this.displacementScale = 1,
  46142. this.displacementBias = 0,
  46143. this.roughnessMap = null,
  46144. this.metalnessMap = null,
  46145. this.alphaMap = null,
  46146. this.envMap = null,
  46147. this.envMapIntensity = 1,
  46148. this.refractionRatio = .98,
  46149. this.fog = !0,
  46150. this.shading = Ci.SmoothShading,
  46151. this.blending = Ci.NormalBlending,
  46152. this.wireframe = !1,
  46153. this.wireframeLinewidth = 1,
  46154. this.wireframeLinecap = "round",
  46155. this.wireframeLinejoin = "round",
  46156. this.vertexColors = Ci.NoColors,
  46157. this.skinning = !1,
  46158. this.morphTargets = !1,
  46159. this.morphNormals = !1,
  46160. this.setValues(e)
  46161. }
  46162. ,
  46163. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  46164. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  46165. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  46166. return Ci.Material.prototype.copy.call(this, e),
  46167. this.color.copy(e.color),
  46168. this.roughness = e.roughness,
  46169. this.metalness = e.metalness,
  46170. this.map = e.map,
  46171. this.lightMap = e.lightMap,
  46172. this.lightMapIntensity = e.lightMapIntensity,
  46173. this.aoMap = e.aoMap,
  46174. this.aoMapIntensity = e.aoMapIntensity,
  46175. this.emissive.copy(e.emissive),
  46176. this.emissiveMap = e.emissiveMap,
  46177. this.emissiveIntensity = e.emissiveIntensity,
  46178. this.bumpMap = e.bumpMap,
  46179. this.bumpScale = e.bumpScale,
  46180. this.normalMap = e.normalMap,
  46181. this.normalScale.copy(e.normalScale),
  46182. this.displacementMap = e.displacementMap,
  46183. this.displacementScale = e.displacementScale,
  46184. this.displacementBias = e.displacementBias,
  46185. this.roughnessMap = e.roughnessMap,
  46186. this.metalnessMap = e.metalnessMap,
  46187. this.alphaMap = e.alphaMap,
  46188. this.envMap = e.envMap,
  46189. this.envMapIntensity = e.envMapIntensity,
  46190. this.refractionRatio = e.refractionRatio,
  46191. this.fog = e.fog,
  46192. this.shading = e.shading,
  46193. this.wireframe = e.wireframe,
  46194. this.wireframeLinewidth = e.wireframeLinewidth,
  46195. this.wireframeLinecap = e.wireframeLinecap,
  46196. this.wireframeLinejoin = e.wireframeLinejoin,
  46197. this.vertexColors = e.vertexColors,
  46198. this.skinning = e.skinning,
  46199. this.morphTargets = e.morphTargets,
  46200. this.morphNormals = e.morphNormals,
  46201. this
  46202. }
  46203. ,
  46204. Ci.MeshDepthMaterial = function(e) {
  46205. Ci.Material.call(this),
  46206. this.type = "MeshDepthMaterial",
  46207. this.morphTargets = !1,
  46208. this.wireframe = !1,
  46209. this.wireframeLinewidth = 1,
  46210. this.setValues(e)
  46211. }
  46212. ,
  46213. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  46214. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  46215. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  46216. return Ci.Material.prototype.copy.call(this, e),
  46217. this.wireframe = e.wireframe,
  46218. this.wireframeLinewidth = e.wireframeLinewidth,
  46219. this
  46220. }
  46221. ,
  46222. Ci.MeshNormalMaterial = function(e) {
  46223. Ci.Material.call(this, e),
  46224. this.type = "MeshNormalMaterial",
  46225. this.wireframe = !1,
  46226. this.wireframeLinewidth = 1,
  46227. this.morphTargets = !1,
  46228. this.setValues(e)
  46229. }
  46230. ,
  46231. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  46232. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  46233. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  46234. return Ci.Material.prototype.copy.call(this, e),
  46235. this.wireframe = e.wireframe,
  46236. this.wireframeLinewidth = e.wireframeLinewidth,
  46237. this
  46238. }
  46239. ,
  46240. Ci.MultiMaterial = function(e) {
  46241. this.uuid = Ci.Math.generateUUID(),
  46242. this.type = "MultiMaterial",
  46243. this.materials = e instanceof Array ? e : [],
  46244. this.visible = !0
  46245. }
  46246. ,
  46247. Ci.MultiMaterial.prototype = {
  46248. constructor: Ci.MultiMaterial,
  46249. toJSON: function(e) {
  46250. for (var t = {
  46251. metadata: {
  46252. version: 4.2,
  46253. type: "material",
  46254. generator: "MaterialExporter"
  46255. },
  46256. uuid: this.uuid,
  46257. type: this.type,
  46258. materials: []
  46259. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  46260. var o = i[n].toJSON(e);
  46261. delete o.metadata,
  46262. t.materials.push(o)
  46263. }
  46264. return t.visible = this.visible,
  46265. t
  46266. },
  46267. clone: function() {
  46268. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  46269. e.materials.push(this.materials[t].clone());
  46270. return e.visible = this.visible,
  46271. e
  46272. }
  46273. },
  46274. Ci.PointsMaterial = function(e) {
  46275. Ci.Material.call(this),
  46276. this.type = "PointsMaterial",
  46277. this.color = new Ci.Color(16777215),
  46278. this.map = null,
  46279. this.size = 1,
  46280. this.sizeAttenuation = !0,
  46281. this.blending = Ci.NormalBlending,
  46282. this.vertexColors = Ci.NoColors,
  46283. this.fog = !0,
  46284. this.setValues(e)
  46285. }
  46286. ,
  46287. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  46288. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  46289. Ci.PointsMaterial.prototype.copy = function(e) {
  46290. return Ci.Material.prototype.copy.call(this, e),
  46291. this.color.copy(e.color),
  46292. this.map = e.map,
  46293. this.size = e.size,
  46294. this.sizeAttenuation = e.sizeAttenuation,
  46295. this.vertexColors = e.vertexColors,
  46296. this.fog = e.fog,
  46297. this
  46298. }
  46299. ,
  46300. Ci.ShaderMaterial = function(e) {
  46301. Ci.Material.call(this),
  46302. this.type = "ShaderMaterial",
  46303. this.defines = {},
  46304. this.uniforms = {},
  46305. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  46306. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  46307. this.shading = Ci.SmoothShading,
  46308. this.linewidth = 1,
  46309. this.wireframe = !1,
  46310. this.wireframeLinewidth = 1,
  46311. this.fog = !1,
  46312. this.lights = !1,
  46313. this.vertexColors = Ci.NoColors,
  46314. this.skinning = !1,
  46315. this.morphTargets = !1,
  46316. this.morphNormals = !1,
  46317. this.extensions = {
  46318. derivatives: !1,
  46319. fragDepth: !1,
  46320. drawBuffers: !1,
  46321. shaderTextureLOD: !1
  46322. },
  46323. this.defaultAttributeValues = {
  46324. color: [1, 1, 1],
  46325. uv: [0, 0],
  46326. uv2: [0, 0]
  46327. },
  46328. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  46329. this.setValues(e))
  46330. }
  46331. ,
  46332. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  46333. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  46334. Ci.ShaderMaterial.prototype.copy = function(e) {
  46335. return Ci.Material.prototype.copy.call(this, e),
  46336. this.fragmentShader = e.fragmentShader,
  46337. this.vertexShader = e.vertexShader,
  46338. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  46339. this.defines = e.defines,
  46340. this.shading = e.shading,
  46341. this.wireframe = e.wireframe,
  46342. this.wireframeLinewidth = e.wireframeLinewidth,
  46343. this.fog = e.fog,
  46344. this.lights = e.lights,
  46345. this.vertexColors = e.vertexColors,
  46346. this.skinning = e.skinning,
  46347. this.morphTargets = e.morphTargets,
  46348. this.morphNormals = e.morphNormals,
  46349. this.extensions = e.extensions,
  46350. this
  46351. }
  46352. ,
  46353. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  46354. var t = Ci.Material.prototype.toJSON.call(this, e);
  46355. return t.uniforms = this.uniforms,
  46356. t.vertexShader = this.vertexShader,
  46357. t.fragmentShader = this.fragmentShader,
  46358. t
  46359. }
  46360. ,
  46361. Ci.RawShaderMaterial = function(e) {
  46362. Ci.ShaderMaterial.call(this, e),
  46363. this.type = "RawShaderMaterial"
  46364. }
  46365. ,
  46366. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  46367. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  46368. Ci.SpriteMaterial = function(e) {
  46369. Ci.Material.call(this),
  46370. this.type = "SpriteMaterial",
  46371. this.color = new Ci.Color(16777215),
  46372. this.map = null,
  46373. this.rotation = 0,
  46374. this.fog = !1,
  46375. this.setValues(e)
  46376. }
  46377. ,
  46378. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  46379. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  46380. Ci.SpriteMaterial.prototype.copy = function(e) {
  46381. return Ci.Material.prototype.copy.call(this, e),
  46382. this.color.copy(e.color),
  46383. this.map = e.map,
  46384. this.rotation = e.rotation,
  46385. this.fog = e.fog,
  46386. this
  46387. }
  46388. ,
  46389. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  46390. Object.defineProperty(this, "id", {
  46391. value: Ci.TextureIdCount++
  46392. }),
  46393. this.uuid = Ci.Math.generateUUID(),
  46394. this.name = "",
  46395. this.sourceFile = "",
  46396. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  46397. this.mipmaps = [],
  46398. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  46399. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  46400. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  46401. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  46402. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  46403. this.anisotropy = void 0 !== l ? l : 1,
  46404. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  46405. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  46406. this.offset = new Ci.Vector2(0,0),
  46407. this.repeat = new Ci.Vector2(1,1),
  46408. this.generateMipmaps = !0,
  46409. this.premultiplyAlpha = !1,
  46410. this.flipY = !0,
  46411. this.unpackAlignment = 4,
  46412. this.encoding = Ci.LinearEncoding,
  46413. this.version = 0,
  46414. this.onUpdate = null
  46415. }
  46416. ,
  46417. Ci.Texture.DEFAULT_IMAGE = void 0,
  46418. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  46419. Ci.Texture.prototype = {
  46420. constructor: Ci.Texture,
  46421. set needsUpdate(e) {
  46422. !0 === e && this.version++
  46423. },
  46424. clone: function() {
  46425. return (new this.constructor).copy(this)
  46426. },
  46427. copy: function(e) {
  46428. return this.image = e.image,
  46429. this.mipmaps = e.mipmaps.slice(0),
  46430. this.mapping = e.mapping,
  46431. this.wrapS = e.wrapS,
  46432. this.wrapT = e.wrapT,
  46433. this.magFilter = e.magFilter,
  46434. this.minFilter = e.minFilter,
  46435. this.anisotropy = e.anisotropy,
  46436. this.format = e.format,
  46437. this.type = e.type,
  46438. this.offset.copy(e.offset),
  46439. this.repeat.copy(e.repeat),
  46440. this.generateMipmaps = e.generateMipmaps,
  46441. this.premultiplyAlpha = e.premultiplyAlpha,
  46442. this.flipY = e.flipY,
  46443. this.unpackAlignment = e.unpackAlignment,
  46444. this.encoding = e.encoding,
  46445. this
  46446. },
  46447. toJSON: function(e) {
  46448. if (void 0 !== e.textures[this.uuid])
  46449. return e.textures[this.uuid];
  46450. var t, i, n = {
  46451. metadata: {
  46452. version: 4.4,
  46453. type: "Texture",
  46454. generator: "Texture.toJSON"
  46455. },
  46456. uuid: this.uuid,
  46457. name: this.name,
  46458. mapping: this.mapping,
  46459. repeat: [this.repeat.x, this.repeat.y],
  46460. offset: [this.offset.x, this.offset.y],
  46461. wrap: [this.wrapS, this.wrapT],
  46462. minFilter: this.minFilter,
  46463. magFilter: this.magFilter,
  46464. anisotropy: this.anisotropy
  46465. };
  46466. if (void 0 !== this.image) {
  46467. var r = this.image;
  46468. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  46469. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  46470. uuid: r.uuid,
  46471. url: (t = r,
  46472. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  46473. i.height = t.height,
  46474. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  46475. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  46476. }),
  46477. n.image = r.uuid
  46478. }
  46479. return e.textures[this.uuid] = n
  46480. },
  46481. dispose: function() {
  46482. this.dispatchEvent({
  46483. type: "dispose"
  46484. })
  46485. },
  46486. transformUv: function(e) {
  46487. if (this.mapping === Ci.UVMapping) {
  46488. if (e.multiply(this.repeat),
  46489. e.add(this.offset),
  46490. e.x < 0 || 1 < e.x)
  46491. switch (this.wrapS) {
  46492. case Ci.RepeatWrapping:
  46493. e.x = e.x - Math.floor(e.x);
  46494. break;
  46495. case Ci.ClampToEdgeWrapping:
  46496. e.x = e.x < 0 ? 0 : 1;
  46497. break;
  46498. case Ci.MirroredRepeatWrapping:
  46499. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  46500. }
  46501. if (e.y < 0 || 1 < e.y)
  46502. switch (this.wrapT) {
  46503. case Ci.RepeatWrapping:
  46504. e.y = e.y - Math.floor(e.y);
  46505. break;
  46506. case Ci.ClampToEdgeWrapping:
  46507. e.y = e.y < 0 ? 0 : 1;
  46508. break;
  46509. case Ci.MirroredRepeatWrapping:
  46510. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  46511. }
  46512. this.flipY && (e.y = 1 - e.y)
  46513. }
  46514. }
  46515. },
  46516. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  46517. Ci.TextureIdCount = 0,
  46518. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  46519. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  46520. this.needsUpdate = !0
  46521. }
  46522. ,
  46523. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  46524. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  46525. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  46526. e = void 0 !== e ? e : [],
  46527. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  46528. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  46529. this.flipY = !1
  46530. }
  46531. ,
  46532. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  46533. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  46534. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  46535. get: function() {
  46536. return this.image
  46537. },
  46538. set: function(e) {
  46539. this.image = e
  46540. }
  46541. }),
  46542. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  46543. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  46544. this.image = {
  46545. width: t,
  46546. height: i
  46547. },
  46548. this.mipmaps = e,
  46549. this.flipY = !1,
  46550. this.generateMipmaps = !1
  46551. }
  46552. ,
  46553. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  46554. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  46555. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  46556. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  46557. this.image = {
  46558. data: e,
  46559. width: t,
  46560. height: i
  46561. },
  46562. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  46563. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  46564. this.flipY = !1,
  46565. this.generateMipmaps = !1
  46566. }
  46567. ,
  46568. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  46569. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  46570. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  46571. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  46572. this.generateMipmaps = !1;
  46573. var c = this;
  46574. !function e() {
  46575. requestAnimationFrame(e),
  46576. t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  46577. }()
  46578. }
  46579. ,
  46580. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  46581. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  46582. Ci.Group = function() {
  46583. Ci.Object3D.call(this),
  46584. this.type = "Group"
  46585. }
  46586. ,
  46587. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  46588. Ci.Group.prototype.constructor = Ci.Group,
  46589. Ci.Points = function(e, t) {
  46590. Ci.Object3D.call(this),
  46591. this.type = "Points",
  46592. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46593. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  46594. color: 16777215 * Math.random()
  46595. })
  46596. }
  46597. ,
  46598. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  46599. Ci.Points.prototype.constructor = Ci.Points,
  46600. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  46601. jt = new Ci.Ray,
  46602. Yt = new Ci.Sphere,
  46603. function(o, a) {
  46604. function e(e, t) {
  46605. var i = jt.distanceSqToPoint(e);
  46606. if (i < c) {
  46607. var n = jt.closestPointToPoint(e);
  46608. n.applyMatrix4(l);
  46609. var r = o.ray.origin.distanceTo(n);
  46610. if (r < o.near || r > o.far)
  46611. return;
  46612. a.push({
  46613. distance: r,
  46614. distanceToRay: Math.sqrt(i),
  46615. point: n.clone(),
  46616. index: t,
  46617. face: null,
  46618. object: s
  46619. })
  46620. }
  46621. }
  46622. var s = this
  46623. , t = this.geometry
  46624. , l = this.matrixWorld
  46625. , i = o.params.Points.threshold;
  46626. if (null === t.boundingSphere && t.computeBoundingSphere(),
  46627. Yt.copy(t.boundingSphere),
  46628. Yt.applyMatrix4(l),
  46629. !1 !== o.ray.intersectsSphere(Yt)) {
  46630. Wt.getInverse(l),
  46631. jt.copy(o.ray).applyMatrix4(Wt);
  46632. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  46633. , c = n * n
  46634. , r = new Ci.Vector3;
  46635. if (t instanceof Ci.BufferGeometry) {
  46636. var h = t.index
  46637. , u = t.attributes.position.array;
  46638. if (null !== h)
  46639. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  46640. var g = d[p];
  46641. r.fromArray(u, 3 * g),
  46642. e(r, g)
  46643. }
  46644. else {
  46645. p = 0;
  46646. for (var m = u.length / 3; p < m; p++)
  46647. r.fromArray(u, 3 * p),
  46648. e(r, p)
  46649. }
  46650. } else {
  46651. var v = t.vertices;
  46652. for (p = 0,
  46653. m = v.length; p < m; p++)
  46654. e(v[p], p)
  46655. }
  46656. }
  46657. }
  46658. ),
  46659. Ci.Points.prototype.clone = function() {
  46660. return new this.constructor(this.geometry,this.material).copy(this)
  46661. }
  46662. ,
  46663. Ci.Line = function(e, t, i) {
  46664. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  46665. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  46666. this.type = "Line",
  46667. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46668. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  46669. color: 16777215 * Math.random()
  46670. })))
  46671. }
  46672. ,
  46673. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  46674. Ci.Line.prototype.constructor = Ci.Line,
  46675. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  46676. zt = new Ci.Ray,
  46677. Gt = new Ci.Sphere,
  46678. function(e, t) {
  46679. var i = e.linePrecision
  46680. , n = i * i
  46681. , r = this.geometry
  46682. , o = this.matrixWorld;
  46683. if (null === r.boundingSphere && r.computeBoundingSphere(),
  46684. Gt.copy(r.boundingSphere),
  46685. Gt.applyMatrix4(o),
  46686. !1 !== e.ray.intersectsSphere(Gt)) {
  46687. Ht.getInverse(o),
  46688. zt.copy(e.ray).applyMatrix4(Ht);
  46689. var a = new Ci.Vector3
  46690. , s = new Ci.Vector3
  46691. , l = new Ci.Vector3
  46692. , c = new Ci.Vector3
  46693. , h = this instanceof Ci.LineSegments ? 2 : 1;
  46694. if (r instanceof Ci.BufferGeometry) {
  46695. var u = r.index
  46696. , d = r.attributes.position.array;
  46697. if (null !== u)
  46698. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  46699. var m = p[f]
  46700. , v = p[f + 1];
  46701. a.fromArray(d, 3 * m),
  46702. s.fromArray(d, 3 * v),
  46703. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  46704. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  46705. distance: C,
  46706. point: l.clone().applyMatrix4(this.matrixWorld),
  46707. index: f,
  46708. face: null,
  46709. faceIndex: null,
  46710. object: this
  46711. }))
  46712. }
  46713. else
  46714. for (f = 0,
  46715. g = d.length / 3 - 1; f < g; f += h)
  46716. a.fromArray(d, 3 * f),
  46717. s.fromArray(d, 3 * f + 3),
  46718. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  46719. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  46720. distance: C,
  46721. point: l.clone().applyMatrix4(this.matrixWorld),
  46722. index: f,
  46723. face: null,
  46724. faceIndex: null,
  46725. object: this
  46726. }))
  46727. } else if (r instanceof Ci.Geometry) {
  46728. var y = r.vertices
  46729. , A = y.length;
  46730. for (f = 0; f < A - 1; f += h) {
  46731. var C;
  46732. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  46733. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  46734. distance: C,
  46735. point: l.clone().applyMatrix4(this.matrixWorld),
  46736. index: f,
  46737. face: null,
  46738. faceIndex: null,
  46739. object: this
  46740. }))
  46741. }
  46742. }
  46743. }
  46744. }
  46745. ),
  46746. Ci.Line.prototype.clone = function() {
  46747. return new this.constructor(this.geometry,this.material).copy(this)
  46748. }
  46749. ,
  46750. Ci.LineStrip = 0,
  46751. Ci.LinePieces = 1,
  46752. Ci.LineSegments = function(e, t) {
  46753. Ci.Line.call(this, e, t),
  46754. this.type = "LineSegments"
  46755. }
  46756. ,
  46757. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  46758. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  46759. Ci.Mesh = function(e, t) {
  46760. Ci.Object3D.call(this),
  46761. this.type = "Mesh",
  46762. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46763. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  46764. color: 16777215 * Math.random()
  46765. }),
  46766. this.drawMode = Ci.TrianglesDrawMode,
  46767. this.updateMorphTargets()
  46768. }
  46769. ,
  46770. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  46771. Ci.Mesh.prototype.constructor = Ci.Mesh,
  46772. Ci.Mesh.prototype.setDrawMode = function(e) {
  46773. this.drawMode = e
  46774. }
  46775. ,
  46776. Ci.Mesh.prototype.updateMorphTargets = function() {
  46777. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  46778. this.morphTargetBase = -1,
  46779. this.morphTargetInfluences = [],
  46780. this.morphTargetDictionary = {};
  46781. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  46782. this.morphTargetInfluences.push(0),
  46783. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  46784. }
  46785. }
  46786. ,
  46787. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  46788. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  46789. 0)
  46790. }
  46791. ,
  46792. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  46793. xt = new Ci.Ray,
  46794. St = new Ci.Sphere,
  46795. Mt = new Ci.Vector3,
  46796. Rt = new Ci.Vector3,
  46797. Pt = new Ci.Vector3,
  46798. Ot = new Ci.Vector3,
  46799. Lt = new Ci.Vector3,
  46800. Dt = new Ci.Vector3,
  46801. Nt = new Ci.Vector2,
  46802. Ft = new Ci.Vector2,
  46803. Bt = new Ci.Vector2,
  46804. Vt = new Ci.Vector3,
  46805. kt = new Ci.Vector3,
  46806. Ut = new Ci.Vector3,
  46807. function(e, t) {
  46808. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  46809. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  46810. St.copy(r.boundingSphere),
  46811. St.applyMatrix4(a),
  46812. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  46813. xt.copy(e.ray).applyMatrix4(Tt),
  46814. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  46815. if (r instanceof Ci.BufferGeometry) {
  46816. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  46817. if (void 0 !== u.uv && (i = u.uv.array),
  46818. null !== h)
  46819. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  46820. s = p[f],
  46821. l = p[f + 1],
  46822. c = p[f + 2],
  46823. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  46824. t.push(n));
  46825. else
  46826. for (f = 0,
  46827. g = d.length; f < g; f += 9)
  46828. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  46829. t.push(n))
  46830. } else if (r instanceof Ci.Geometry) {
  46831. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  46832. 0 < _.length && (i = _);
  46833. for (var b = 0, w = E.length; b < w; b++) {
  46834. var T = E[b]
  46835. , x = 1 == A ? C[T.materialIndex] : o;
  46836. if (void 0 !== x) {
  46837. if (m = I[T.a],
  46838. v = I[T.b],
  46839. y = I[T.c],
  46840. !0 === x.morphTargets) {
  46841. var S = r.morphTargets
  46842. , M = this.morphTargetInfluences;
  46843. Mt.set(0, 0, 0),
  46844. Rt.set(0, 0, 0),
  46845. Pt.set(0, 0, 0);
  46846. for (var R = 0, P = S.length; R < P; R++) {
  46847. var O = M[R];
  46848. if (0 !== O) {
  46849. var L = S[R].vertices;
  46850. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  46851. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  46852. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  46853. }
  46854. }
  46855. Mt.add(m),
  46856. Rt.add(v),
  46857. Pt.add(y),
  46858. m = Mt,
  46859. v = Rt,
  46860. y = Pt
  46861. }
  46862. if (n = wi(this, e, xt, m, v, y, kt)) {
  46863. if (i) {
  46864. var D = i[b];
  46865. Nt.copy(D[0]),
  46866. Ft.copy(D[1]),
  46867. Bt.copy(D[2]),
  46868. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  46869. }
  46870. n.face = T,
  46871. n.faceIndex = b,
  46872. t.push(n)
  46873. }
  46874. }
  46875. }
  46876. }
  46877. }
  46878. ),
  46879. Ci.Mesh.prototype.clone = function() {
  46880. return new this.constructor(this.geometry,this.material).copy(this)
  46881. }
  46882. ,
  46883. Ci.Bone = function(e) {
  46884. Ci.Object3D.call(this),
  46885. this.type = "Bone",
  46886. this.skin = e
  46887. }
  46888. ,
  46889. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  46890. Ci.Bone.prototype.constructor = Ci.Bone,
  46891. Ci.Bone.prototype.copy = function(e) {
  46892. return Ci.Object3D.prototype.copy.call(this, e),
  46893. this.skin = e.skin,
  46894. this
  46895. }
  46896. ,
  46897. Ci.Skeleton = function(e, t, i) {
  46898. if (this.useVertexTexture = void 0 === i || i,
  46899. this.identityMatrix = new Ci.Matrix4,
  46900. e = e || [],
  46901. this.bones = e.slice(0),
  46902. this.useVertexTexture) {
  46903. var n = Math.sqrt(4 * this.bones.length);
  46904. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  46905. n = Math.max(n, 4),
  46906. this.boneTextureWidth = n,
  46907. this.boneTextureHeight = n,
  46908. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  46909. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  46910. } else
  46911. this.boneMatrices = new Float32Array(16 * this.bones.length);
  46912. if (void 0 === t)
  46913. this.calculateInverses();
  46914. else if (this.bones.length === t.length)
  46915. this.boneInverses = t.slice(0);
  46916. else {
  46917. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  46918. this.boneInverses = [];
  46919. for (var r = 0, o = this.bones.length; r < o; r++)
  46920. this.boneInverses.push(new Ci.Matrix4)
  46921. }
  46922. }
  46923. ,
  46924. Ci.Skeleton.prototype.calculateInverses = function() {
  46925. this.boneInverses = [];
  46926. for (var e = 0, t = this.bones.length; e < t; e++) {
  46927. var i = new Ci.Matrix4;
  46928. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  46929. this.boneInverses.push(i)
  46930. }
  46931. }
  46932. ,
  46933. Ci.Skeleton.prototype.pose = function() {
  46934. for (var e, t = 0, i = this.bones.length; t < i; t++)
  46935. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  46936. for (t = 0,
  46937. i = this.bones.length; t < i; t++)
  46938. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  46939. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  46940. e.matrix.decompose(e.position, e.quaternion, e.scale))
  46941. }
  46942. ,
  46943. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  46944. function() {
  46945. for (var e = 0, t = this.bones.length; e < t; e++) {
  46946. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  46947. wt.multiplyMatrices(i, this.boneInverses[e]),
  46948. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  46949. }
  46950. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  46951. }
  46952. ),
  46953. Ci.Skeleton.prototype.clone = function() {
  46954. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  46955. }
  46956. ,
  46957. Ci.SkinnedMesh = function(e, t, i) {
  46958. Ci.Mesh.call(this, e, t),
  46959. this.type = "SkinnedMesh",
  46960. this.bindMode = "attached",
  46961. this.bindMatrix = new Ci.Matrix4,
  46962. this.bindMatrixInverse = new Ci.Matrix4;
  46963. var n = [];
  46964. if (this.geometry && void 0 !== this.geometry.bones) {
  46965. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  46966. o = this.geometry.bones[a],
  46967. r = new Ci.Bone(this),
  46968. n.push(r),
  46969. r.name = o.name,
  46970. r.position.fromArray(o.pos),
  46971. r.quaternion.fromArray(o.rotq),
  46972. void 0 !== o.scl && r.scale.fromArray(o.scl);
  46973. for (a = 0,
  46974. s = this.geometry.bones.length; a < s; ++a)
  46975. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  46976. }
  46977. this.normalizeSkinWeights(),
  46978. this.updateMatrixWorld(!0),
  46979. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  46980. }
  46981. ,
  46982. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  46983. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  46984. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  46985. this.skeleton = e,
  46986. void 0 === t && (this.updateMatrixWorld(!0),
  46987. this.skeleton.calculateInverses(),
  46988. t = this.matrixWorld),
  46989. this.bindMatrix.copy(t),
  46990. this.bindMatrixInverse.getInverse(t)
  46991. }
  46992. ,
  46993. Ci.SkinnedMesh.prototype.pose = function() {
  46994. this.skeleton.pose()
  46995. }
  46996. ,
  46997. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  46998. if (this.geometry instanceof Ci.Geometry)
  46999. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47000. var t = this.geometry.skinWeights[e];
  47001. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47002. }
  47003. else if (this.geometry instanceof Ci.BufferGeometry) {
  47004. var i = new Ci.Vector4
  47005. , n = this.geometry.attributes.skinWeight;
  47006. for (e = 0; e < n.count; e++) {
  47007. var r;
  47008. i.x = n.getX(e),
  47009. i.y = n.getY(e),
  47010. i.z = n.getZ(e),
  47011. i.w = n.getW(e),
  47012. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47013. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47014. }
  47015. }
  47016. }
  47017. ,
  47018. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47019. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47020. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47021. }
  47022. ,
  47023. Ci.SkinnedMesh.prototype.clone = function() {
  47024. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47025. }
  47026. ,
  47027. Ci.LOD = function() {
  47028. Ci.Object3D.call(this),
  47029. this.type = "LOD",
  47030. Object.defineProperties(this, {
  47031. levels: {
  47032. enumerable: !0,
  47033. value: []
  47034. },
  47035. objects: {
  47036. get: function() {
  47037. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47038. this.levels
  47039. }
  47040. }
  47041. })
  47042. }
  47043. ,
  47044. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  47045. Ci.LOD.prototype.constructor = Ci.LOD,
  47046. Ci.LOD.prototype.addLevel = function(e, t) {
  47047. void 0 === t && (t = 0),
  47048. t = Math.abs(t);
  47049. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47050. ;
  47051. i.splice(n, 0, {
  47052. distance: t,
  47053. object: e
  47054. }),
  47055. this.add(e)
  47056. }
  47057. ,
  47058. Ci.LOD.prototype.getObjectForDistance = function(e) {
  47059. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47060. ;
  47061. return t[i - 1].object
  47062. }
  47063. ,
  47064. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  47065. function(e, t) {
  47066. bt.setFromMatrixPosition(this.matrixWorld);
  47067. var i = e.ray.origin.distanceTo(bt);
  47068. this.getObjectForDistance(i).raycast(e, t)
  47069. }
  47070. ),
  47071. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  47072. _t = new Ci.Vector3,
  47073. function(e) {
  47074. var t = this.levels;
  47075. if (1 < t.length) {
  47076. Et.setFromMatrixPosition(e.matrixWorld),
  47077. _t.setFromMatrixPosition(this.matrixWorld);
  47078. var i = Et.distanceTo(_t);
  47079. t[0].object.visible = !0;
  47080. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  47081. t[n - 1].object.visible = !1,
  47082. t[n].object.visible = !0;
  47083. for (; n < r; n++)
  47084. t[n].object.visible = !1
  47085. }
  47086. }
  47087. ),
  47088. Ci.LOD.prototype.copy = function(e) {
  47089. Ci.Object3D.prototype.copy.call(this, e, !1);
  47090. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  47091. var r = t[i];
  47092. this.addLevel(r.object.clone(), r.distance)
  47093. }
  47094. return this
  47095. }
  47096. ,
  47097. Ci.LOD.prototype.toJSON = function(e) {
  47098. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  47099. t.object.levels = [];
  47100. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  47101. var o = i[n];
  47102. t.object.levels.push({
  47103. object: o.object.uuid,
  47104. distance: o.distance
  47105. })
  47106. }
  47107. return t
  47108. }
  47109. ,
  47110. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  47111. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  47112. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  47113. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  47114. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  47115. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  47116. function(e) {
  47117. Ci.Object3D.call(this),
  47118. this.type = "Sprite",
  47119. this.geometry = It,
  47120. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  47121. }
  47122. ),
  47123. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  47124. Ci.Sprite.prototype.constructor = Ci.Sprite,
  47125. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  47126. function(e, t) {
  47127. vt.setFromMatrixPosition(this.matrixWorld);
  47128. var i = e.ray.distanceSqToPoint(vt);
  47129. this.scale.x * this.scale.y < i || t.push({
  47130. distance: Math.sqrt(i),
  47131. point: this.position,
  47132. face: null,
  47133. object: this
  47134. })
  47135. }
  47136. ),
  47137. Ci.Sprite.prototype.clone = function() {
  47138. return new this.constructor(this.material).copy(this)
  47139. }
  47140. ,
  47141. Ci.Particle = Ci.Sprite,
  47142. Ci.LensFlare = function(e, t, i, n, r) {
  47143. Ci.Object3D.call(this),
  47144. this.lensFlares = [],
  47145. this.positionScreen = new Ci.Vector3,
  47146. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  47147. }
  47148. ,
  47149. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  47150. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  47151. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  47152. void 0 === t && (t = -1),
  47153. void 0 === i && (i = 0),
  47154. void 0 === o && (o = 1),
  47155. void 0 === r && (r = new Ci.Color(16777215)),
  47156. void 0 === n && (n = Ci.NormalBlending),
  47157. i = Math.min(i, Math.max(0, i)),
  47158. this.lensFlares.push({
  47159. texture: e,
  47160. size: t,
  47161. distance: i,
  47162. x: 0,
  47163. y: 0,
  47164. z: 0,
  47165. scale: 1,
  47166. rotation: 0,
  47167. opacity: o,
  47168. color: r,
  47169. blending: n
  47170. })
  47171. }
  47172. ,
  47173. Ci.LensFlare.prototype.updateLensFlares = function() {
  47174. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47175. for (e = 0; e < i; e++)
  47176. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  47177. t.y = this.positionScreen.y + r * t.distance,
  47178. t.wantedRotation = t.x * Math.PI * .25,
  47179. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47180. }
  47181. ,
  47182. Ci.LensFlare.prototype.copy = function(e) {
  47183. Ci.Object3D.prototype.copy.call(this, e),
  47184. this.positionScreen.copy(e.positionScreen),
  47185. this.customUpdateCallback = e.customUpdateCallback;
  47186. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47187. this.lensFlares.push(e.lensFlares[t]);
  47188. return this
  47189. }
  47190. ,
  47191. Ci.Scene = function() {
  47192. Ci.Object3D.call(this),
  47193. this.type = "Scene",
  47194. this.fog = null,
  47195. this.overrideMaterial = null,
  47196. this.autoUpdate = !0
  47197. }
  47198. ,
  47199. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  47200. Ci.Scene.prototype.constructor = Ci.Scene,
  47201. Ci.Scene.prototype.copy = function(e, t) {
  47202. return Ci.Object3D.prototype.copy.call(this, e, t),
  47203. null !== e.fog && (this.fog = e.fog.clone()),
  47204. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47205. this.autoUpdate = e.autoUpdate,
  47206. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47207. this
  47208. }
  47209. ,
  47210. Ci.Fog = function(e, t, i) {
  47211. this.name = "",
  47212. this.color = new Ci.Color(e),
  47213. this.near = void 0 !== t ? t : 1,
  47214. this.far = void 0 !== i ? i : 1e3
  47215. }
  47216. ,
  47217. Ci.Fog.prototype.clone = function() {
  47218. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  47219. }
  47220. ,
  47221. Ci.FogExp2 = function(e, t) {
  47222. this.name = "",
  47223. this.color = new Ci.Color(e),
  47224. this.density = void 0 !== t ? t : 25e-5
  47225. }
  47226. ,
  47227. Ci.FogExp2.prototype.clone = function() {
  47228. return new Ci.FogExp2(this.color.getHex(),this.density)
  47229. }
  47230. ,
  47231. Ci.ShaderChunk = {},
  47232. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  47233. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  47234. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  47235. 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",
  47236. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  47237. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  47238. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  47239. 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",
  47240. 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",
  47241. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  47242. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  47243. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  47244. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  47245. 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",
  47246. 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",
  47247. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  47248. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  47249. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  47250. 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",
  47251. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  47252. 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",
  47253. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  47254. 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",
  47255. 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",
  47256. 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",
  47257. 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",
  47258. 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",
  47259. 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",
  47260. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  47261. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  47262. 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",
  47263. 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",
  47264. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  47265. 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",
  47266. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  47267. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  47268. 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",
  47269. 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",
  47270. 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",
  47271. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  47272. 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",
  47273. 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",
  47274. 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",
  47275. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  47276. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  47277. 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",
  47278. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  47279. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  47280. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  47281. 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",
  47282. 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",
  47283. 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",
  47284. 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",
  47285. 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",
  47286. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  47287. 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",
  47288. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  47289. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  47290. 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",
  47291. 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",
  47292. 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",
  47293. 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",
  47294. 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",
  47295. 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",
  47296. 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",
  47297. 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",
  47298. 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",
  47299. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  47300. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  47301. 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",
  47302. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  47303. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  47304. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  47305. 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",
  47306. 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",
  47307. 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",
  47308. 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",
  47309. Ci.UniformsUtils = {
  47310. merge: function(e) {
  47311. for (var t = {}, i = 0; i < e.length; i++) {
  47312. var n = this.clone(e[i]);
  47313. for (var r in n)
  47314. t[r] = n[r]
  47315. }
  47316. return t
  47317. },
  47318. clone: function(e) {
  47319. var t = {};
  47320. for (var i in e)
  47321. for (var n in t[i] = {},
  47322. e[i]) {
  47323. var r = e[i][n];
  47324. 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
  47325. }
  47326. return t
  47327. }
  47328. },
  47329. Ci.UniformsLib = {
  47330. common: {
  47331. diffuse: {
  47332. type: "c",
  47333. value: new Ci.Color(15658734)
  47334. },
  47335. opacity: {
  47336. type: "f",
  47337. value: 1
  47338. },
  47339. map: {
  47340. type: "t",
  47341. value: null
  47342. },
  47343. offsetRepeat: {
  47344. type: "v4",
  47345. value: new Ci.Vector4(0,0,1,1)
  47346. },
  47347. specularMap: {
  47348. type: "t",
  47349. value: null
  47350. },
  47351. alphaMap: {
  47352. type: "t",
  47353. value: null
  47354. },
  47355. envMap: {
  47356. type: "t",
  47357. value: null
  47358. },
  47359. flipEnvMap: {
  47360. type: "f",
  47361. value: -1
  47362. },
  47363. reflectivity: {
  47364. type: "f",
  47365. value: 1
  47366. },
  47367. refractionRatio: {
  47368. type: "f",
  47369. value: .98
  47370. }
  47371. },
  47372. aomap: {
  47373. aoMap: {
  47374. type: "t",
  47375. value: null
  47376. },
  47377. aoMapIntensity: {
  47378. type: "f",
  47379. value: 1
  47380. }
  47381. },
  47382. lightmap: {
  47383. lightMap: {
  47384. type: "t",
  47385. value: null
  47386. },
  47387. lightMapIntensity: {
  47388. type: "f",
  47389. value: 1
  47390. }
  47391. },
  47392. emissivemap: {
  47393. emissiveMap: {
  47394. type: "t",
  47395. value: null
  47396. }
  47397. },
  47398. bumpmap: {
  47399. bumpMap: {
  47400. type: "t",
  47401. value: null
  47402. },
  47403. bumpScale: {
  47404. type: "f",
  47405. value: 1
  47406. }
  47407. },
  47408. normalmap: {
  47409. normalMap: {
  47410. type: "t",
  47411. value: null
  47412. },
  47413. normalScale: {
  47414. type: "v2",
  47415. value: new Ci.Vector2(1,1)
  47416. }
  47417. },
  47418. displacementmap: {
  47419. displacementMap: {
  47420. type: "t",
  47421. value: null
  47422. },
  47423. displacementScale: {
  47424. type: "f",
  47425. value: 1
  47426. },
  47427. displacementBias: {
  47428. type: "f",
  47429. value: 0
  47430. }
  47431. },
  47432. roughnessmap: {
  47433. roughnessMap: {
  47434. type: "t",
  47435. value: null
  47436. }
  47437. },
  47438. metalnessmap: {
  47439. metalnessMap: {
  47440. type: "t",
  47441. value: null
  47442. }
  47443. },
  47444. fog: {
  47445. fogDensity: {
  47446. type: "f",
  47447. value: 25e-5
  47448. },
  47449. fogNear: {
  47450. type: "f",
  47451. value: 1
  47452. },
  47453. fogFar: {
  47454. type: "f",
  47455. value: 2e3
  47456. },
  47457. fogColor: {
  47458. type: "c",
  47459. value: new Ci.Color(16777215)
  47460. }
  47461. },
  47462. lights: {
  47463. ambientLightColor: {
  47464. type: "fv",
  47465. value: []
  47466. },
  47467. directionalLights: {
  47468. type: "sa",
  47469. value: [],
  47470. properties: {
  47471. direction: {
  47472. type: "v3"
  47473. },
  47474. color: {
  47475. type: "c"
  47476. },
  47477. shadow: {
  47478. type: "i"
  47479. },
  47480. shadowBias: {
  47481. type: "f"
  47482. },
  47483. shadowRadius: {
  47484. type: "f"
  47485. },
  47486. shadowMapSize: {
  47487. type: "v2"
  47488. }
  47489. }
  47490. },
  47491. directionalShadowMap: {
  47492. type: "tv",
  47493. value: []
  47494. },
  47495. directionalShadowMatrix: {
  47496. type: "m4v",
  47497. value: []
  47498. },
  47499. spotLights: {
  47500. type: "sa",
  47501. value: [],
  47502. properties: {
  47503. color: {
  47504. type: "c"
  47505. },
  47506. position: {
  47507. type: "v3"
  47508. },
  47509. direction: {
  47510. type: "v3"
  47511. },
  47512. distance: {
  47513. type: "f"
  47514. },
  47515. coneCos: {
  47516. type: "f"
  47517. },
  47518. penumbraCos: {
  47519. type: "f"
  47520. },
  47521. decay: {
  47522. type: "f"
  47523. },
  47524. shadow: {
  47525. type: "i"
  47526. },
  47527. shadowBias: {
  47528. type: "f"
  47529. },
  47530. shadowRadius: {
  47531. type: "f"
  47532. },
  47533. shadowMapSize: {
  47534. type: "v2"
  47535. }
  47536. }
  47537. },
  47538. spotShadowMap: {
  47539. type: "tv",
  47540. value: []
  47541. },
  47542. spotShadowMatrix: {
  47543. type: "m4v",
  47544. value: []
  47545. },
  47546. pointLights: {
  47547. type: "sa",
  47548. value: [],
  47549. properties: {
  47550. color: {
  47551. type: "c"
  47552. },
  47553. position: {
  47554. type: "v3"
  47555. },
  47556. decay: {
  47557. type: "f"
  47558. },
  47559. distance: {
  47560. type: "f"
  47561. },
  47562. shadow: {
  47563. type: "i"
  47564. },
  47565. shadowBias: {
  47566. type: "f"
  47567. },
  47568. shadowRadius: {
  47569. type: "f"
  47570. },
  47571. shadowMapSize: {
  47572. type: "v2"
  47573. }
  47574. }
  47575. },
  47576. pointShadowMap: {
  47577. type: "tv",
  47578. value: []
  47579. },
  47580. pointShadowMatrix: {
  47581. type: "m4v",
  47582. value: []
  47583. },
  47584. hemisphereLights: {
  47585. type: "sa",
  47586. value: [],
  47587. properties: {
  47588. direction: {
  47589. type: "v3"
  47590. },
  47591. skyColor: {
  47592. type: "c"
  47593. },
  47594. groundColor: {
  47595. type: "c"
  47596. }
  47597. }
  47598. }
  47599. },
  47600. points: {
  47601. diffuse: {
  47602. type: "c",
  47603. value: new Ci.Color(15658734)
  47604. },
  47605. opacity: {
  47606. type: "f",
  47607. value: 1
  47608. },
  47609. size: {
  47610. type: "f",
  47611. value: 1
  47612. },
  47613. scale: {
  47614. type: "f",
  47615. value: 1
  47616. },
  47617. map: {
  47618. type: "t",
  47619. value: null
  47620. },
  47621. offsetRepeat: {
  47622. type: "v4",
  47623. value: new Ci.Vector4(0,0,1,1)
  47624. }
  47625. }
  47626. },
  47627. 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",
  47628. 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",
  47629. 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",
  47630. 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",
  47631. 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",
  47632. 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",
  47633. 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",
  47634. 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",
  47635. 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",
  47636. 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",
  47637. 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",
  47638. 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",
  47639. 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",
  47640. 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",
  47641. 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",
  47642. 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",
  47643. 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",
  47644. 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",
  47645. 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",
  47646. 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",
  47647. 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",
  47648. 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",
  47649. 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",
  47650. 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",
  47651. Ci.ShaderLib = {
  47652. basic: {
  47653. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  47654. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  47655. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  47656. },
  47657. lambert: {
  47658. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  47659. emissive: {
  47660. type: "c",
  47661. value: new Ci.Color(0)
  47662. }
  47663. }]),
  47664. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  47665. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  47666. },
  47667. phong: {
  47668. 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, {
  47669. emissive: {
  47670. type: "c",
  47671. value: new Ci.Color(0)
  47672. },
  47673. specular: {
  47674. type: "c",
  47675. value: new Ci.Color(1118481)
  47676. },
  47677. shininess: {
  47678. type: "f",
  47679. value: 30
  47680. }
  47681. }]),
  47682. vertexShader: Ci.ShaderChunk.meshphong_vert,
  47683. fragmentShader: Ci.ShaderChunk.meshphong_frag
  47684. },
  47685. standard: {
  47686. 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, {
  47687. emissive: {
  47688. type: "c",
  47689. value: new Ci.Color(0)
  47690. },
  47691. roughness: {
  47692. type: "f",
  47693. value: .5
  47694. },
  47695. metalness: {
  47696. type: "f",
  47697. value: 0
  47698. },
  47699. envMapIntensity: {
  47700. type: "f",
  47701. value: 1
  47702. }
  47703. }]),
  47704. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  47705. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  47706. },
  47707. points: {
  47708. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  47709. vertexShader: Ci.ShaderChunk.points_vert,
  47710. fragmentShader: Ci.ShaderChunk.points_frag
  47711. },
  47712. dashed: {
  47713. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  47714. scale: {
  47715. type: "f",
  47716. value: 1
  47717. },
  47718. dashSize: {
  47719. type: "f",
  47720. value: 1
  47721. },
  47722. totalSize: {
  47723. type: "f",
  47724. value: 2
  47725. }
  47726. }]),
  47727. vertexShader: Ci.ShaderChunk.linedashed_vert,
  47728. fragmentShader: Ci.ShaderChunk.linedashed_frag
  47729. },
  47730. depth: {
  47731. uniforms: {
  47732. mNear: {
  47733. type: "f",
  47734. value: 1
  47735. },
  47736. mFar: {
  47737. type: "f",
  47738. value: 2e3
  47739. },
  47740. opacity: {
  47741. type: "f",
  47742. value: 1
  47743. }
  47744. },
  47745. vertexShader: Ci.ShaderChunk.depth_vert,
  47746. fragmentShader: Ci.ShaderChunk.depth_frag
  47747. },
  47748. normal: {
  47749. uniforms: {
  47750. opacity: {
  47751. type: "f",
  47752. value: 1
  47753. }
  47754. },
  47755. vertexShader: Ci.ShaderChunk.normal_vert,
  47756. fragmentShader: Ci.ShaderChunk.normal_frag
  47757. },
  47758. cube: {
  47759. uniforms: {
  47760. tCube: {
  47761. type: "t",
  47762. value: null
  47763. },
  47764. tFlip: {
  47765. type: "f",
  47766. value: -1
  47767. }
  47768. },
  47769. vertexShader: Ci.ShaderChunk.cube_vert,
  47770. fragmentShader: Ci.ShaderChunk.cube_frag
  47771. },
  47772. equirect: {
  47773. uniforms: {
  47774. tEquirect: {
  47775. type: "t",
  47776. value: null
  47777. },
  47778. tFlip: {
  47779. type: "f",
  47780. value: -1
  47781. }
  47782. },
  47783. vertexShader: Ci.ShaderChunk.equirect_vert,
  47784. fragmentShader: Ci.ShaderChunk.equirect_frag
  47785. },
  47786. depthRGBA: {
  47787. uniforms: {},
  47788. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  47789. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  47790. },
  47791. distanceRGBA: {
  47792. uniforms: {
  47793. lightPos: {
  47794. type: "v3",
  47795. value: new Ci.Vector3(0,0,0)
  47796. }
  47797. },
  47798. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  47799. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  47800. }
  47801. },
  47802. Ci.WebGLRenderer = function(e) {
  47803. function S() {
  47804. return null === Q ? he : 1
  47805. }
  47806. function i(e, t, i, n) {
  47807. !0 === V && (e *= n,
  47808. t *= n,
  47809. i *= n),
  47810. _e.clearColor(e, t, i, n)
  47811. }
  47812. function t() {
  47813. _e.init(),
  47814. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  47815. _e.viewport(re.copy(pe).multiplyScalar(he)),
  47816. i(ae.r, ae.g, ae.b, se)
  47817. }
  47818. function n() {
  47819. te = K = null,
  47820. ee = "",
  47821. $ = -1,
  47822. _e.reset()
  47823. }
  47824. function r(e) {
  47825. e.preventDefault(),
  47826. n(),
  47827. t(),
  47828. be.clear()
  47829. }
  47830. function f(e) {
  47831. var t = e.target;
  47832. t.removeEventListener("dispose", f),
  47833. function(e) {
  47834. var t = be.get(e);
  47835. if (e.image && t.__image__webglTextureCube)
  47836. X.deleteTexture(t.__image__webglTextureCube);
  47837. else {
  47838. if (void 0 === t.__webglInit)
  47839. return;
  47840. X.deleteTexture(t.__webglTexture)
  47841. }
  47842. be.delete(e)
  47843. }(t),
  47844. ye.textures--
  47845. }
  47846. function a(e) {
  47847. var t = e.target;
  47848. t.removeEventListener("dispose", a),
  47849. function(e) {
  47850. var t = be.get(e)
  47851. , i = be.get(e.texture);
  47852. if (e && void 0 !== i.__webglTexture) {
  47853. if (X.deleteTexture(i.__webglTexture),
  47854. e instanceof Ci.WebGLRenderTargetCube)
  47855. for (var n = 0; n < 6; n++)
  47856. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  47857. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  47858. else
  47859. X.deleteFramebuffer(t.__webglFramebuffer),
  47860. X.deleteRenderbuffer(t.__webglDepthbuffer);
  47861. be.delete(e.texture),
  47862. be.delete(e)
  47863. }
  47864. }(t),
  47865. ye.textures--
  47866. }
  47867. function v(e) {
  47868. var t = e.target;
  47869. t.removeEventListener("dispose", v),
  47870. function(e) {
  47871. y(e),
  47872. be.delete(e)
  47873. }(t)
  47874. }
  47875. function y(e) {
  47876. var t = be.get(e).program;
  47877. (e.program = void 0) !== t && Te.releaseProgram(t)
  47878. }
  47879. function M(e, t) {
  47880. return Math.abs(t[0]) - Math.abs(e[0])
  47881. }
  47882. function s(e, t) {
  47883. 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
  47884. }
  47885. function l(e, t) {
  47886. 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
  47887. }
  47888. function d(e, t, i, n, r) {
  47889. var o, a;
  47890. a = i.transparent ? (o = G,
  47891. ++W) : (o = H,
  47892. ++z);
  47893. var s = o[a];
  47894. void 0 !== s ? (s.id = e.id,
  47895. s.object = e,
  47896. s.geometry = t,
  47897. s.material = i,
  47898. s.z = me.z,
  47899. s.group = r) : (s = {
  47900. id: e.id,
  47901. object: e,
  47902. geometry: t,
  47903. material: i,
  47904. z: me.z,
  47905. group: r
  47906. },
  47907. o.push(s))
  47908. }
  47909. function c(e, t, i, n) {
  47910. for (var r = 0, o = e.length; r < o; r++) {
  47911. var a = e[r]
  47912. , s = a.object
  47913. , l = a.geometry
  47914. , c = void 0 === n ? a.material : n
  47915. , h = a.group;
  47916. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  47917. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  47918. s instanceof Ci.ImmediateRenderObject) {
  47919. R(c);
  47920. var u = P(t, i, c, s);
  47921. ee = "",
  47922. s.render(function(e) {
  47923. Z.renderBufferImmediate(e, u, c)
  47924. })
  47925. } else
  47926. Z.renderBufferDirect(t, i, l, c, s, h)
  47927. }
  47928. }
  47929. function R(e) {
  47930. (function(e) {
  47931. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  47932. _e.setFlipSided(e.side === Ci.BackSide)
  47933. }
  47934. )(e),
  47935. !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),
  47936. _e.setDepthFunc(e.depthFunc),
  47937. _e.setDepthTest(e.depthTest),
  47938. _e.setDepthWrite(e.depthWrite),
  47939. _e.setColorWrite(e.colorWrite),
  47940. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  47941. }
  47942. function P(e, t, i, n) {
  47943. oe = 0;
  47944. var r = be.get(i);
  47945. void 0 === r.program && (i.needsUpdate = !0),
  47946. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  47947. i.needsUpdate && (function(e, t, i) {
  47948. var n = be.get(e)
  47949. , r = Te.getParameters(e, ve, t, i)
  47950. , o = Te.getProgramCode(e, r)
  47951. , a = n.program
  47952. , s = !0;
  47953. if (void 0 === a)
  47954. e.addEventListener("dispose", v);
  47955. else if (a.code !== o)
  47956. y(e);
  47957. else {
  47958. if (void 0 !== r.shaderID)
  47959. return;
  47960. s = !1
  47961. }
  47962. if (s) {
  47963. if (r.shaderID) {
  47964. var l = Ci.ShaderLib[r.shaderID];
  47965. n.__webglShader = {
  47966. name: e.type,
  47967. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  47968. vertexShader: l.vertexShader,
  47969. fragmentShader: l.fragmentShader
  47970. }
  47971. } else
  47972. n.__webglShader = {
  47973. name: e.type,
  47974. uniforms: e.uniforms,
  47975. vertexShader: e.vertexShader,
  47976. fragmentShader: e.fragmentShader
  47977. };
  47978. e.__webglShader = n.__webglShader,
  47979. a = Te.acquireProgram(e, r, o),
  47980. n.program = a,
  47981. e.program = a
  47982. }
  47983. var c = a.getAttributes();
  47984. if (e.morphTargets)
  47985. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  47986. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  47987. if (e.morphNormals)
  47988. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  47989. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  47990. n.uniformsList = [];
  47991. var u = n.__webglShader.uniforms
  47992. , d = n.program.getUniforms();
  47993. for (var p in u) {
  47994. var f = d[p];
  47995. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  47996. }
  47997. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  47998. u.ambientLightColor.value = ve.ambient,
  47999. u.directionalLights.value = ve.directional,
  48000. u.spotLights.value = ve.spot,
  48001. u.pointLights.value = ve.point,
  48002. u.hemisphereLights.value = ve.hemi,
  48003. u.directionalShadowMap.value = ve.directionalShadowMap,
  48004. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48005. u.spotShadowMap.value = ve.spotShadowMap,
  48006. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48007. u.pointShadowMap.value = ve.pointShadowMap,
  48008. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48009. n.hasDynamicUniforms = !1;
  48010. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48011. if (!0 === n.uniformsList[g][0].dynamic) {
  48012. n.hasDynamicUniforms = !0;
  48013. break
  48014. }
  48015. }
  48016. }(i, t, n),
  48017. i.needsUpdate = !1);
  48018. var o = !1
  48019. , a = !1
  48020. , s = !1
  48021. , l = r.program
  48022. , c = l.getUniforms()
  48023. , h = r.__webglShader.uniforms;
  48024. if (l.id !== K && (X.useProgram(l.program),
  48025. K = l.id,
  48026. s = a = o = !0),
  48027. i.id !== $ && ($ = i.id,
  48028. a = !0),
  48029. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  48030. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48031. e !== te && (te = e,
  48032. s = a = !0),
  48033. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  48034. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  48035. (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),
  48036. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  48037. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  48038. i.skinning)
  48039. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  48040. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  48041. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  48042. if (void 0 !== c.boneTexture) {
  48043. var u = A();
  48044. X.uniform1i(c.boneTexture, u),
  48045. Z.setTexture(n.skeleton.boneTexture, u)
  48046. }
  48047. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  48048. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  48049. } else
  48050. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  48051. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  48052. e.ambientLightColor.needsUpdate = t,
  48053. e.directionalLights.needsUpdate = t,
  48054. e.pointLights.needsUpdate = t,
  48055. e.spotLights.needsUpdate = t,
  48056. e.hemisphereLights.needsUpdate = t
  48057. }(h, s),
  48058. t && i.fog && function(e, t) {
  48059. e.fogColor.value = t.color,
  48060. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  48061. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  48062. }(h, t),
  48063. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  48064. var i;
  48065. if (e.opacity.value = t.opacity,
  48066. e.diffuse.value = t.color,
  48067. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48068. e.map.value = t.map,
  48069. e.specularMap.value = t.specularMap,
  48070. e.alphaMap.value = t.alphaMap,
  48071. t.aoMap && (e.aoMap.value = t.aoMap,
  48072. e.aoMapIntensity.value = t.aoMapIntensity),
  48073. 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),
  48074. void 0 !== i) {
  48075. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  48076. var n = i.offset
  48077. , r = i.repeat;
  48078. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  48079. }
  48080. e.envMap.value = t.envMap,
  48081. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  48082. e.reflectivity.value = t.reflectivity,
  48083. e.refractionRatio.value = t.refractionRatio
  48084. }(h, i),
  48085. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  48086. function(e, t) {
  48087. e.dashSize.value = t.dashSize,
  48088. e.totalSize.value = t.dashSize + t.gapSize,
  48089. e.scale.value = t.scale
  48090. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  48091. if (e.diffuse.value = t.color,
  48092. e.opacity.value = t.opacity,
  48093. e.size.value = t.size * he,
  48094. e.scale.value = O.clientHeight / 2,
  48095. e.map.value = t.map,
  48096. null !== t.map) {
  48097. var i = t.map.offset
  48098. , n = t.map.repeat;
  48099. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48100. }
  48101. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  48102. t.lightMap && (e.lightMap.value = t.lightMap,
  48103. e.lightMapIntensity.value = t.lightMapIntensity),
  48104. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48105. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  48106. e.specular.value = t.specular,
  48107. e.shininess.value = Math.max(t.shininess, 1e-4),
  48108. t.lightMap && (e.lightMap.value = t.lightMap,
  48109. e.lightMapIntensity.value = t.lightMapIntensity),
  48110. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48111. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48112. e.bumpScale.value = t.bumpScale),
  48113. t.normalMap && (e.normalMap.value = t.normalMap,
  48114. e.normalScale.value.copy(t.normalScale)),
  48115. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48116. e.displacementScale.value = t.displacementScale,
  48117. e.displacementBias.value = t.displacementBias)
  48118. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  48119. e.roughness.value = t.roughness,
  48120. e.metalness.value = t.metalness,
  48121. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48122. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48123. t.lightMap && (e.lightMap.value = t.lightMap,
  48124. e.lightMapIntensity.value = t.lightMapIntensity),
  48125. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48126. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48127. e.bumpScale.value = t.bumpScale),
  48128. t.normalMap && (e.normalMap.value = t.normalMap,
  48129. e.normalScale.value.copy(t.normalScale)),
  48130. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48131. e.displacementScale.value = t.displacementScale,
  48132. e.displacementBias.value = t.displacementBias),
  48133. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48134. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  48135. h.mFar.value = e.far,
  48136. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  48137. g(r.uniformsList)),
  48138. function(e, t) {
  48139. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48140. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48141. }(c, n),
  48142. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  48143. !0 === r.hasDynamicUniforms && function(e, t, i) {
  48144. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48145. var a = e[r][0]
  48146. , s = a.onUpdateCallback;
  48147. void 0 !== s && (s.bind(a)(t, i),
  48148. n.push(e[r]))
  48149. }
  48150. g(n)
  48151. }(r.uniformsList, n, e),
  48152. l
  48153. }
  48154. function p(e, t) {
  48155. e.diffuse.value = t.color,
  48156. e.opacity.value = t.opacity
  48157. }
  48158. function A() {
  48159. var e = oe;
  48160. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  48161. oe += 1,
  48162. e
  48163. }
  48164. function C(e, t, i, n) {
  48165. var r, o;
  48166. if ("1i" === t)
  48167. X.uniform1i(i, n);
  48168. else if ("1f" === t)
  48169. X.uniform1f(i, n);
  48170. else if ("2f" === t)
  48171. X.uniform2f(i, n[0], n[1]);
  48172. else if ("3f" === t)
  48173. X.uniform3f(i, n[0], n[1], n[2]);
  48174. else if ("4f" === t)
  48175. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  48176. else if ("1iv" === t)
  48177. X.uniform1iv(i, n);
  48178. else if ("3iv" === t)
  48179. X.uniform3iv(i, n);
  48180. else if ("1fv" === t)
  48181. X.uniform1fv(i, n);
  48182. else if ("2fv" === t)
  48183. X.uniform2fv(i, n);
  48184. else if ("3fv" === t)
  48185. X.uniform3fv(i, n);
  48186. else if ("4fv" === t)
  48187. X.uniform4fv(i, n);
  48188. else if ("Matrix2fv" === t)
  48189. X.uniformMatrix2fv(i, !1, n);
  48190. else if ("Matrix3fv" === t)
  48191. X.uniformMatrix3fv(i, !1, n);
  48192. else if ("Matrix4fv" === t)
  48193. X.uniformMatrix4fv(i, !1, n);
  48194. else if ("i" === t)
  48195. X.uniform1i(i, n);
  48196. else if ("f" === t)
  48197. X.uniform1f(i, n);
  48198. else if ("v2" === t)
  48199. X.uniform2f(i, n.x, n.y);
  48200. else if ("v3" === t)
  48201. X.uniform3f(i, n.x, n.y, n.z);
  48202. else if ("v4" === t)
  48203. X.uniform4f(i, n.x, n.y, n.z, n.w);
  48204. else if ("c" === t)
  48205. X.uniform3f(i, n.r, n.g, n.b);
  48206. else if ("s" === t) {
  48207. var a = e.properties;
  48208. for (var s in a) {
  48209. var l = a[s]
  48210. , c = i[s]
  48211. , h = n[s];
  48212. C(l, l.type, c, h)
  48213. }
  48214. } else if ("sa" === t) {
  48215. a = e.properties;
  48216. for (var u = 0, d = n.length; u < d; u++)
  48217. for (var s in a) {
  48218. l = a[s],
  48219. c = i[u][s],
  48220. h = n[u][s];
  48221. C(l, l.type, c, h)
  48222. }
  48223. } else if ("iv1" === t)
  48224. X.uniform1iv(i, n);
  48225. else if ("iv" === t)
  48226. X.uniform3iv(i, n);
  48227. else if ("fv1" === t)
  48228. X.uniform1fv(i, n);
  48229. else if ("fv" === t)
  48230. X.uniform3fv(i, n);
  48231. else if ("v2v" === t) {
  48232. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  48233. u = 0;
  48234. for (var p = 0, f = n.length; u < f; u++,
  48235. p += 2)
  48236. e._array[p + 0] = n[u].x,
  48237. e._array[p + 1] = n[u].y;
  48238. X.uniform2fv(i, e._array)
  48239. } else if ("v3v" === t) {
  48240. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  48241. u = 0;
  48242. var g = 0;
  48243. for (f = n.length; u < f; u++,
  48244. g += 3)
  48245. e._array[g + 0] = n[u].x,
  48246. e._array[g + 1] = n[u].y,
  48247. e._array[g + 2] = n[u].z;
  48248. X.uniform3fv(i, e._array)
  48249. } else if ("v4v" === t) {
  48250. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  48251. u = 0;
  48252. var m = 0;
  48253. for (f = n.length; u < f; u++,
  48254. m += 4)
  48255. e._array[m + 0] = n[u].x,
  48256. e._array[m + 1] = n[u].y,
  48257. e._array[m + 2] = n[u].z,
  48258. e._array[m + 3] = n[u].w;
  48259. X.uniform4fv(i, e._array)
  48260. } else if ("m2" === t)
  48261. X.uniformMatrix2fv(i, !1, n.elements);
  48262. else if ("m3" === t)
  48263. X.uniformMatrix3fv(i, !1, n.elements);
  48264. else if ("m3v" === t) {
  48265. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  48266. for (u = 0,
  48267. f = n.length; u < f; u++)
  48268. n[u].flattenToArrayOffset(e._array, 9 * u);
  48269. X.uniformMatrix3fv(i, !1, e._array)
  48270. } else if ("m4" === t)
  48271. X.uniformMatrix4fv(i, !1, n.elements);
  48272. else if ("m4v" === t) {
  48273. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  48274. for (u = 0,
  48275. f = n.length; u < f; u++)
  48276. n[u].flattenToArrayOffset(e._array, 16 * u);
  48277. X.uniformMatrix4fv(i, !1, e._array)
  48278. } else if ("t" === t) {
  48279. if (r = n,
  48280. o = A(),
  48281. X.uniform1i(i, o),
  48282. !r)
  48283. return;
  48284. 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)
  48285. } else if ("tv" === t) {
  48286. void 0 === e._array && (e._array = []);
  48287. for (u = 0,
  48288. f = e.value.length; u < f; u++)
  48289. e._array[u] = A();
  48290. X.uniform1iv(i, e._array);
  48291. for (u = 0,
  48292. f = e.value.length; u < f; u++)
  48293. r = e.value[u],
  48294. o = e._array[u],
  48295. 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))
  48296. } else
  48297. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  48298. }
  48299. function g(e) {
  48300. for (var t = 0, i = e.length; t < i; t++) {
  48301. var n = e[t][0];
  48302. if (!1 !== n.needsUpdate)
  48303. C(n, n.type, e[t][1], n.value)
  48304. }
  48305. }
  48306. function m(e, t, i) {
  48307. var n;
  48308. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  48309. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  48310. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  48311. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  48312. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  48313. 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),
  48314. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  48315. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  48316. 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)),
  48317. n = Ie.get("EXT_texture_filter_anisotropic")) {
  48318. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  48319. return;
  48320. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  48321. return;
  48322. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  48323. be.get(t).__currentAnisotropy = t.anisotropy)
  48324. }
  48325. }
  48326. function o(e, t, i) {
  48327. void 0 === e.__webglInit && (e.__webglInit = !0,
  48328. t.addEventListener("dispose", f),
  48329. e.__webglTexture = X.createTexture(),
  48330. ye.textures++),
  48331. _e.activeTexture(X.TEXTURE0 + i),
  48332. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  48333. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  48334. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  48335. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  48336. var n = I(t.image, Ee.maxTextureSize);
  48337. !function(e) {
  48338. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  48339. }(t) || !1 !== E(n) || (n = function(e) {
  48340. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  48341. var t = document.createElement("canvas");
  48342. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  48343. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  48344. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  48345. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  48346. t
  48347. }
  48348. return e
  48349. }(n));
  48350. var r = E(n)
  48351. , o = x(t.format)
  48352. , a = x(t.type);
  48353. m(X.TEXTURE_2D, t, r);
  48354. var s, l = t.mipmaps;
  48355. if (t instanceof Ci.DataTexture)
  48356. if (0 < l.length && r) {
  48357. for (var c = 0, h = l.length; c < h; c++)
  48358. s = l[c],
  48359. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48360. t.generateMipmaps = !1
  48361. } else
  48362. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  48363. else if (t instanceof Ci.CompressedTexture)
  48364. for (c = 0,
  48365. h = l.length; c < h; c++)
  48366. s = l[c],
  48367. 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);
  48368. else if (0 < l.length && r) {
  48369. for (c = 0,
  48370. h = l.length; c < h; c++)
  48371. s = l[c],
  48372. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  48373. t.generateMipmaps = !1
  48374. } else
  48375. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  48376. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48377. e.__version = t.version,
  48378. t.onUpdate && t.onUpdate(t)
  48379. }
  48380. function I(e, t) {
  48381. if (e.width > t || e.height > t) {
  48382. var i = t / Math.max(e.width, e.height)
  48383. , n = document.createElement("canvas");
  48384. return n.width = Math.floor(e.width * i),
  48385. n.height = Math.floor(e.height * i),
  48386. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  48387. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  48388. n
  48389. }
  48390. return e
  48391. }
  48392. function E(e) {
  48393. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  48394. }
  48395. function _(e, t) {
  48396. var i = be.get(e);
  48397. if (6 === e.image.length)
  48398. if (0 < e.version && i.__version !== e.version) {
  48399. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  48400. i.__image__webglTextureCube = X.createTexture(),
  48401. ye.textures++),
  48402. _e.activeTexture(X.TEXTURE0 + t),
  48403. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  48404. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  48405. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  48406. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  48407. var s = E(o[0])
  48408. , l = x(e.format)
  48409. , c = x(e.type);
  48410. m(X.TEXTURE_CUBE_MAP, e, s);
  48411. for (a = 0; a < 6; a++)
  48412. if (n)
  48413. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  48414. h = u[d],
  48415. 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);
  48416. else
  48417. 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]);
  48418. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48419. i.__version = e.version,
  48420. e.onUpdate && e.onUpdate(e)
  48421. } else
  48422. _e.activeTexture(X.TEXTURE0 + t),
  48423. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  48424. }
  48425. function b(e, t) {
  48426. _e.activeTexture(X.TEXTURE0 + t),
  48427. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  48428. }
  48429. function h(e, t, i, n) {
  48430. var r = x(t.texture.format)
  48431. , o = x(t.texture.type);
  48432. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  48433. X.bindFramebuffer(X.FRAMEBUFFER, e),
  48434. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  48435. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48436. }
  48437. function u(e, t) {
  48438. X.bindRenderbuffer(X.RENDERBUFFER, e),
  48439. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  48440. 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),
  48441. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  48442. X.bindRenderbuffer(X.RENDERBUFFER, null)
  48443. }
  48444. function w(e) {
  48445. var t = be.get(e)
  48446. , i = be.get(e.texture);
  48447. e.addEventListener("dispose", a),
  48448. i.__webglTexture = X.createTexture(),
  48449. ye.textures++;
  48450. var n = e instanceof Ci.WebGLRenderTargetCube
  48451. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  48452. if (n) {
  48453. t.__webglFramebuffer = [];
  48454. for (var o = 0; o < 6; o++)
  48455. t.__webglFramebuffer[o] = X.createFramebuffer()
  48456. } else
  48457. t.__webglFramebuffer = X.createFramebuffer();
  48458. if (n) {
  48459. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  48460. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  48461. for (o = 0; o < 6; o++)
  48462. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  48463. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48464. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  48465. } else
  48466. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  48467. m(X.TEXTURE_2D, e.texture, r),
  48468. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  48469. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48470. _e.bindTexture(X.TEXTURE_2D, null);
  48471. e.depthBuffer && function(e) {
  48472. var t = be.get(e);
  48473. if (e instanceof Ci.WebGLRenderTargetCube) {
  48474. t.__webglDepthbuffer = [];
  48475. for (var i = 0; i < 6; i++)
  48476. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  48477. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  48478. u(t.__webglDepthbuffer[i], e)
  48479. } else
  48480. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  48481. t.__webglDepthbuffer = X.createRenderbuffer(),
  48482. u(t.__webglDepthbuffer, e);
  48483. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48484. }(e)
  48485. }
  48486. function T(e) {
  48487. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  48488. }
  48489. function x(e) {
  48490. var t;
  48491. if (e === Ci.RepeatWrapping)
  48492. return X.REPEAT;
  48493. if (e === Ci.ClampToEdgeWrapping)
  48494. return X.CLAMP_TO_EDGE;
  48495. if (e === Ci.MirroredRepeatWrapping)
  48496. return X.MIRRORED_REPEAT;
  48497. if (e === Ci.NearestFilter)
  48498. return X.NEAREST;
  48499. if (e === Ci.NearestMipMapNearestFilter)
  48500. return X.NEAREST_MIPMAP_NEAREST;
  48501. if (e === Ci.NearestMipMapLinearFilter)
  48502. return X.NEAREST_MIPMAP_LINEAR;
  48503. if (e === Ci.LinearFilter)
  48504. return X.LINEAR;
  48505. if (e === Ci.LinearMipMapNearestFilter)
  48506. return X.LINEAR_MIPMAP_NEAREST;
  48507. if (e === Ci.LinearMipMapLinearFilter)
  48508. return X.LINEAR_MIPMAP_LINEAR;
  48509. if (e === Ci.UnsignedByteType)
  48510. return X.UNSIGNED_BYTE;
  48511. if (e === Ci.UnsignedShort4444Type)
  48512. return X.UNSIGNED_SHORT_4_4_4_4;
  48513. if (e === Ci.UnsignedShort5551Type)
  48514. return X.UNSIGNED_SHORT_5_5_5_1;
  48515. if (e === Ci.UnsignedShort565Type)
  48516. return X.UNSIGNED_SHORT_5_6_5;
  48517. if (e === Ci.ByteType)
  48518. return X.BYTE;
  48519. if (e === Ci.ShortType)
  48520. return X.SHORT;
  48521. if (e === Ci.UnsignedShortType)
  48522. return X.UNSIGNED_SHORT;
  48523. if (e === Ci.IntType)
  48524. return X.INT;
  48525. if (e === Ci.UnsignedIntType)
  48526. return X.UNSIGNED_INT;
  48527. if (e === Ci.FloatType)
  48528. return X.FLOAT;
  48529. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  48530. return t.HALF_FLOAT_OES;
  48531. if (e === Ci.AlphaFormat)
  48532. return X.ALPHA;
  48533. if (e === Ci.RGBFormat)
  48534. return X.RGB;
  48535. if (e === Ci.RGBAFormat)
  48536. return X.RGBA;
  48537. if (e === Ci.LuminanceFormat)
  48538. return X.LUMINANCE;
  48539. if (e === Ci.LuminanceAlphaFormat)
  48540. return X.LUMINANCE_ALPHA;
  48541. if (e === Ci.AddEquation)
  48542. return X.FUNC_ADD;
  48543. if (e === Ci.SubtractEquation)
  48544. return X.FUNC_SUBTRACT;
  48545. if (e === Ci.ReverseSubtractEquation)
  48546. return X.FUNC_REVERSE_SUBTRACT;
  48547. if (e === Ci.ZeroFactor)
  48548. return X.ZERO;
  48549. if (e === Ci.OneFactor)
  48550. return X.ONE;
  48551. if (e === Ci.SrcColorFactor)
  48552. return X.SRC_COLOR;
  48553. if (e === Ci.OneMinusSrcColorFactor)
  48554. return X.ONE_MINUS_SRC_COLOR;
  48555. if (e === Ci.SrcAlphaFactor)
  48556. return X.SRC_ALPHA;
  48557. if (e === Ci.OneMinusSrcAlphaFactor)
  48558. return X.ONE_MINUS_SRC_ALPHA;
  48559. if (e === Ci.DstAlphaFactor)
  48560. return X.DST_ALPHA;
  48561. if (e === Ci.OneMinusDstAlphaFactor)
  48562. return X.ONE_MINUS_DST_ALPHA;
  48563. if (e === Ci.DstColorFactor)
  48564. return X.DST_COLOR;
  48565. if (e === Ci.OneMinusDstColorFactor)
  48566. return X.ONE_MINUS_DST_COLOR;
  48567. if (e === Ci.SrcAlphaSaturateFactor)
  48568. return X.SRC_ALPHA_SATURATE;
  48569. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  48570. if (e === Ci.RGB_S3TC_DXT1_Format)
  48571. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  48572. if (e === Ci.RGBA_S3TC_DXT1_Format)
  48573. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  48574. if (e === Ci.RGBA_S3TC_DXT3_Format)
  48575. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  48576. if (e === Ci.RGBA_S3TC_DXT5_Format)
  48577. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  48578. }
  48579. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  48580. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  48581. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  48582. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  48583. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  48584. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  48585. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  48586. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  48587. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  48588. }
  48589. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  48590. return t.COMPRESSED_RGB_ETC1_WEBGL;
  48591. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  48592. if (e === Ci.MinEquation)
  48593. return t.MIN_EXT;
  48594. if (e === Ci.MaxEquation)
  48595. return t.MAX_EXT
  48596. }
  48597. return 0
  48598. }
  48599. console.log("THREE.WebGLRenderer", Ci.REVISION);
  48600. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  48601. , L = void 0 !== e.context ? e.context : null
  48602. , D = void 0 !== e.alpha && e.alpha
  48603. , N = void 0 === e.depth || e.depth
  48604. , F = void 0 === e.stencil || e.stencil
  48605. , B = void 0 !== e.antialias && e.antialias
  48606. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  48607. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  48608. , U = []
  48609. , H = []
  48610. , z = -1
  48611. , G = []
  48612. , W = -1
  48613. , j = new Float32Array(8)
  48614. , Y = []
  48615. , q = [];
  48616. this.domElement = O,
  48617. this.context = null,
  48618. this.autoClear = !0,
  48619. this.autoClearColor = !0,
  48620. this.autoClearDepth = !0,
  48621. this.autoClearStencil = !0,
  48622. this.sortObjects = !0,
  48623. this.gammaFactor = 2,
  48624. this.gammaInput = !1,
  48625. this.gammaOutput = !1,
  48626. this.physicallyCorrectLights = !1,
  48627. this.toneMapping = Ci.LinearToneMapping,
  48628. this.toneMappingExposure = 1,
  48629. this.toneMappingWhitePoint = 1,
  48630. this.maxMorphTargets = 8,
  48631. this.maxMorphNormals = 4,
  48632. this.autoScaleCubemaps = !0;
  48633. 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 = {
  48634. hash: "",
  48635. ambient: [0, 0, 0],
  48636. directional: [],
  48637. directionalShadowMap: [],
  48638. directionalShadowMatrix: [],
  48639. spot: [],
  48640. spotShadowMap: [],
  48641. spotShadowMatrix: [],
  48642. point: [],
  48643. pointShadowMap: [],
  48644. pointShadowMatrix: [],
  48645. hemi: [],
  48646. shadows: [],
  48647. shadowsPointLight: 0
  48648. }, ye = {
  48649. geometries: 0,
  48650. textures: 0
  48651. }, Ae = {
  48652. calls: 0,
  48653. vertices: 0,
  48654. faces: 0,
  48655. points: 0
  48656. };
  48657. this.info = {
  48658. render: Ae,
  48659. memory: ye,
  48660. programs: null
  48661. };
  48662. try {
  48663. var Ce = {
  48664. alpha: D,
  48665. depth: N,
  48666. stencil: F,
  48667. antialias: B,
  48668. premultipliedAlpha: V,
  48669. preserveDrawingBuffer: k
  48670. };
  48671. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  48672. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  48673. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  48674. return {
  48675. rangeMin: 1,
  48676. rangeMax: 1,
  48677. precision: 1
  48678. }
  48679. }
  48680. ),
  48681. O.addEventListener("webglcontextlost", r, !1)
  48682. } catch (e) {
  48683. console.error("THREE.WebGLRenderer: " + e)
  48684. }
  48685. var Ie = new Ci.WebGLExtensions(X);
  48686. Ie.get("OES_texture_float"),
  48687. Ie.get("OES_texture_float_linear"),
  48688. Ie.get("OES_texture_half_float"),
  48689. Ie.get("OES_texture_half_float_linear"),
  48690. Ie.get("OES_standard_derivatives"),
  48691. Ie.get("ANGLE_instanced_arrays"),
  48692. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  48693. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  48694. , _e = new Ci.WebGLState(X,Ie,x)
  48695. , be = new Ci.WebGLProperties
  48696. , we = new Ci.WebGLObjects(X,be,this.info)
  48697. , Te = new Ci.WebGLPrograms(this,Ee)
  48698. , xe = new Ci.WebGLLights;
  48699. this.info.programs = Te.programs;
  48700. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  48701. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  48702. t(),
  48703. this.context = X,
  48704. this.capabilities = Ee,
  48705. this.extensions = Ie,
  48706. this.properties = be,
  48707. this.state = _e;
  48708. var Re = new Ci.WebGLShadowMap(this,ve,we);
  48709. this.shadowMap = Re;
  48710. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  48711. this.getContext = function() {
  48712. return X
  48713. }
  48714. ,
  48715. this.getContextAttributes = function() {
  48716. return X.getContextAttributes()
  48717. }
  48718. ,
  48719. this.forceContextLoss = function() {
  48720. Ie.get("WEBGL_lose_context").loseContext()
  48721. }
  48722. ,
  48723. this.getMaxAnisotropy = function() {
  48724. if (void 0 !== Pe)
  48725. return Pe;
  48726. var e = Ie.get("EXT_texture_filter_anisotropic");
  48727. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  48728. }
  48729. ,
  48730. this.getPrecision = function() {
  48731. return Ee.precision
  48732. }
  48733. ,
  48734. this.getPixelRatio = function() {
  48735. return he
  48736. }
  48737. ,
  48738. this.setPixelRatio = function(e) {
  48739. void 0 !== e && (he = e,
  48740. this.setSize(pe.z, pe.w, !1))
  48741. }
  48742. ,
  48743. this.getSize = function() {
  48744. return {
  48745. width: le,
  48746. height: ce
  48747. }
  48748. }
  48749. ,
  48750. this.setSize = function(e, t, i, n) {
  48751. null != n && (he = n),
  48752. le = e,
  48753. ce = t,
  48754. O.width = e * he,
  48755. O.height = t * he,
  48756. !1 !== i && (O.style.width = e + "px",
  48757. O.style.height = t + "px"),
  48758. this.setViewport(0, 0, e, t)
  48759. }
  48760. ,
  48761. this.setViewport = function(e, t, i, n) {
  48762. _e.viewport(pe.set(e, t, i, n))
  48763. }
  48764. ,
  48765. this.setScissor = function(e, t, i, n) {
  48766. _e.scissor(ue.set(e, t, i, n))
  48767. }
  48768. ,
  48769. this.setScissorTest = function(e) {
  48770. _e.setScissorTest(de = e)
  48771. }
  48772. ,
  48773. this.getClearColor = function() {
  48774. return ae
  48775. }
  48776. ,
  48777. this.setClearColor = function(e, t) {
  48778. ae.set(e),
  48779. se = void 0 !== t ? t : 1,
  48780. i(ae.r, ae.g, ae.b, se)
  48781. }
  48782. ,
  48783. this.getClearAlpha = function() {
  48784. return se
  48785. }
  48786. ,
  48787. this.setClearAlpha = function(e) {
  48788. se = e,
  48789. i(ae.r, ae.g, ae.b, se)
  48790. }
  48791. ,
  48792. this.clear = function(e, t, i) {
  48793. var n = 0;
  48794. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  48795. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  48796. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  48797. X.clear(n)
  48798. }
  48799. ,
  48800. this.clearColor = function() {
  48801. this.clear(!0, !1, !1)
  48802. }
  48803. ,
  48804. this.clearDepth = function() {
  48805. this.clear(!1, !0, !1)
  48806. }
  48807. ,
  48808. this.clearStencil = function() {
  48809. this.clear(!1, !1, !0)
  48810. }
  48811. ,
  48812. this.clearTarget = function(e, t, i, n) {
  48813. this.setRenderTarget(e),
  48814. this.clear(t, i, n)
  48815. }
  48816. ,
  48817. this.resetGLState = n,
  48818. this.dispose = function() {
  48819. O.removeEventListener("webglcontextlost", r, !1)
  48820. }
  48821. ,
  48822. this.renderBufferImmediate = function(e, t, i) {
  48823. _e.initAttributes();
  48824. var n = be.get(e);
  48825. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  48826. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  48827. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  48828. e.hasColors && !n.color && (n.color = X.createBuffer());
  48829. var r = t.getAttributes();
  48830. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  48831. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  48832. _e.enableAttribute(r.position),
  48833. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  48834. e.hasNormals) {
  48835. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  48836. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  48837. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  48838. var s = e.normalArray
  48839. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  48840. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  48841. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  48842. s[o + 0] = l,
  48843. s[o + 1] = c,
  48844. s[o + 2] = h,
  48845. s[o + 3] = l,
  48846. s[o + 4] = c,
  48847. s[o + 5] = h,
  48848. s[o + 6] = l,
  48849. s[o + 7] = c,
  48850. s[o + 8] = h
  48851. }
  48852. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  48853. _e.enableAttribute(r.normal),
  48854. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  48855. }
  48856. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  48857. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  48858. _e.enableAttribute(r.uv),
  48859. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  48860. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  48861. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  48862. _e.enableAttribute(r.color),
  48863. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  48864. _e.disableUnusedAttributes(),
  48865. X.drawArrays(X.TRIANGLES, 0, e.count),
  48866. e.count = 0
  48867. }
  48868. ,
  48869. this.renderBufferDirect = function(e, t, i, n, r, o) {
  48870. R(n);
  48871. var a = P(e, t, n, r)
  48872. , s = !1
  48873. , l = i.id + "_" + a.id + "_" + n.wireframe;
  48874. l !== ee && (ee = l,
  48875. s = !0);
  48876. var c = r.morphTargetInfluences;
  48877. if (void 0 !== c) {
  48878. for (var h = [], u = 0, d = c.length; u < d; u++) {
  48879. var p = c[u];
  48880. h.push([p, u])
  48881. }
  48882. h.sort(M),
  48883. 8 < h.length && (h.length = 8);
  48884. var f = i.morphAttributes;
  48885. for (u = 0,
  48886. d = h.length; u < d; u++) {
  48887. p = h[u];
  48888. if (j[u] = p[0],
  48889. 0 !== p[0]) {
  48890. var g = p[1];
  48891. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  48892. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  48893. } else
  48894. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  48895. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  48896. }
  48897. var m = a.getUniforms();
  48898. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  48899. s = !0
  48900. }
  48901. g = i.index;
  48902. var v, y = i.attributes.position;
  48903. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  48904. null !== g ? (v = Me).setIndex(g) : v = Se,
  48905. s && (function(e, t, i, n) {
  48906. var r;
  48907. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  48908. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  48909. else {
  48910. void 0 === n && (n = 0),
  48911. _e.initAttributes();
  48912. var o = i.attributes
  48913. , a = t.getAttributes()
  48914. , s = e.defaultAttributeValues;
  48915. for (var l in a) {
  48916. var c = a[l];
  48917. if (0 <= c) {
  48918. var h = o[l];
  48919. if (void 0 !== h) {
  48920. var u = h.itemSize
  48921. , d = we.getAttributeBuffer(h);
  48922. if (h instanceof Ci.InterleavedBufferAttribute) {
  48923. var p = h.data
  48924. , f = p.stride
  48925. , g = h.offset;
  48926. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  48927. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  48928. X.bindBuffer(X.ARRAY_BUFFER, d),
  48929. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  48930. } else
  48931. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  48932. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  48933. X.bindBuffer(X.ARRAY_BUFFER, d),
  48934. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  48935. } else if (void 0 !== s) {
  48936. var m = s[l];
  48937. if (void 0 !== m)
  48938. switch (m.length) {
  48939. case 2:
  48940. X.vertexAttrib2fv(c, m);
  48941. break;
  48942. case 3:
  48943. X.vertexAttrib3fv(c, m);
  48944. break;
  48945. case 4:
  48946. X.vertexAttrib4fv(c, m);
  48947. break;
  48948. default:
  48949. X.vertexAttrib1fv(c, m)
  48950. }
  48951. }
  48952. }
  48953. }
  48954. _e.disableUnusedAttributes()
  48955. }
  48956. }(n, a, i),
  48957. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  48958. var A = 1 / 0;
  48959. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  48960. var C = i.drawRange.start
  48961. , I = i.drawRange.count
  48962. , E = null !== o ? o.start : 0
  48963. , _ = null !== o ? o.count : 1 / 0
  48964. , b = Math.max(0, C, E)
  48965. , w = Math.min(0 + A, C + I, E + _) - 1
  48966. , T = Math.max(0, w - b + 1);
  48967. if (r instanceof Ci.Mesh)
  48968. if (!0 === n.wireframe)
  48969. _e.setLineWidth(n.wireframeLinewidth * S()),
  48970. v.setMode(X.LINES);
  48971. else
  48972. switch (r.drawMode) {
  48973. case Ci.TrianglesDrawMode:
  48974. v.setMode(X.TRIANGLES);
  48975. break;
  48976. case Ci.TriangleStripDrawMode:
  48977. v.setMode(X.TRIANGLE_STRIP);
  48978. break;
  48979. case Ci.TriangleFanDrawMode:
  48980. v.setMode(X.TRIANGLE_FAN)
  48981. }
  48982. else if (r instanceof Ci.Line) {
  48983. var x = n.linewidth;
  48984. void 0 === x && (x = 1),
  48985. _e.setLineWidth(x * S()),
  48986. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  48987. } else
  48988. r instanceof Ci.Points && v.setMode(X.POINTS);
  48989. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  48990. }
  48991. ,
  48992. this.render = function(e, t, i, n) {
  48993. if (t instanceof Ci.Camera != 0) {
  48994. var r = e.fog;
  48995. if (ee = "",
  48996. $ = -1,
  48997. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  48998. null === t.parent && t.updateMatrixWorld(),
  48999. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49000. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49001. fe.setFromMatrix(ge),
  49002. U.length = 0,
  49003. W = z = -1,
  49004. Y.length = 0,
  49005. q.length = 0,
  49006. function e(t, i) {
  49007. if (!1 !== t.visible) {
  49008. if (t.layers.test(i.layers))
  49009. if (t instanceof Ci.Light)
  49010. U.push(t);
  49011. else if (t instanceof Ci.Sprite)
  49012. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49013. else if (t instanceof Ci.LensFlare)
  49014. q.push(t);
  49015. else if (t instanceof Ci.ImmediateRenderObject)
  49016. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49017. me.applyProjection(ge)),
  49018. d(t, null, t.material, me.z, null);
  49019. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49020. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49021. var n = t.material;
  49022. if (!0 === n.visible) {
  49023. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49024. me.applyProjection(ge));
  49025. var r = we.update(t);
  49026. if (n instanceof Ci.MultiMaterial)
  49027. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49028. var c = o[s]
  49029. , h = a[c.materialIndex];
  49030. !0 === h.visible && d(t, r, h, me.z, c)
  49031. }
  49032. else
  49033. d(t, r, n, me.z, null)
  49034. }
  49035. }
  49036. var u = t.children;
  49037. for (s = 0,
  49038. l = u.length; s < l; s++)
  49039. e(u[s], i)
  49040. }
  49041. }(e, t),
  49042. H.length = z + 1,
  49043. G.length = W + 1,
  49044. !0 === Z.sortObjects && (H.sort(s),
  49045. G.sort(l)),
  49046. function(e, t) {
  49047. 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;
  49048. for (i = ve.shadowsPointLight = 0,
  49049. n = e.length; i < n; i++)
  49050. if (o = (r = e[i]).color,
  49051. a = r.intensity,
  49052. s = r.distance,
  49053. r instanceof Ci.AmbientLight)
  49054. l += o.r * a,
  49055. c += o.g * a,
  49056. h += o.b * a;
  49057. else if (r instanceof Ci.DirectionalLight) {
  49058. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  49059. v.direction.setFromMatrixPosition(r.matrixWorld),
  49060. me.setFromMatrixPosition(r.target.matrixWorld),
  49061. v.direction.sub(me),
  49062. v.direction.transformDirection(u),
  49063. v.shadow = r.castShadow,
  49064. r.castShadow && (v.shadowBias = r.shadow.bias,
  49065. v.shadowRadius = r.shadow.radius,
  49066. v.shadowMapSize = r.shadow.mapSize,
  49067. ve.shadows[m++] = r),
  49068. ve.directionalShadowMap[d] = r.shadow.map,
  49069. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  49070. ve.directional[d++] = v
  49071. } else if (r instanceof Ci.SpotLight) {
  49072. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49073. v.position.applyMatrix4(u),
  49074. v.color.copy(o).multiplyScalar(a),
  49075. v.distance = s,
  49076. v.direction.setFromMatrixPosition(r.matrixWorld),
  49077. me.setFromMatrixPosition(r.target.matrixWorld),
  49078. v.direction.sub(me),
  49079. v.direction.transformDirection(u),
  49080. v.coneCos = Math.cos(r.angle),
  49081. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  49082. v.decay = 0 === r.distance ? 0 : r.decay,
  49083. v.shadow = r.castShadow,
  49084. r.castShadow && (v.shadowBias = r.shadow.bias,
  49085. v.shadowRadius = r.shadow.radius,
  49086. v.shadowMapSize = r.shadow.mapSize,
  49087. ve.shadows[m++] = r),
  49088. ve.spotShadowMap[f] = r.shadow.map,
  49089. ve.spotShadowMatrix[f] = r.shadow.matrix,
  49090. ve.spot[f++] = v
  49091. } else if (r instanceof Ci.PointLight) {
  49092. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49093. v.position.applyMatrix4(u),
  49094. v.color.copy(r.color).multiplyScalar(r.intensity),
  49095. v.distance = r.distance,
  49096. v.decay = 0 === r.distance ? 0 : r.decay,
  49097. v.shadow = r.castShadow,
  49098. r.castShadow && (v.shadowBias = r.shadow.bias,
  49099. v.shadowRadius = r.shadow.radius,
  49100. v.shadowMapSize = r.shadow.mapSize,
  49101. ve.shadows[m++] = r),
  49102. ve.pointShadowMap[p] = r.shadow.map,
  49103. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  49104. me.setFromMatrixPosition(r.matrixWorld).negate(),
  49105. ve.pointShadowMatrix[p].identity().setPosition(me),
  49106. ve.point[p++] = v
  49107. } else if (r instanceof Ci.HemisphereLight) {
  49108. var v;
  49109. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  49110. v.direction.transformDirection(u),
  49111. v.direction.normalize(),
  49112. v.skyColor.copy(r.color).multiplyScalar(a),
  49113. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  49114. ve.hemi[g++] = v
  49115. }
  49116. ve.ambient[0] = l,
  49117. ve.ambient[1] = c,
  49118. ve.ambient[2] = h,
  49119. ve.directional.length = d,
  49120. ve.spot.length = f,
  49121. ve.point.length = p,
  49122. ve.hemi.length = g,
  49123. ve.shadows.length = m,
  49124. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  49125. }(U, t),
  49126. Re.render(e, t),
  49127. Ae.calls = 0,
  49128. Ae.vertices = 0,
  49129. Ae.faces = 0,
  49130. void (Ae.points = 0) === i && (i = null),
  49131. this.setRenderTarget(i),
  49132. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49133. e.overrideMaterial) {
  49134. var o = e.overrideMaterial;
  49135. c(H, t, r, o),
  49136. c(G, t, r, o)
  49137. } else
  49138. _e.setBlending(Ci.NoBlending),
  49139. c(H, t, r),
  49140. c(G, t, r);
  49141. if (Oe.render(e, t),
  49142. Le.render(e, t, re),
  49143. i) {
  49144. var a = i.texture;
  49145. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  49146. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  49147. , i = be.get(e.texture).__webglTexture;
  49148. _e.bindTexture(t, i),
  49149. X.generateMipmap(t),
  49150. _e.bindTexture(t, null)
  49151. }(i)
  49152. }
  49153. _e.setDepthTest(!0),
  49154. _e.setDepthWrite(!0),
  49155. _e.setColorWrite(!0)
  49156. } else
  49157. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  49158. }
  49159. ,
  49160. this.setFaceCulling = function(e, t) {
  49161. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  49162. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  49163. _e.enable(X.CULL_FACE))
  49164. }
  49165. ,
  49166. this.setTexture = function(e, t) {
  49167. var i = be.get(e);
  49168. if (0 < e.version && i.__version !== e.version) {
  49169. var n = e.image;
  49170. 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)
  49171. }
  49172. _e.activeTexture(X.TEXTURE0 + t),
  49173. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  49174. }
  49175. ,
  49176. this.getCurrentRenderTarget = function() {
  49177. return Q
  49178. }
  49179. ,
  49180. this.setRenderTarget = function(e) {
  49181. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  49182. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  49183. if (e) {
  49184. var n = be.get(e);
  49185. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  49186. ie.copy(e.scissor),
  49187. ne = e.scissorTest,
  49188. re.copy(e.viewport)
  49189. } else
  49190. t = null,
  49191. ie.copy(ue).multiplyScalar(he),
  49192. ne = de,
  49193. re.copy(pe).multiplyScalar(he);
  49194. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  49195. J = t),
  49196. _e.scissor(ie),
  49197. _e.setScissorTest(ne),
  49198. _e.viewport(re),
  49199. i) {
  49200. var r = be.get(e.texture);
  49201. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  49202. }
  49203. }
  49204. ,
  49205. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  49206. if (e instanceof Ci.WebGLRenderTarget != 0) {
  49207. var a = be.get(e).__webglFramebuffer;
  49208. if (a) {
  49209. var s = !1;
  49210. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  49211. s = !0);
  49212. try {
  49213. var l = e.texture;
  49214. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  49215. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49216. 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")))
  49217. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49218. 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.")
  49219. } finally {
  49220. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  49221. }
  49222. }
  49223. } else
  49224. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  49225. }
  49226. }
  49227. ,
  49228. Ci.WebGLRenderTarget = function(e, t, i) {
  49229. this.uuid = Ci.Math.generateUUID(),
  49230. this.width = e,
  49231. this.height = t,
  49232. this.scissor = new Ci.Vector4(0,0,e,t),
  49233. this.scissorTest = !1,
  49234. this.viewport = new Ci.Vector4(0,0,e,t),
  49235. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  49236. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  49237. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  49238. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  49239. }
  49240. ,
  49241. Ci.WebGLRenderTarget.prototype = {
  49242. constructor: Ci.WebGLRenderTarget,
  49243. setSize: function(e, t) {
  49244. this.width === e && this.height === t || (this.width = e,
  49245. this.height = t,
  49246. this.dispose()),
  49247. this.viewport.set(0, 0, e, t),
  49248. this.scissor.set(0, 0, e, t)
  49249. },
  49250. clone: function() {
  49251. return (new this.constructor).copy(this)
  49252. },
  49253. copy: function(e) {
  49254. return this.width = e.width,
  49255. this.height = e.height,
  49256. this.viewport.copy(e.viewport),
  49257. this.texture = e.texture.clone(),
  49258. this.depthBuffer = e.depthBuffer,
  49259. this.stencilBuffer = e.stencilBuffer,
  49260. this
  49261. },
  49262. dispose: function() {
  49263. this.dispatchEvent({
  49264. type: "dispose"
  49265. })
  49266. }
  49267. },
  49268. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  49269. Ci.WebGLRenderTargetCube = function(e, t, i) {
  49270. Ci.WebGLRenderTarget.call(this, e, t, i),
  49271. this.activeCubeFace = 0,
  49272. this.activeMipMapLevel = 0
  49273. }
  49274. ,
  49275. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  49276. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  49277. Ci.WebGLBufferRenderer = function(r, o, a) {
  49278. var s;
  49279. this.setMode = function(e) {
  49280. s = e
  49281. }
  49282. ,
  49283. this.render = function(e, t) {
  49284. r.drawArrays(s, e, t),
  49285. a.calls++,
  49286. a.vertices += t,
  49287. s === r.TRIANGLES && (a.faces += t / 3)
  49288. }
  49289. ,
  49290. this.renderInstances = function(e) {
  49291. var t = o.get("ANGLE_instanced_arrays");
  49292. if (null !== t) {
  49293. var i = e.attributes.position
  49294. , n = 0;
  49295. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  49296. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  49297. a.calls++,
  49298. a.vertices += n * e.maxInstancedCount,
  49299. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  49300. } else
  49301. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  49302. }
  49303. }
  49304. ,
  49305. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  49306. var s, l, c;
  49307. this.setMode = function(e) {
  49308. s = e
  49309. }
  49310. ,
  49311. this.setIndex = function(e) {
  49312. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  49313. 4) : (l = r.UNSIGNED_SHORT,
  49314. 2)
  49315. }
  49316. ,
  49317. this.render = function(e, t) {
  49318. r.drawElements(s, t, l, e * c),
  49319. a.calls++,
  49320. a.vertices += t,
  49321. s === r.TRIANGLES && (a.faces += t / 3)
  49322. }
  49323. ,
  49324. this.renderInstances = function(e, t, i) {
  49325. var n = o.get("ANGLE_instanced_arrays");
  49326. 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),
  49327. a.calls++,
  49328. a.vertices += i * e.maxInstancedCount,
  49329. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  49330. }
  49331. }
  49332. ,
  49333. Ci.WebGLExtensions = function(i) {
  49334. var n = {};
  49335. this.get = function(e) {
  49336. if (void 0 !== n[e])
  49337. return n[e];
  49338. var t;
  49339. switch (e) {
  49340. case "EXT_texture_filter_anisotropic":
  49341. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  49342. break;
  49343. case "WEBGL_compressed_texture_s3tc":
  49344. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  49345. break;
  49346. case "WEBGL_compressed_texture_pvrtc":
  49347. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  49348. break;
  49349. case "WEBGL_compressed_texture_etc1":
  49350. t = i.getExtension("WEBGL_compressed_texture_etc1");
  49351. break;
  49352. default:
  49353. t = i.getExtension(e)
  49354. }
  49355. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  49356. n[e] = t
  49357. }
  49358. }
  49359. ,
  49360. Ci.WebGLCapabilities = function(t, e, i) {
  49361. function n(e) {
  49362. if ("highp" === e) {
  49363. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  49364. return "highp";
  49365. e = "mediump"
  49366. }
  49367. 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"
  49368. }
  49369. this.getMaxPrecision = n,
  49370. this.precision = void 0 !== i.precision ? i.precision : "highp",
  49371. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  49372. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  49373. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  49374. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  49375. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  49376. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  49377. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  49378. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  49379. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  49380. this.vertexTextures = 0 < this.maxVertexTextures,
  49381. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  49382. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  49383. var r = n(this.precision);
  49384. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  49385. this.precision = r),
  49386. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  49387. }
  49388. ,
  49389. Ci.WebGLGeometries = function(i, o, a) {
  49390. function s(e) {
  49391. var t = e.target
  49392. , i = c[t.id];
  49393. null !== i.index && l(i.index),
  49394. function(e) {
  49395. for (var t in e)
  49396. l(e[t])
  49397. }(i.attributes),
  49398. t.removeEventListener("dispose", s),
  49399. delete c[t.id];
  49400. var n = o.get(t);
  49401. n.wireframe && l(n.wireframe),
  49402. o.delete(t);
  49403. var r = o.get(i);
  49404. r.wireframe && l(r.wireframe),
  49405. o.delete(i),
  49406. a.memory.geometries--
  49407. }
  49408. function l(e) {
  49409. var t = function(e) {
  49410. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  49411. }(e);
  49412. void 0 !== t && (i.deleteBuffer(t),
  49413. function(e) {
  49414. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  49415. }(e))
  49416. }
  49417. var c = {};
  49418. this.get = function(e) {
  49419. var t, i = e.geometry;
  49420. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  49421. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  49422. t = i._bufferGeometry),
  49423. c[i.id] = t,
  49424. a.memory.geometries++,
  49425. t)
  49426. }
  49427. }
  49428. ,
  49429. Ci.WebGLLights = function() {
  49430. var i = {};
  49431. this.get = function(e) {
  49432. if (void 0 !== i[e.id])
  49433. return i[e.id];
  49434. var t;
  49435. switch (e.type) {
  49436. case "DirectionalLight":
  49437. t = {
  49438. direction: new Ci.Vector3,
  49439. color: new Ci.Color,
  49440. shadow: !1,
  49441. shadowBias: 0,
  49442. shadowRadius: 1,
  49443. shadowMapSize: new Ci.Vector2
  49444. };
  49445. break;
  49446. case "SpotLight":
  49447. t = {
  49448. position: new Ci.Vector3,
  49449. direction: new Ci.Vector3,
  49450. color: new Ci.Color,
  49451. distance: 0,
  49452. coneCos: 0,
  49453. penumbraCos: 0,
  49454. decay: 0,
  49455. shadow: !1,
  49456. shadowBias: 0,
  49457. shadowRadius: 1,
  49458. shadowMapSize: new Ci.Vector2
  49459. };
  49460. break;
  49461. case "PointLight":
  49462. t = {
  49463. position: new Ci.Vector3,
  49464. color: new Ci.Color,
  49465. distance: 0,
  49466. decay: 0,
  49467. shadow: !1,
  49468. shadowBias: 0,
  49469. shadowRadius: 1,
  49470. shadowMapSize: new Ci.Vector2
  49471. };
  49472. break;
  49473. case "HemisphereLight":
  49474. t = {
  49475. direction: new Ci.Vector3,
  49476. skyColor: new Ci.Color,
  49477. groundColor: new Ci.Color
  49478. }
  49479. }
  49480. return i[e.id] = t
  49481. }
  49482. }
  49483. ,
  49484. Ci.WebGLObjects = function(g, m, e) {
  49485. function v(e, t) {
  49486. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  49487. , n = m.get(i);
  49488. void 0 === n.__webglBuffer ? function(e, t, i) {
  49489. e.__webglBuffer = g.createBuffer(),
  49490. g.bindBuffer(i, e.__webglBuffer);
  49491. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  49492. g.bufferData(i, t.array, n),
  49493. e.version = t.version
  49494. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  49495. g.bindBuffer(i, e.__webglBuffer),
  49496. !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)),
  49497. t.updateRange.count = 0),
  49498. e.version = t.version
  49499. }(n, i, t)
  49500. }
  49501. function y(e, t, i) {
  49502. if (i < t) {
  49503. var n = t;
  49504. t = i,
  49505. i = n
  49506. }
  49507. var r = e[t];
  49508. return void 0 === r ? (e[t] = [i],
  49509. !0) : -1 === r.indexOf(i) && (r.push(i),
  49510. !0)
  49511. }
  49512. var c = new Ci.WebGLGeometries(g,m,e);
  49513. this.getAttributeBuffer = function(e) {
  49514. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  49515. }
  49516. ,
  49517. this.getWireframeAttribute = function(e) {
  49518. var t = m.get(e);
  49519. if (void 0 !== t.wireframe)
  49520. return t.wireframe;
  49521. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  49522. if (null !== r)
  49523. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  49524. var h = i[l + 0]
  49525. , u = i[l + 1]
  49526. , d = i[l + 2];
  49527. y(s, h, u) && n.push(h, u),
  49528. y(s, u, d) && n.push(u, d),
  49529. y(s, d, h) && n.push(d, h)
  49530. }
  49531. else
  49532. for (l = 0,
  49533. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  49534. h = l + 0,
  49535. u = l + 1,
  49536. d = l + 2;
  49537. n.push(h, u, u, d, d, h)
  49538. }
  49539. var p = 65535 < a.count ? Uint32Array : Uint16Array
  49540. , f = new Ci.BufferAttribute(new p(n),1);
  49541. return v(f, g.ELEMENT_ARRAY_BUFFER),
  49542. t.wireframe = f
  49543. }
  49544. ,
  49545. this.update = function(e) {
  49546. var t = c.get(e);
  49547. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  49548. var i = t.index
  49549. , n = t.attributes;
  49550. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  49551. n)
  49552. v(n[r], g.ARRAY_BUFFER);
  49553. var o = t.morphAttributes;
  49554. for (var r in o)
  49555. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  49556. v(a[s], g.ARRAY_BUFFER);
  49557. return t
  49558. }
  49559. }
  49560. ,
  49561. Ci.WebGLProgram = (Qt = 0,
  49562. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  49563. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  49564. ei = /^([\w\d_]+)\[0\]$/,
  49565. function(e, t, i, n) {
  49566. var r = e.context
  49567. , o = i.extensions
  49568. , a = i.defines
  49569. , s = i.__webglShader.vertexShader
  49570. , l = i.__webglShader.fragmentShader
  49571. , c = "SHADOWMAP_TYPE_BASIC";
  49572. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  49573. var h = "ENVMAP_TYPE_CUBE"
  49574. , u = "ENVMAP_MODE_REFLECTION"
  49575. , d = "ENVMAP_BLENDING_MULTIPLY";
  49576. if (n.envMap) {
  49577. switch (i.envMap.mapping) {
  49578. case Ci.CubeReflectionMapping:
  49579. case Ci.CubeRefractionMapping:
  49580. h = "ENVMAP_TYPE_CUBE";
  49581. break;
  49582. case Ci.CubeUVReflectionMapping:
  49583. case Ci.CubeUVRefractionMapping:
  49584. h = "ENVMAP_TYPE_CUBE_UV";
  49585. break;
  49586. case Ci.EquirectangularReflectionMapping:
  49587. case Ci.EquirectangularRefractionMapping:
  49588. h = "ENVMAP_TYPE_EQUIREC";
  49589. break;
  49590. case Ci.SphericalReflectionMapping:
  49591. h = "ENVMAP_TYPE_SPHERE"
  49592. }
  49593. switch (i.envMap.mapping) {
  49594. case Ci.CubeRefractionMapping:
  49595. case Ci.EquirectangularRefractionMapping:
  49596. u = "ENVMAP_MODE_REFRACTION"
  49597. }
  49598. switch (i.combine) {
  49599. case Ci.MultiplyOperation:
  49600. d = "ENVMAP_BLENDING_MULTIPLY";
  49601. break;
  49602. case Ci.MixOperation:
  49603. d = "ENVMAP_BLENDING_MIX";
  49604. break;
  49605. case Ci.AddOperation:
  49606. d = "ENVMAP_BLENDING_ADD"
  49607. }
  49608. }
  49609. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  49610. 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")
  49611. }(o, n, e.extensions), v = function(e) {
  49612. var t = [];
  49613. for (var i in e) {
  49614. var n = e[i];
  49615. !1 !== n && t.push("#define " + i + " " + n)
  49616. }
  49617. return t.join("\n")
  49618. }(a), y = r.createProgram();
  49619. 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"),
  49620. [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) {
  49621. var i;
  49622. switch (t) {
  49623. case Ci.LinearToneMapping:
  49624. i = "Linear";
  49625. break;
  49626. case Ci.ReinhardToneMapping:
  49627. i = "Reinhard";
  49628. break;
  49629. case Ci.Uncharted2ToneMapping:
  49630. i = "Uncharted2";
  49631. break;
  49632. case Ci.CineonToneMapping:
  49633. i = "OptimizedCineon";
  49634. break;
  49635. default:
  49636. throw new Error("unsupported toneMapping: " + t)
  49637. }
  49638. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  49639. }("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) {
  49640. var i = Mi(t);
  49641. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  49642. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  49643. s = Oi(s = Li(s), n),
  49644. l = Oi(l = Li(l), n),
  49645. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  49646. l = Di(l));
  49647. var A = p + s
  49648. , C = f + l
  49649. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  49650. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  49651. r.attachShader(y, I),
  49652. r.attachShader(y, E),
  49653. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  49654. r.linkProgram(y);
  49655. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  49656. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  49657. 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),
  49658. M && (this.diagnostics = {
  49659. runnable: S,
  49660. material: i,
  49661. programLog: w,
  49662. vertexShader: {
  49663. log: T,
  49664. prefix: p
  49665. },
  49666. fragmentShader: {
  49667. log: x,
  49668. prefix: f
  49669. }
  49670. }),
  49671. r.deleteShader(I),
  49672. r.deleteShader(E),
  49673. this.getUniforms = function() {
  49674. return void 0 === _ && (_ = function(e, t) {
  49675. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  49676. var o = e.getActiveUniform(t, r).name
  49677. , a = e.getUniformLocation(t, o)
  49678. , s = Jt.exec(o);
  49679. if (s) {
  49680. var l = s[1]
  49681. , c = s[2]
  49682. , h = i[l];
  49683. (h = h || (i[l] = {}))[c] = a
  49684. } else if (s = $t.exec(o)) {
  49685. var u = s[1]
  49686. , d = s[2]
  49687. , p = s[3]
  49688. , f = i[u]
  49689. , g = (f = f || (i[u] = []))[d];
  49690. (g = g || (f[d] = {}))[p] = a
  49691. } else
  49692. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  49693. }
  49694. return i
  49695. }(r, y)),
  49696. _
  49697. }
  49698. ,
  49699. this.getAttributes = function() {
  49700. return void 0 === b && (b = function(e, t) {
  49701. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  49702. var o = e.getActiveAttrib(t, r).name;
  49703. i[o] = e.getAttribLocation(t, o)
  49704. }
  49705. return i
  49706. }(r, y)),
  49707. b
  49708. }
  49709. ,
  49710. this.destroy = function() {
  49711. r.deleteProgram(y),
  49712. this.program = void 0
  49713. }
  49714. ,
  49715. Object.defineProperties(this, {
  49716. uniforms: {
  49717. get: function() {
  49718. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  49719. this.getUniforms()
  49720. }
  49721. },
  49722. attributes: {
  49723. get: function() {
  49724. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  49725. this.getAttributes()
  49726. }
  49727. }
  49728. }),
  49729. this.id = Qt++,
  49730. this.code = t,
  49731. this.usedTimes = 1,
  49732. this.program = y,
  49733. this.vertexShader = I,
  49734. this.fragmentShader = E,
  49735. this
  49736. }
  49737. ),
  49738. Ci.WebGLPrograms = function(s, l) {
  49739. function c(e, t) {
  49740. var i;
  49741. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  49742. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  49743. i
  49744. }
  49745. var h = []
  49746. , u = {
  49747. MeshDepthMaterial: "depth",
  49748. MeshNormalMaterial: "normal",
  49749. MeshBasicMaterial: "basic",
  49750. MeshLambertMaterial: "lambert",
  49751. MeshPhongMaterial: "phong",
  49752. MeshStandardMaterial: "standard",
  49753. LineBasicMaterial: "basic",
  49754. LineDashedMaterial: "dashed",
  49755. PointsMaterial: "points"
  49756. }
  49757. , 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"];
  49758. this.getParameters = function(e, t, i, n) {
  49759. var r = u[e.type]
  49760. , o = function(e) {
  49761. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  49762. return 1024;
  49763. var t = l.maxVertexUniforms
  49764. , i = Math.floor((t - 20) / 4);
  49765. 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)")),
  49766. i
  49767. }(n)
  49768. , a = s.getPrecision();
  49769. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  49770. {
  49771. shaderID: r,
  49772. precision: a,
  49773. supportsVertexTextures: l.vertexTextures,
  49774. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  49775. map: !!e.map,
  49776. mapEncoding: c(e.map, s.gammaInput),
  49777. envMap: !!e.envMap,
  49778. envMapMode: e.envMap && e.envMap.mapping,
  49779. envMapEncoding: c(e.envMap, s.gammaInput),
  49780. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  49781. lightMap: !!e.lightMap,
  49782. aoMap: !!e.aoMap,
  49783. emissiveMap: !!e.emissiveMap,
  49784. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  49785. bumpMap: !!e.bumpMap,
  49786. normalMap: !!e.normalMap,
  49787. displacementMap: !!e.displacementMap,
  49788. roughnessMap: !!e.roughnessMap,
  49789. metalnessMap: !!e.metalnessMap,
  49790. specularMap: !!e.specularMap,
  49791. alphaMap: !!e.alphaMap,
  49792. combine: e.combine,
  49793. vertexColors: e.vertexColors,
  49794. fog: i,
  49795. useFog: e.fog,
  49796. fogExp: i instanceof Ci.FogExp2,
  49797. flatShading: e.shading === Ci.FlatShading,
  49798. sizeAttenuation: e.sizeAttenuation,
  49799. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  49800. skinning: e.skinning,
  49801. maxBones: o,
  49802. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  49803. morphTargets: e.morphTargets,
  49804. morphNormals: e.morphNormals,
  49805. maxMorphTargets: s.maxMorphTargets,
  49806. maxMorphNormals: s.maxMorphNormals,
  49807. numDirLights: t.directional.length,
  49808. numPointLights: t.point.length,
  49809. numSpotLights: t.spot.length,
  49810. numHemiLights: t.hemi.length,
  49811. pointLightShadows: t.shadowsPointLight,
  49812. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  49813. shadowMapType: s.shadowMap.type,
  49814. toneMapping: s.toneMapping,
  49815. physicallyCorrectLights: s.physicallyCorrectLights,
  49816. premultipliedAlpha: e.premultipliedAlpha,
  49817. alphaTest: e.alphaTest,
  49818. doubleSided: e.side === Ci.DoubleSide,
  49819. flipSided: e.side === Ci.BackSide
  49820. }
  49821. }
  49822. ,
  49823. this.getProgramCode = function(e, t) {
  49824. var i = [];
  49825. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  49826. i.push(e.vertexShader)),
  49827. void 0 !== e.defines)
  49828. for (var n in e.defines)
  49829. i.push(n),
  49830. i.push(e.defines[n]);
  49831. for (var r = 0; r < a.length; r++) {
  49832. var o = a[r];
  49833. i.push(o),
  49834. i.push(t[o])
  49835. }
  49836. return i.join()
  49837. }
  49838. ,
  49839. this.acquireProgram = function(e, t, i) {
  49840. for (var n, r = 0, o = h.length; r < o; r++) {
  49841. var a = h[r];
  49842. if (a.code === i) {
  49843. ++(n = a).usedTimes;
  49844. break
  49845. }
  49846. }
  49847. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  49848. h.push(n)),
  49849. n
  49850. }
  49851. ,
  49852. this.releaseProgram = function(e) {
  49853. if (0 == --e.usedTimes) {
  49854. var t = h.indexOf(e);
  49855. h[t] = h[h.length - 1],
  49856. h.pop(),
  49857. e.destroy()
  49858. }
  49859. }
  49860. ,
  49861. this.programs = h
  49862. }
  49863. ,
  49864. Ci.WebGLProperties = function() {
  49865. var n = {};
  49866. this.get = function(e) {
  49867. var t = e.uuid
  49868. , i = n[t];
  49869. return void 0 === i && (i = {},
  49870. n[t] = i),
  49871. i
  49872. }
  49873. ,
  49874. this.delete = function(e) {
  49875. delete n[e.uuid]
  49876. }
  49877. ,
  49878. this.clear = function() {
  49879. n = {}
  49880. }
  49881. }
  49882. ,
  49883. Ci.WebGLShader = function(e, t, i) {
  49884. var n = e.createShader(t);
  49885. return e.shaderSource(n, i),
  49886. e.compileShader(n),
  49887. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  49888. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  49889. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  49890. t[i] = i + 1 + ": " + t[i];
  49891. return t.join("\n")
  49892. }(i)),
  49893. n
  49894. }
  49895. ,
  49896. Ci.WebGLShadowMap = function(P, O, L) {
  49897. function D(e, t, i, n) {
  49898. var r = e.geometry
  49899. , o = null
  49900. , a = p
  49901. , s = e.customDepthMaterial;
  49902. if (i && (a = f,
  49903. s = e.customDistanceMaterial),
  49904. s)
  49905. o = s;
  49906. else {
  49907. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  49908. , c = e instanceof Ci.SkinnedMesh && t.skinning
  49909. , h = 0;
  49910. l && (h |= u),
  49911. c && (h |= d),
  49912. o = a[h]
  49913. }
  49914. return o.visible = t.visible,
  49915. o.wireframe = t.wireframe,
  49916. o.wireframeLinewidth = t.wireframeLinewidth,
  49917. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  49918. o
  49919. }
  49920. function N(e, t, i) {
  49921. if (!1 !== e.visible) {
  49922. 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)))
  49923. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  49924. G.push(e));
  49925. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  49926. N(n[r], t, i)
  49927. }
  49928. }
  49929. 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) {
  49930. var a = 0 != (o & u)
  49931. , s = 0 != (o & d)
  49932. , l = new Ci.ShaderMaterial({
  49933. uniforms: i,
  49934. vertexShader: t.vertexShader,
  49935. fragmentShader: t.fragmentShader,
  49936. morphTargets: a,
  49937. skinning: s
  49938. });
  49939. p[o] = l;
  49940. var c = new Ci.ShaderMaterial({
  49941. defines: {
  49942. USE_SHADOWMAP: ""
  49943. },
  49944. uniforms: r,
  49945. vertexShader: n.vertexShader,
  49946. fragmentShader: n.fragmentShader,
  49947. morphTargets: a,
  49948. skinning: s
  49949. });
  49950. f[o] = c
  49951. }
  49952. var q = this;
  49953. this.enabled = !1,
  49954. this.autoUpdate = !0,
  49955. this.needsUpdate = !1,
  49956. this.type = Ci.PCFShadowMap,
  49957. this.cullFace = Ci.CullFaceFront,
  49958. this.render = function(e, t) {
  49959. var i, n, r = O.shadows;
  49960. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  49961. B.clearColor(1, 1, 1, 1),
  49962. B.disable(F.BLEND),
  49963. B.enable(F.CULL_FACE),
  49964. F.frontFace(F.CCW),
  49965. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  49966. B.setDepthTest(!0),
  49967. B.setScissorTest(!1);
  49968. for (var o = 0, a = r.length; o < a; o++) {
  49969. var s = r[o]
  49970. , l = s.shadow
  49971. , c = l.camera;
  49972. if (U.copy(l.mapSize),
  49973. s instanceof Ci.PointLight) {
  49974. i = 6,
  49975. n = !0;
  49976. var h = U.x
  49977. , u = U.y;
  49978. Y[0].set(2 * h, u, h, u),
  49979. Y[1].set(0, u, h, u),
  49980. Y[2].set(3 * h, u, h, u),
  49981. Y[3].set(h, u, h, u),
  49982. Y[4].set(3 * h, 0, h, u),
  49983. Y[5].set(h, 0, h, u),
  49984. U.x *= 4,
  49985. U.y *= 2
  49986. } else
  49987. n = !(i = 1);
  49988. if (null === l.map) {
  49989. var d = {
  49990. minFilter: Ci.NearestFilter,
  49991. magFilter: Ci.NearestFilter,
  49992. format: Ci.RGBAFormat
  49993. };
  49994. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  49995. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  49996. c.updateProjectionMatrix()
  49997. }
  49998. var p = l.map
  49999. , f = l.matrix;
  50000. z.setFromMatrixPosition(s.matrixWorld),
  50001. c.position.copy(z),
  50002. P.setRenderTarget(p),
  50003. P.clear();
  50004. for (var g = 0; g < i; g++) {
  50005. if (n) {
  50006. H.copy(c.position),
  50007. H.add(W[g]),
  50008. c.up.copy(j[g]),
  50009. c.lookAt(H);
  50010. var m = Y[g];
  50011. B.viewport(m)
  50012. } else
  50013. H.setFromMatrixPosition(s.target.matrixWorld),
  50014. c.lookAt(H);
  50015. c.updateMatrixWorld(),
  50016. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50017. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50018. f.multiply(c.projectionMatrix),
  50019. f.multiply(c.matrixWorldInverse),
  50020. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50021. V.setFromMatrix(k),
  50022. G.length = 0,
  50023. N(e, t, c);
  50024. for (var v = 0, y = G.length; v < y; v++) {
  50025. var A = G[v]
  50026. , C = L.update(A)
  50027. , I = A.material;
  50028. if (I instanceof Ci.MultiMaterial)
  50029. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  50030. var T = E[b]
  50031. , x = _[T.materialIndex];
  50032. if (!0 === x.visible) {
  50033. var S = D(A, x, n, z);
  50034. P.renderBufferDirect(c, null, C, S, A, T)
  50035. }
  50036. }
  50037. else {
  50038. S = D(A, I, n, z);
  50039. P.renderBufferDirect(c, null, C, S, A, null)
  50040. }
  50041. }
  50042. }
  50043. }
  50044. var M = P.getClearColor()
  50045. , R = P.getClearAlpha();
  50046. P.setClearColor(M, R),
  50047. B.enable(F.BLEND),
  50048. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  50049. q.needsUpdate = !1
  50050. }
  50051. }
  50052. }
  50053. ,
  50054. Ci.WebGLState = function(l, i, c) {
  50055. var n = this
  50056. , r = new Ci.Vector4
  50057. , o = new Uint8Array(16)
  50058. , a = new Uint8Array(16)
  50059. , s = new Uint8Array(16)
  50060. , t = {}
  50061. , h = null
  50062. , u = null
  50063. , d = null
  50064. , p = null
  50065. , f = null
  50066. , g = null
  50067. , m = null
  50068. , v = null
  50069. , y = !1
  50070. , A = null
  50071. , C = null
  50072. , I = null
  50073. , E = null
  50074. , _ = null
  50075. , b = null
  50076. , w = null
  50077. , T = null
  50078. , x = null
  50079. , S = null
  50080. , M = null
  50081. , R = null
  50082. , P = null
  50083. , O = null
  50084. , L = null
  50085. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  50086. , N = void 0
  50087. , F = {}
  50088. , B = new Ci.Vector4
  50089. , V = null
  50090. , k = null
  50091. , U = new Ci.Vector4
  50092. , H = new Ci.Vector4
  50093. , z = l.createTexture();
  50094. l.bindTexture(l.TEXTURE_2D, z),
  50095. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  50096. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  50097. this.init = function() {
  50098. this.clearColor(0, 0, 0, 1),
  50099. this.clearDepth(1),
  50100. this.clearStencil(0),
  50101. this.enable(l.DEPTH_TEST),
  50102. l.depthFunc(l.LEQUAL),
  50103. l.frontFace(l.CCW),
  50104. l.cullFace(l.BACK),
  50105. this.enable(l.CULL_FACE),
  50106. this.enable(l.BLEND),
  50107. l.blendEquation(l.FUNC_ADD),
  50108. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  50109. }
  50110. ,
  50111. this.initAttributes = function() {
  50112. for (var e = 0, t = o.length; e < t; e++)
  50113. o[e] = 0
  50114. }
  50115. ,
  50116. this.enableAttribute = function(e) {
  50117. o[e] = 1,
  50118. 0 === a[e] && (l.enableVertexAttribArray(e),
  50119. a[e] = 1),
  50120. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  50121. s[e] = 0)
  50122. }
  50123. ,
  50124. this.enableAttributeAndDivisor = function(e, t, i) {
  50125. o[e] = 1,
  50126. 0 === a[e] && (l.enableVertexAttribArray(e),
  50127. a[e] = 1),
  50128. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  50129. s[e] = t)
  50130. }
  50131. ,
  50132. this.disableUnusedAttributes = function() {
  50133. for (var e = 0, t = a.length; e < t; e++)
  50134. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  50135. a[e] = 0)
  50136. }
  50137. ,
  50138. this.enable = function(e) {
  50139. !0 !== t[e] && (l.enable(e),
  50140. t[e] = !0)
  50141. }
  50142. ,
  50143. this.disable = function(e) {
  50144. !1 !== t[e] && (l.disable(e),
  50145. t[e] = !1)
  50146. }
  50147. ,
  50148. this.getCompressedTextureFormats = function() {
  50149. if (null === h && (h = [],
  50150. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  50151. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  50152. h.push(e[t]);
  50153. return h
  50154. }
  50155. ,
  50156. this.setBlending = function(e, t, i, n, r, o, a, s) {
  50157. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  50158. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50159. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  50160. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50161. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50162. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50163. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50164. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50165. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50166. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  50167. u = e,
  50168. y = s),
  50169. e === Ci.CustomBlending ? (r = r || t,
  50170. o = o || i,
  50171. a = a || n,
  50172. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  50173. d = t,
  50174. g = r),
  50175. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  50176. p = i,
  50177. f = n,
  50178. m = o,
  50179. v = a)) : v = m = g = f = p = d = null
  50180. }
  50181. ,
  50182. this.setDepthFunc = function(e) {
  50183. if (A !== e) {
  50184. if (e)
  50185. switch (e) {
  50186. case Ci.NeverDepth:
  50187. l.depthFunc(l.NEVER);
  50188. break;
  50189. case Ci.AlwaysDepth:
  50190. l.depthFunc(l.ALWAYS);
  50191. break;
  50192. case Ci.LessDepth:
  50193. l.depthFunc(l.LESS);
  50194. break;
  50195. case Ci.LessEqualDepth:
  50196. l.depthFunc(l.LEQUAL);
  50197. break;
  50198. case Ci.EqualDepth:
  50199. l.depthFunc(l.EQUAL);
  50200. break;
  50201. case Ci.GreaterEqualDepth:
  50202. l.depthFunc(l.GEQUAL);
  50203. break;
  50204. case Ci.GreaterDepth:
  50205. l.depthFunc(l.GREATER);
  50206. break;
  50207. case Ci.NotEqualDepth:
  50208. l.depthFunc(l.NOTEQUAL);
  50209. break;
  50210. default:
  50211. l.depthFunc(l.LEQUAL)
  50212. }
  50213. else
  50214. l.depthFunc(l.LEQUAL);
  50215. A = e
  50216. }
  50217. }
  50218. ,
  50219. this.setDepthTest = function(e) {
  50220. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  50221. }
  50222. ,
  50223. this.setDepthWrite = function(e) {
  50224. C !== e && (l.depthMask(e),
  50225. C = e)
  50226. }
  50227. ,
  50228. this.setColorWrite = function(e) {
  50229. I !== e && (l.colorMask(e, e, e, e),
  50230. I = e)
  50231. }
  50232. ,
  50233. this.setStencilFunc = function(e, t, i) {
  50234. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  50235. _ = e,
  50236. b = t,
  50237. w = i)
  50238. }
  50239. ,
  50240. this.setStencilOp = function(e, t, i) {
  50241. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  50242. T = e,
  50243. x = t,
  50244. S = i)
  50245. }
  50246. ,
  50247. this.setStencilTest = function(e) {
  50248. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  50249. }
  50250. ,
  50251. this.setStencilWrite = function(e) {
  50252. E !== e && (l.stencilMask(e),
  50253. E = e)
  50254. }
  50255. ,
  50256. this.setFlipSided = function(e) {
  50257. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  50258. M = e)
  50259. }
  50260. ,
  50261. this.setLineWidth = function(e) {
  50262. e !== R && (l.lineWidth(e),
  50263. R = e)
  50264. }
  50265. ,
  50266. this.setPolygonOffset = function(e, t, i) {
  50267. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  50268. !e || P === t && O === i || (l.polygonOffset(t, i),
  50269. P = t,
  50270. O = i)
  50271. }
  50272. ,
  50273. this.getScissorTest = function() {
  50274. return L
  50275. }
  50276. ,
  50277. this.setScissorTest = function(e) {
  50278. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  50279. }
  50280. ,
  50281. this.activeTexture = function(e) {
  50282. void 0 === e && (e = l.TEXTURE0 + D - 1),
  50283. N !== e && (l.activeTexture(e),
  50284. N = e)
  50285. }
  50286. ,
  50287. this.bindTexture = function(e, t) {
  50288. void 0 === N && n.activeTexture();
  50289. var i = F[N];
  50290. void 0 === i && (i = {
  50291. type: void 0,
  50292. texture: void 0
  50293. },
  50294. F[N] = i),
  50295. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  50296. i.type = e,
  50297. i.texture = t)
  50298. }
  50299. ,
  50300. this.compressedTexImage2D = function() {
  50301. try {
  50302. l.compressedTexImage2D.apply(l, arguments)
  50303. } catch (e) {
  50304. console.error(e)
  50305. }
  50306. }
  50307. ,
  50308. this.texImage2D = function() {
  50309. try {
  50310. l.texImage2D.apply(l, arguments)
  50311. } catch (e) {
  50312. console.error(e)
  50313. }
  50314. }
  50315. ,
  50316. this.clearColor = function(e, t, i, n) {
  50317. r.set(e, t, i, n),
  50318. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  50319. B.copy(r))
  50320. }
  50321. ,
  50322. this.clearDepth = function(e) {
  50323. V !== e && (l.clearDepth(e),
  50324. V = e)
  50325. }
  50326. ,
  50327. this.clearStencil = function(e) {
  50328. k !== e && (l.clearStencil(e),
  50329. k = e)
  50330. }
  50331. ,
  50332. this.scissor = function(e) {
  50333. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  50334. U.copy(e))
  50335. }
  50336. ,
  50337. this.viewport = function(e) {
  50338. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  50339. H.copy(e))
  50340. }
  50341. ,
  50342. this.reset = function() {
  50343. for (var e = 0; e < a.length; e++)
  50344. 1 === a[e] && (l.disableVertexAttribArray(e),
  50345. a[e] = 0);
  50346. t = {},
  50347. N = void 0,
  50348. F = {},
  50349. M = E = C = I = u = h = null
  50350. }
  50351. }
  50352. ,
  50353. Ci.LensFlarePlugin = function(v, y) {
  50354. function A() {
  50355. 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]);
  50356. C = S.createBuffer(),
  50357. I = S.createBuffer(),
  50358. S.bindBuffer(S.ARRAY_BUFFER, C),
  50359. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  50360. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50361. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  50362. T = S.createTexture(),
  50363. x = S.createTexture(),
  50364. M.bindTexture(S.TEXTURE_2D, T),
  50365. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  50366. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50367. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50368. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50369. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50370. M.bindTexture(S.TEXTURE_2D, x),
  50371. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  50372. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50373. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50374. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50375. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50376. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  50377. 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"),
  50378. 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")
  50379. } : {
  50380. 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"),
  50381. 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")
  50382. },
  50383. E = function(e) {
  50384. var t = S.createProgram()
  50385. , i = S.createShader(S.FRAGMENT_SHADER)
  50386. , n = S.createShader(S.VERTEX_SHADER)
  50387. , r = "precision " + v.getPrecision() + " float;\n";
  50388. return S.shaderSource(i, r + e.fragmentShader),
  50389. S.shaderSource(n, r + e.vertexShader),
  50390. S.compileShader(i),
  50391. S.compileShader(n),
  50392. S.attachShader(t, i),
  50393. S.attachShader(t, n),
  50394. S.linkProgram(t),
  50395. t
  50396. }(e),
  50397. _ = {
  50398. vertex: S.getAttribLocation(E, "position"),
  50399. uv: S.getAttribLocation(E, "uv")
  50400. },
  50401. b = {
  50402. renderType: S.getUniformLocation(E, "renderType"),
  50403. map: S.getUniformLocation(E, "map"),
  50404. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  50405. opacity: S.getUniformLocation(E, "opacity"),
  50406. color: S.getUniformLocation(E, "color"),
  50407. scale: S.getUniformLocation(E, "scale"),
  50408. rotation: S.getUniformLocation(E, "rotation"),
  50409. screenPosition: S.getUniformLocation(E, "screenPosition")
  50410. }
  50411. }
  50412. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  50413. this.render = function(e, t, i) {
  50414. if (0 !== y.length) {
  50415. var n = new Ci.Vector3
  50416. , r = i.w / i.z
  50417. , o = .5 * i.z
  50418. , a = .5 * i.w
  50419. , s = 16 / i.w
  50420. , l = new Ci.Vector2(s * r,s)
  50421. , c = new Ci.Vector3(1,1,0)
  50422. , h = new Ci.Vector2(1,1);
  50423. void 0 === E && A(),
  50424. S.useProgram(E),
  50425. M.initAttributes(),
  50426. M.enableAttribute(_.vertex),
  50427. M.enableAttribute(_.uv),
  50428. M.disableUnusedAttributes(),
  50429. S.uniform1i(b.occlusionMap, 0),
  50430. S.uniform1i(b.map, 1),
  50431. S.bindBuffer(S.ARRAY_BUFFER, C),
  50432. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  50433. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  50434. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50435. M.disable(S.CULL_FACE),
  50436. M.setDepthWrite(!1);
  50437. for (var u = 0, d = y.length; u < d; u++) {
  50438. s = 16 / i.w,
  50439. l.set(s * r, s);
  50440. var p = y[u];
  50441. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  50442. n.applyMatrix4(t.matrixWorldInverse),
  50443. n.applyProjection(t.projectionMatrix),
  50444. c.copy(n),
  50445. h.x = c.x * o + o,
  50446. h.y = c.y * a + a,
  50447. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  50448. M.activeTexture(S.TEXTURE0),
  50449. M.bindTexture(S.TEXTURE_2D, null),
  50450. M.activeTexture(S.TEXTURE1),
  50451. M.bindTexture(S.TEXTURE_2D, T),
  50452. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50453. S.uniform1i(b.renderType, 0),
  50454. S.uniform2f(b.scale, l.x, l.y),
  50455. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50456. M.disable(S.BLEND),
  50457. M.enable(S.DEPTH_TEST),
  50458. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50459. M.activeTexture(S.TEXTURE0),
  50460. M.bindTexture(S.TEXTURE_2D, x),
  50461. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50462. S.uniform1i(b.renderType, 1),
  50463. M.disable(S.DEPTH_TEST),
  50464. M.activeTexture(S.TEXTURE1),
  50465. M.bindTexture(S.TEXTURE_2D, T),
  50466. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50467. p.positionScreen.copy(c),
  50468. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  50469. S.uniform1i(b.renderType, 2),
  50470. M.enable(S.BLEND);
  50471. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  50472. var m = p.lensFlares[f];
  50473. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  50474. c.y = m.y,
  50475. c.z = m.z,
  50476. s = m.size * m.scale / i.w,
  50477. l.x = s * r,
  50478. l.y = s,
  50479. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50480. S.uniform2f(b.scale, l.x, l.y),
  50481. S.uniform1f(b.rotation, m.rotation),
  50482. S.uniform1f(b.opacity, m.opacity),
  50483. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  50484. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  50485. v.setTexture(m.texture, 1),
  50486. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  50487. }
  50488. }
  50489. }
  50490. M.enable(S.CULL_FACE),
  50491. M.enable(S.DEPTH_TEST),
  50492. M.setDepthWrite(!0),
  50493. v.resetGLState()
  50494. }
  50495. }
  50496. }
  50497. ,
  50498. Ci.SpritePlugin = function(u, d) {
  50499. function p() {
  50500. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  50501. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  50502. g = I.createBuffer(),
  50503. m = I.createBuffer(),
  50504. I.bindBuffer(I.ARRAY_BUFFER, g),
  50505. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  50506. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50507. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  50508. v = function() {
  50509. var e = I.createProgram()
  50510. , t = I.createShader(I.VERTEX_SHADER)
  50511. , i = I.createShader(I.FRAGMENT_SHADER);
  50512. 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")),
  50513. 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")),
  50514. I.compileShader(t),
  50515. I.compileShader(i),
  50516. I.attachShader(e, t),
  50517. I.attachShader(e, i),
  50518. I.linkProgram(e),
  50519. e
  50520. }(),
  50521. y = {
  50522. position: I.getAttribLocation(v, "position"),
  50523. uv: I.getAttribLocation(v, "uv")
  50524. },
  50525. A = {
  50526. uvOffset: I.getUniformLocation(v, "uvOffset"),
  50527. uvScale: I.getUniformLocation(v, "uvScale"),
  50528. rotation: I.getUniformLocation(v, "rotation"),
  50529. scale: I.getUniformLocation(v, "scale"),
  50530. color: I.getUniformLocation(v, "color"),
  50531. map: I.getUniformLocation(v, "map"),
  50532. opacity: I.getUniformLocation(v, "opacity"),
  50533. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  50534. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  50535. fogType: I.getUniformLocation(v, "fogType"),
  50536. fogDensity: I.getUniformLocation(v, "fogDensity"),
  50537. fogNear: I.getUniformLocation(v, "fogNear"),
  50538. fogFar: I.getUniformLocation(v, "fogFar"),
  50539. fogColor: I.getUniformLocation(v, "fogColor"),
  50540. alphaTest: I.getUniformLocation(v, "alphaTest")
  50541. };
  50542. var i = document.createElement("canvas");
  50543. i.width = 8,
  50544. i.height = 8;
  50545. var n = i.getContext("2d");
  50546. n.fillStyle = "white",
  50547. n.fillRect(0, 0, 8, 8),
  50548. (C = new Ci.Texture(i)).needsUpdate = !0
  50549. }
  50550. function f(e, t) {
  50551. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  50552. }
  50553. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  50554. this.render = function(e, t) {
  50555. if (0 !== d.length) {
  50556. void 0 === v && p(),
  50557. I.useProgram(v),
  50558. E.initAttributes(),
  50559. E.enableAttribute(y.position),
  50560. E.enableAttribute(y.uv),
  50561. E.disableUnusedAttributes(),
  50562. E.disable(I.CULL_FACE),
  50563. E.enable(I.BLEND),
  50564. I.bindBuffer(I.ARRAY_BUFFER, g),
  50565. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  50566. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  50567. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50568. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  50569. E.activeTexture(I.TEXTURE0),
  50570. I.uniform1i(A.map, 0);
  50571. var i = 0
  50572. , n = 0
  50573. , r = e.fog;
  50574. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  50575. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  50576. I.uniform1f(A.fogFar, r.far),
  50577. I.uniform1i(A.fogType, 1),
  50578. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  50579. I.uniform1i(A.fogType, 2),
  50580. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  50581. n = i = 0);
  50582. for (var o = 0, a = d.length; o < a; o++) {
  50583. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  50584. l.z = -l.modelViewMatrix.elements[14]
  50585. }
  50586. d.sort(f);
  50587. var s = [];
  50588. for (o = 0,
  50589. a = d.length; o < a; o++) {
  50590. var l, c = (l = d[o]).material;
  50591. I.uniform1f(A.alphaTest, c.alphaTest),
  50592. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  50593. l.matrixWorld.decompose(_, b, w),
  50594. s[0] = w.x,
  50595. s[1] = w.y;
  50596. var h = 0;
  50597. e.fog && c.fog && (h = n),
  50598. i !== h && (I.uniform1i(A.fogType, h),
  50599. i = h),
  50600. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  50601. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  50602. I.uniform2f(A.uvScale, 1, 1)),
  50603. I.uniform1f(A.opacity, c.opacity),
  50604. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  50605. I.uniform1f(A.rotation, c.rotation),
  50606. I.uniform2fv(A.scale, s),
  50607. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  50608. E.setDepthTest(c.depthTest),
  50609. E.setDepthWrite(c.depthWrite),
  50610. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  50611. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  50612. }
  50613. E.enable(I.CULL_FACE),
  50614. u.resetGLState()
  50615. }
  50616. }
  50617. }
  50618. ,
  50619. Object.defineProperties(Ci.Box2.prototype, {
  50620. empty: {
  50621. value: function() {
  50622. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  50623. this.isEmpty()
  50624. }
  50625. },
  50626. isIntersectionBox: {
  50627. value: function(e) {
  50628. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50629. this.intersectsBox(e)
  50630. }
  50631. }
  50632. }),
  50633. Object.defineProperties(Ci.Box3.prototype, {
  50634. empty: {
  50635. value: function() {
  50636. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  50637. this.isEmpty()
  50638. }
  50639. },
  50640. isIntersectionBox: {
  50641. value: function(e) {
  50642. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50643. this.intersectsBox(e)
  50644. }
  50645. },
  50646. isIntersectionSphere: {
  50647. value: function(e) {
  50648. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  50649. this.intersectsSphere(e)
  50650. }
  50651. }
  50652. }),
  50653. Object.defineProperties(Ci.Matrix3.prototype, {
  50654. multiplyVector3: {
  50655. value: function(e) {
  50656. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  50657. e.applyMatrix3(this)
  50658. }
  50659. },
  50660. multiplyVector3Array: {
  50661. value: function(e) {
  50662. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  50663. this.applyToVector3Array(e)
  50664. }
  50665. }
  50666. }),
  50667. Object.defineProperties(Ci.Matrix4.prototype, {
  50668. extractPosition: {
  50669. value: function(e) {
  50670. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  50671. this.copyPosition(e)
  50672. }
  50673. },
  50674. setRotationFromQuaternion: {
  50675. value: function(e) {
  50676. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  50677. this.makeRotationFromQuaternion(e)
  50678. }
  50679. },
  50680. multiplyVector3: {
  50681. value: function(e) {
  50682. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  50683. e.applyProjection(this)
  50684. }
  50685. },
  50686. multiplyVector4: {
  50687. value: function(e) {
  50688. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  50689. e.applyMatrix4(this)
  50690. }
  50691. },
  50692. multiplyVector3Array: {
  50693. value: function(e) {
  50694. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  50695. this.applyToVector3Array(e)
  50696. }
  50697. },
  50698. rotateAxis: {
  50699. value: function(e) {
  50700. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  50701. e.transformDirection(this)
  50702. }
  50703. },
  50704. crossVector: {
  50705. value: function(e) {
  50706. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  50707. e.applyMatrix4(this)
  50708. }
  50709. },
  50710. translate: {
  50711. value: function(e) {
  50712. console.error("THREE.Matrix4: .translate() has been removed.")
  50713. }
  50714. },
  50715. rotateX: {
  50716. value: function(e) {
  50717. console.error("THREE.Matrix4: .rotateX() has been removed.")
  50718. }
  50719. },
  50720. rotateY: {
  50721. value: function(e) {
  50722. console.error("THREE.Matrix4: .rotateY() has been removed.")
  50723. }
  50724. },
  50725. rotateZ: {
  50726. value: function(e) {
  50727. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  50728. }
  50729. },
  50730. rotateByAxis: {
  50731. value: function(e, t) {
  50732. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  50733. }
  50734. }
  50735. }),
  50736. Object.defineProperties(Ci.Plane.prototype, {
  50737. isIntersectionLine: {
  50738. value: function(e) {
  50739. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  50740. this.intersectsLine(e)
  50741. }
  50742. }
  50743. }),
  50744. Object.defineProperties(Ci.Quaternion.prototype, {
  50745. multiplyVector3: {
  50746. value: function(e) {
  50747. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  50748. e.applyQuaternion(this)
  50749. }
  50750. }
  50751. }),
  50752. Object.defineProperties(Ci.Ray.prototype, {
  50753. isIntersectionBox: {
  50754. value: function(e) {
  50755. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50756. this.intersectsBox(e)
  50757. }
  50758. },
  50759. isIntersectionPlane: {
  50760. value: function(e) {
  50761. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  50762. this.intersectsPlane(e)
  50763. }
  50764. },
  50765. isIntersectionSphere: {
  50766. value: function(e) {
  50767. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  50768. this.intersectsSphere(e)
  50769. }
  50770. }
  50771. }),
  50772. Object.defineProperties(Ci.Vector3.prototype, {
  50773. setEulerFromRotationMatrix: {
  50774. value: function() {
  50775. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  50776. }
  50777. },
  50778. setEulerFromQuaternion: {
  50779. value: function() {
  50780. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  50781. }
  50782. },
  50783. getPositionFromMatrix: {
  50784. value: function(e) {
  50785. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  50786. this.setFromMatrixPosition(e)
  50787. }
  50788. },
  50789. getScaleFromMatrix: {
  50790. value: function(e) {
  50791. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  50792. this.setFromMatrixScale(e)
  50793. }
  50794. },
  50795. getColumnFromMatrix: {
  50796. value: function(e, t) {
  50797. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  50798. this.setFromMatrixColumn(e, t)
  50799. }
  50800. }
  50801. }),
  50802. Ci.Face4 = function(e, t, i, n, r, o, a) {
  50803. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  50804. new Ci.Face3(e,t,i,r,o,a)
  50805. }
  50806. ,
  50807. Ci.Vertex = function(e, t, i) {
  50808. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  50809. new Ci.Vector3(e,t,i)
  50810. }
  50811. ,
  50812. Object.defineProperties(Ci.Object3D.prototype, {
  50813. eulerOrder: {
  50814. get: function() {
  50815. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  50816. this.rotation.order
  50817. },
  50818. set: function(e) {
  50819. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  50820. this.rotation.order = e
  50821. }
  50822. },
  50823. getChildByName: {
  50824. value: function(e) {
  50825. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  50826. this.getObjectByName(e)
  50827. }
  50828. },
  50829. renderDepth: {
  50830. set: function(e) {
  50831. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  50832. }
  50833. },
  50834. translate: {
  50835. value: function(e, t) {
  50836. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  50837. this.translateOnAxis(t, e)
  50838. }
  50839. },
  50840. useQuaternion: {
  50841. get: function() {
  50842. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  50843. },
  50844. set: function(e) {
  50845. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  50846. }
  50847. }
  50848. }),
  50849. Object.defineProperties(Ci, {
  50850. PointCloud: {
  50851. value: function(e, t) {
  50852. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  50853. new Ci.Points(e,t)
  50854. }
  50855. },
  50856. ParticleSystem: {
  50857. value: function(e, t) {
  50858. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  50859. new Ci.Points(e,t)
  50860. }
  50861. }
  50862. }),
  50863. Object.defineProperties(Ci.Light.prototype, {
  50864. onlyShadow: {
  50865. set: function(e) {
  50866. console.warn("THREE.Light: .onlyShadow has been removed.")
  50867. }
  50868. },
  50869. shadowCameraFov: {
  50870. set: function(e) {
  50871. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  50872. this.shadow.camera.fov = e
  50873. }
  50874. },
  50875. shadowCameraLeft: {
  50876. set: function(e) {
  50877. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  50878. this.shadow.camera.left = e
  50879. }
  50880. },
  50881. shadowCameraRight: {
  50882. set: function(e) {
  50883. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  50884. this.shadow.camera.right = e
  50885. }
  50886. },
  50887. shadowCameraTop: {
  50888. set: function(e) {
  50889. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  50890. this.shadow.camera.top = e
  50891. }
  50892. },
  50893. shadowCameraBottom: {
  50894. set: function(e) {
  50895. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  50896. this.shadow.camera.bottom = e
  50897. }
  50898. },
  50899. shadowCameraNear: {
  50900. set: function(e) {
  50901. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  50902. this.shadow.camera.near = e
  50903. }
  50904. },
  50905. shadowCameraFar: {
  50906. set: function(e) {
  50907. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  50908. this.shadow.camera.far = e
  50909. }
  50910. },
  50911. shadowCameraVisible: {
  50912. set: function(e) {
  50913. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  50914. }
  50915. },
  50916. shadowBias: {
  50917. set: function(e) {
  50918. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  50919. this.shadow.bias = e
  50920. }
  50921. },
  50922. shadowDarkness: {
  50923. set: function(e) {
  50924. console.warn("THREE.Light: .shadowDarkness has been removed.")
  50925. }
  50926. },
  50927. shadowMapWidth: {
  50928. set: function(e) {
  50929. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  50930. this.shadow.mapSize.width = e
  50931. }
  50932. },
  50933. shadowMapHeight: {
  50934. set: function(e) {
  50935. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  50936. this.shadow.mapSize.height = e
  50937. }
  50938. }
  50939. }),
  50940. Object.defineProperties(Ci.BufferAttribute.prototype, {
  50941. length: {
  50942. get: function() {
  50943. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  50944. this.array.length
  50945. }
  50946. }
  50947. }),
  50948. Object.defineProperties(Ci.BufferGeometry.prototype, {
  50949. drawcalls: {
  50950. get: function() {
  50951. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  50952. this.groups
  50953. }
  50954. },
  50955. offsets: {
  50956. get: function() {
  50957. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  50958. this.groups
  50959. }
  50960. },
  50961. addIndex: {
  50962. value: function(e) {
  50963. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  50964. this.setIndex(e)
  50965. }
  50966. },
  50967. addDrawCall: {
  50968. value: function(e, t, i) {
  50969. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  50970. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  50971. this.addGroup(e, t)
  50972. }
  50973. },
  50974. clearDrawCalls: {
  50975. value: function() {
  50976. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  50977. this.clearGroups()
  50978. }
  50979. },
  50980. computeTangents: {
  50981. value: function() {
  50982. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  50983. }
  50984. },
  50985. computeOffsets: {
  50986. value: function() {
  50987. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  50988. }
  50989. }
  50990. }),
  50991. Object.defineProperties(Ci.Material.prototype, {
  50992. wrapAround: {
  50993. get: function() {
  50994. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  50995. },
  50996. set: function(e) {
  50997. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  50998. }
  50999. },
  51000. wrapRGB: {
  51001. get: function() {
  51002. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51003. new Ci.Color
  51004. }
  51005. }
  51006. }),
  51007. Object.defineProperties(Ci, {
  51008. PointCloudMaterial: {
  51009. value: function(e) {
  51010. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51011. new Ci.PointsMaterial(e)
  51012. }
  51013. },
  51014. ParticleBasicMaterial: {
  51015. value: function(e) {
  51016. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51017. new Ci.PointsMaterial(e)
  51018. }
  51019. },
  51020. ParticleSystemMaterial: {
  51021. value: function(e) {
  51022. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51023. new Ci.PointsMaterial(e)
  51024. }
  51025. }
  51026. }),
  51027. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51028. metal: {
  51029. get: function() {
  51030. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51031. !1
  51032. },
  51033. set: function(e) {
  51034. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51035. }
  51036. }
  51037. }),
  51038. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  51039. derivatives: {
  51040. get: function() {
  51041. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51042. this.extensions.derivatives
  51043. },
  51044. set: function(e) {
  51045. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51046. this.extensions.derivatives = e
  51047. }
  51048. }
  51049. }),
  51050. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  51051. supportsFloatTextures: {
  51052. value: function() {
  51053. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51054. this.extensions.get("OES_texture_float")
  51055. }
  51056. },
  51057. supportsHalfFloatTextures: {
  51058. value: function() {
  51059. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51060. this.extensions.get("OES_texture_half_float")
  51061. }
  51062. },
  51063. supportsStandardDerivatives: {
  51064. value: function() {
  51065. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51066. this.extensions.get("OES_standard_derivatives")
  51067. }
  51068. },
  51069. supportsCompressedTextureS3TC: {
  51070. value: function() {
  51071. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51072. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51073. }
  51074. },
  51075. supportsCompressedTexturePVRTC: {
  51076. value: function() {
  51077. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51078. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51079. }
  51080. },
  51081. supportsBlendMinMax: {
  51082. value: function() {
  51083. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51084. this.extensions.get("EXT_blend_minmax")
  51085. }
  51086. },
  51087. supportsVertexTextures: {
  51088. value: function() {
  51089. return this.capabilities.vertexTextures
  51090. }
  51091. },
  51092. supportsInstancedArrays: {
  51093. value: function() {
  51094. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51095. this.extensions.get("ANGLE_instanced_arrays")
  51096. }
  51097. },
  51098. enableScissorTest: {
  51099. value: function(e) {
  51100. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51101. this.setScissorTest(e)
  51102. }
  51103. },
  51104. initMaterial: {
  51105. value: function() {
  51106. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  51107. }
  51108. },
  51109. addPrePlugin: {
  51110. value: function() {
  51111. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  51112. }
  51113. },
  51114. addPostPlugin: {
  51115. value: function() {
  51116. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  51117. }
  51118. },
  51119. updateShadowMap: {
  51120. value: function() {
  51121. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  51122. }
  51123. },
  51124. shadowMapEnabled: {
  51125. get: function() {
  51126. return this.shadowMap.enabled
  51127. },
  51128. set: function(e) {
  51129. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  51130. this.shadowMap.enabled = e
  51131. }
  51132. },
  51133. shadowMapType: {
  51134. get: function() {
  51135. return this.shadowMap.type
  51136. },
  51137. set: function(e) {
  51138. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  51139. this.shadowMap.type = e
  51140. }
  51141. },
  51142. shadowMapCullFace: {
  51143. get: function() {
  51144. return this.shadowMap.cullFace
  51145. },
  51146. set: function(e) {
  51147. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  51148. this.shadowMap.cullFace = e
  51149. }
  51150. }
  51151. }),
  51152. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  51153. wrapS: {
  51154. get: function() {
  51155. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51156. this.texture.wrapS
  51157. },
  51158. set: function(e) {
  51159. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51160. this.texture.wrapS = e
  51161. }
  51162. },
  51163. wrapT: {
  51164. get: function() {
  51165. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51166. this.texture.wrapT
  51167. },
  51168. set: function(e) {
  51169. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51170. this.texture.wrapT = e
  51171. }
  51172. },
  51173. magFilter: {
  51174. get: function() {
  51175. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51176. this.texture.magFilter
  51177. },
  51178. set: function(e) {
  51179. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51180. this.texture.magFilter = e
  51181. }
  51182. },
  51183. minFilter: {
  51184. get: function() {
  51185. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51186. this.texture.minFilter
  51187. },
  51188. set: function(e) {
  51189. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51190. this.texture.minFilter = e
  51191. }
  51192. },
  51193. anisotropy: {
  51194. get: function() {
  51195. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51196. this.texture.anisotropy
  51197. },
  51198. set: function(e) {
  51199. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51200. this.texture.anisotropy = e
  51201. }
  51202. },
  51203. offset: {
  51204. get: function() {
  51205. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51206. this.texture.offset
  51207. },
  51208. set: function(e) {
  51209. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51210. this.texture.offset = e
  51211. }
  51212. },
  51213. repeat: {
  51214. get: function() {
  51215. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51216. this.texture.repeat
  51217. },
  51218. set: function(e) {
  51219. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51220. this.texture.repeat = e
  51221. }
  51222. },
  51223. format: {
  51224. get: function() {
  51225. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51226. this.texture.format
  51227. },
  51228. set: function(e) {
  51229. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51230. this.texture.format = e
  51231. }
  51232. },
  51233. type: {
  51234. get: function() {
  51235. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51236. this.texture.type
  51237. },
  51238. set: function(e) {
  51239. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51240. this.texture.type = e
  51241. }
  51242. },
  51243. generateMipmaps: {
  51244. get: function() {
  51245. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51246. this.texture.generateMipmaps
  51247. },
  51248. set: function(e) {
  51249. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51250. this.texture.generateMipmaps = e
  51251. }
  51252. }
  51253. }),
  51254. Ci.GeometryUtils = {
  51255. merge: function(e, t, i) {
  51256. var n;
  51257. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  51258. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  51259. n = t.matrix,
  51260. t = t.geometry),
  51261. e.merge(t, n, i)
  51262. },
  51263. center: function(e) {
  51264. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  51265. e.center()
  51266. }
  51267. },
  51268. Ci.ImageUtils = {
  51269. crossOrigin: void 0,
  51270. loadTexture: function(e, t, i, n) {
  51271. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  51272. var r = new Ci.TextureLoader;
  51273. r.setCrossOrigin(this.crossOrigin);
  51274. var o = r.load(e, i, void 0, n);
  51275. return t && (o.mapping = t),
  51276. o
  51277. },
  51278. loadTextureCube: function(e, t, i, n) {
  51279. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  51280. var r = new Ci.CubeTextureLoader;
  51281. r.setCrossOrigin(this.crossOrigin);
  51282. var o = r.load(e, i, void 0, n);
  51283. return t && (o.mapping = t),
  51284. o
  51285. },
  51286. loadCompressedTexture: function() {
  51287. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  51288. },
  51289. loadCompressedTextureCube: function() {
  51290. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  51291. }
  51292. },
  51293. Ci.Projector = function() {
  51294. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  51295. this.projectVector = function(e, t) {
  51296. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  51297. e.project(t)
  51298. }
  51299. ,
  51300. this.unprojectVector = function(e, t) {
  51301. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  51302. e.unproject(t)
  51303. }
  51304. ,
  51305. this.pickingRay = function(e, t) {
  51306. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  51307. }
  51308. }
  51309. ,
  51310. Ci.CanvasRenderer = function() {
  51311. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  51312. this.domElement = document.createElement("canvas"),
  51313. this.clear = function() {}
  51314. ,
  51315. this.render = function() {}
  51316. ,
  51317. this.setClearColor = function() {}
  51318. ,
  51319. this.setSize = function() {}
  51320. }
  51321. ,
  51322. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  51323. Ci.CurveUtils = {
  51324. tangentQuadraticBezier: function(e, t, i, n) {
  51325. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  51326. },
  51327. tangentCubicBezier: function(e, t, i, n, r) {
  51328. 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
  51329. },
  51330. tangentSpline: function(e, t, i, n, r) {
  51331. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  51332. },
  51333. interpolate: function(e, t, i, n, r) {
  51334. var o = .5 * (i - e)
  51335. , a = .5 * (n - t)
  51336. , s = r * r;
  51337. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  51338. }
  51339. },
  51340. Ci.SceneUtils = {
  51341. createMultiMaterialObject: function(e, t) {
  51342. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  51343. i.add(new Ci.Mesh(e,t[n]));
  51344. return i
  51345. },
  51346. detach: function(e, t, i) {
  51347. e.applyMatrix(t.matrixWorld),
  51348. t.remove(e),
  51349. i.add(e)
  51350. },
  51351. attach: function(e, t, i) {
  51352. var n = new Ci.Matrix4;
  51353. n.getInverse(i.matrixWorld),
  51354. e.applyMatrix(n),
  51355. t.remove(e),
  51356. i.add(e)
  51357. }
  51358. },
  51359. Ci.ShapeUtils = {
  51360. area: function(e) {
  51361. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  51362. i += e[n].x * e[r].y - e[r].x * e[n].y;
  51363. return .5 * i
  51364. },
  51365. triangulate: function(e, t) {
  51366. var i = e.length;
  51367. if (i < 3)
  51368. return null;
  51369. var n, r, o, a = [], s = [], l = [];
  51370. if (0 < Ci.ShapeUtils.area(e))
  51371. for (r = 0; r < i; r++)
  51372. s[r] = r;
  51373. else
  51374. for (r = 0; r < i; r++)
  51375. s[r] = i - 1 - r;
  51376. var c = i
  51377. , h = 2 * c;
  51378. for (r = c - 1; 2 < c; ) {
  51379. if (h-- <= 0)
  51380. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  51381. t ? l : a;
  51382. if (c <= (n = r) && (n = 0),
  51383. c <= (r = n + 1) && (r = 0),
  51384. c <= (o = r + 1) && (o = 0),
  51385. Si(e, n, r, o, c, s)) {
  51386. var u, d, p, f, g;
  51387. for (u = s[n],
  51388. d = s[r],
  51389. p = s[o],
  51390. a.push([e[u], e[d], e[p]]),
  51391. l.push([s[n], s[r], s[o]]),
  51392. g = (f = r) + 1; g < c; f++,
  51393. g++)
  51394. s[f] = s[g];
  51395. h = 2 * --c
  51396. }
  51397. }
  51398. return t ? l : a
  51399. },
  51400. triangulateShape: function(e, t) {
  51401. function w(e, t, i) {
  51402. 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
  51403. }
  51404. function b(e, t, i, n, r) {
  51405. var o = t.x - e.x
  51406. , a = t.y - e.y
  51407. , s = n.x - i.x
  51408. , l = n.y - i.y
  51409. , c = e.x - i.x
  51410. , h = e.y - i.y
  51411. , u = a * s - o * l
  51412. , d = a * c - o * h;
  51413. if (Math.abs(u) > Number.EPSILON) {
  51414. var p;
  51415. if (0 < u) {
  51416. if (d < 0 || u < d)
  51417. return [];
  51418. if ((p = l * c - s * h) < 0 || u < p)
  51419. return []
  51420. } else {
  51421. if (0 < d || d < u)
  51422. return [];
  51423. if (0 < (p = l * c - s * h) || p < u)
  51424. return []
  51425. }
  51426. if (0 === p)
  51427. return !r || 0 != d && d != u ? [e] : [];
  51428. if (p === u)
  51429. return !r || 0 != d && d != u ? [t] : [];
  51430. if (0 == d)
  51431. return [i];
  51432. if (d == u)
  51433. return [n];
  51434. var f = p / u;
  51435. return [{
  51436. x: e.x + f * o,
  51437. y: e.y + f * a
  51438. }]
  51439. }
  51440. if (0 != d || l * c != s * h)
  51441. return [];
  51442. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  51443. 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,
  51444. (m = t).x) : (v = (g = t).x,
  51445. (m = e).x),
  51446. i.x < n.x ? (I = (A = i).x,
  51447. (C = n).x) : (I = (A = n).x,
  51448. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  51449. (m = t).y) : (v = (g = t).y,
  51450. (m = e).y),
  51451. i.y < n.y ? (I = (A = i).y,
  51452. (C = n).y) : (I = (A = n).y,
  51453. (C = i).y)),
  51454. 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])
  51455. }
  51456. function T(e, t, i, n) {
  51457. var r = t.x - e.x
  51458. , o = t.y - e.y
  51459. , a = i.x - e.x
  51460. , s = i.y - e.y
  51461. , l = n.x - e.x
  51462. , c = n.y - e.y
  51463. , h = r * s - o * a
  51464. , u = r * c - o * l;
  51465. if (Math.abs(h) > Number.EPSILON) {
  51466. var d = l * s - c * a;
  51467. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  51468. }
  51469. return 0 < u
  51470. }
  51471. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  51472. Array.prototype.push.apply(c, t[h]);
  51473. for (i = 0,
  51474. n = c.length; i < n; i++)
  51475. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  51476. l[a] = i;
  51477. var d = function(e, a) {
  51478. function t(e, t) {
  51479. var i = m.length - 1
  51480. , n = e - 1;
  51481. n < 0 && (n = i);
  51482. var r = e + 1;
  51483. i < r && (r = 0);
  51484. var o = T(m[e], m[n], m[r], c[t]);
  51485. if (!o)
  51486. return !1;
  51487. var a = c.length - 1
  51488. , s = t - 1;
  51489. s < 0 && (s = a);
  51490. var l = t + 1;
  51491. return a < l && (l = 0),
  51492. !!(o = T(c[t], c[s], c[l], m[e]))
  51493. }
  51494. function i(e, t) {
  51495. var i, n;
  51496. for (i = 0; i < m.length; i++)
  51497. if (n = i + 1,
  51498. n %= m.length,
  51499. 0 < b(e, t, m[i], m[n], !0).length)
  51500. return !0;
  51501. return !1
  51502. }
  51503. function n(e, t) {
  51504. var i, n, r, o;
  51505. for (i = 0; i < v.length; i++)
  51506. for (n = a[v[i]],
  51507. r = 0; r < n.length; r++)
  51508. if (o = r + 1,
  51509. o %= n.length,
  51510. 0 < b(e, t, n[r], n[o], !0).length)
  51511. return !0;
  51512. return !1
  51513. }
  51514. 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++)
  51515. v.push(A);
  51516. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  51517. if (--E < 0) {
  51518. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  51519. break
  51520. }
  51521. for (o = I; o < m.length; o++) {
  51522. s = m[o],
  51523. r = -1;
  51524. for (A = 0; A < v.length; A++)
  51525. if (h = v[A],
  51526. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  51527. c = a[h];
  51528. for (var _ = 0; _ < c.length; _++)
  51529. if (l = c[_],
  51530. t(o, _) && !i(s, l) && !n(s, l)) {
  51531. r = _,
  51532. v.splice(A, 1),
  51533. d = m.slice(0, o + 1),
  51534. p = m.slice(o),
  51535. f = c.slice(r),
  51536. g = c.slice(0, r + 1),
  51537. m = d.concat(f).concat(g).concat(p),
  51538. I = o;
  51539. break
  51540. }
  51541. if (0 <= r)
  51542. break;
  51543. y[u] = !0
  51544. }
  51545. if (0 <= r)
  51546. break
  51547. }
  51548. }
  51549. return m
  51550. }(e, t)
  51551. , p = Ci.ShapeUtils.triangulate(d, !1);
  51552. for (i = 0,
  51553. n = p.length; i < n; i++)
  51554. for (o = p[i],
  51555. r = 0; r < 3; r++)
  51556. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  51557. return p.concat()
  51558. },
  51559. isClockWise: function(e) {
  51560. return Ci.ShapeUtils.area(e) < 0
  51561. },
  51562. b2: function(e, t, i, n) {
  51563. return function(e, t) {
  51564. var i = 1 - e;
  51565. return i * i * t
  51566. }(e, t) + function(e, t) {
  51567. return 2 * (1 - e) * e * t
  51568. }(e, i) + function(e, t) {
  51569. return e * e * t
  51570. }(e, n)
  51571. },
  51572. b3: function(e, t, i, n, r) {
  51573. return function(e, t) {
  51574. var i = 1 - e;
  51575. return i * i * i * t
  51576. }(e, t) + function(e, t) {
  51577. var i = 1 - e;
  51578. return 3 * i * i * e * t
  51579. }(e, i) + function(e, t) {
  51580. return 3 * (1 - e) * e * e * t
  51581. }(e, n) + function(e, t) {
  51582. return e * e * e * t
  51583. }(e, r)
  51584. }
  51585. },
  51586. Ci.Curve = function() {}
  51587. ,
  51588. Ci.Curve.prototype = {
  51589. constructor: Ci.Curve,
  51590. getPoint: function(e) {
  51591. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  51592. null
  51593. },
  51594. getPointAt: function(e) {
  51595. var t = this.getUtoTmapping(e);
  51596. return this.getPoint(t)
  51597. },
  51598. getPoints: function(e) {
  51599. e = e || 5;
  51600. var t, i = [];
  51601. for (t = 0; t <= e; t++)
  51602. i.push(this.getPoint(t / e));
  51603. return i
  51604. },
  51605. getSpacedPoints: function(e) {
  51606. e = e || 5;
  51607. var t, i = [];
  51608. for (t = 0; t <= e; t++)
  51609. i.push(this.getPointAt(t / e));
  51610. return i
  51611. },
  51612. getLength: function() {
  51613. var e = this.getLengths();
  51614. return e[e.length - 1]
  51615. },
  51616. getLengths: function(e) {
  51617. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  51618. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  51619. return this.cacheArcLengths;
  51620. this.needsUpdate = !1;
  51621. var t, i, n = [], r = this.getPoint(0), o = 0;
  51622. for (n.push(0),
  51623. i = 1; i <= e; i++)
  51624. o += (t = this.getPoint(i / e)).distanceTo(r),
  51625. n.push(o),
  51626. r = t;
  51627. return this.cacheArcLengths = n
  51628. },
  51629. updateArcLengths: function() {
  51630. this.needsUpdate = !0,
  51631. this.getLengths()
  51632. },
  51633. getUtoTmapping: function(e, t) {
  51634. var i, n = this.getLengths(), r = 0, o = n.length;
  51635. i = t || e * n[o - 1];
  51636. for (var a, s = 0, l = o - 1; s <= l; )
  51637. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  51638. s = r + 1;
  51639. else {
  51640. if (!(0 < a)) {
  51641. l = r;
  51642. break
  51643. }
  51644. l = r - 1
  51645. }
  51646. if (n[r = l] === i)
  51647. return r / (o - 1);
  51648. var c = n[r];
  51649. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  51650. },
  51651. getTangent: function(e) {
  51652. var t = e - 1e-4
  51653. , i = e + 1e-4;
  51654. t < 0 && (t = 0),
  51655. 1 < i && (i = 1);
  51656. var n = this.getPoint(t);
  51657. return this.getPoint(i).clone().sub(n).normalize()
  51658. },
  51659. getTangentAt: function(e) {
  51660. var t = this.getUtoTmapping(e);
  51661. return this.getTangent(t)
  51662. }
  51663. },
  51664. Ci.Curve.create = function(e, t) {
  51665. return e.prototype = Object.create(Ci.Curve.prototype),
  51666. (e.prototype.constructor = e).prototype.getPoint = t,
  51667. e
  51668. }
  51669. ,
  51670. Ci.CurvePath = function() {
  51671. this.curves = [],
  51672. this.autoClose = !1
  51673. }
  51674. ,
  51675. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  51676. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  51677. Ci.CurvePath.prototype.add = function(e) {
  51678. this.curves.push(e)
  51679. }
  51680. ,
  51681. Ci.CurvePath.prototype.closePath = function() {
  51682. var e = this.curves[0].getPoint(0)
  51683. , t = this.curves[this.curves.length - 1].getPoint(1);
  51684. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  51685. }
  51686. ,
  51687. Ci.CurvePath.prototype.getPoint = function(e) {
  51688. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  51689. if (i[n] >= t) {
  51690. var r = i[n] - t
  51691. , o = this.curves[n]
  51692. , a = 1 - r / o.getLength();
  51693. return o.getPointAt(a)
  51694. }
  51695. n++
  51696. }
  51697. return null
  51698. }
  51699. ,
  51700. Ci.CurvePath.prototype.getLength = function() {
  51701. var e = this.getCurveLengths();
  51702. return e[e.length - 1]
  51703. }
  51704. ,
  51705. Ci.CurvePath.prototype.getCurveLengths = function() {
  51706. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  51707. return this.cacheLengths;
  51708. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  51709. t += this.curves[i].getLength(),
  51710. e.push(t);
  51711. return this.cacheLengths = e
  51712. }
  51713. ,
  51714. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  51715. var t = this.getPoints(e);
  51716. return this.createGeometry(t)
  51717. }
  51718. ,
  51719. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  51720. var t = this.getSpacedPoints(e);
  51721. return this.createGeometry(t)
  51722. }
  51723. ,
  51724. Ci.CurvePath.prototype.createGeometry = function(e) {
  51725. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  51726. var r = e[i];
  51727. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  51728. }
  51729. return t
  51730. }
  51731. ,
  51732. Ci.Font = function(e) {
  51733. this.data = e
  51734. }
  51735. ,
  51736. Ci.Font.prototype = {
  51737. constructor: Ci.Font,
  51738. generateShapes: function(e, s, b) {
  51739. function l(e, t, i) {
  51740. var n = w.glyphs[e] || w.glyphs["?"];
  51741. if (n) {
  51742. 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;
  51743. if (n.o)
  51744. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  51745. switch (A[C++]) {
  51746. case "m":
  51747. r = A[C++] * t + i,
  51748. o = A[C++] * t,
  51749. g.moveTo(r, o);
  51750. break;
  51751. case "l":
  51752. r = A[C++] * t + i,
  51753. o = A[C++] * t,
  51754. g.lineTo(r, o);
  51755. break;
  51756. case "q":
  51757. if (a = A[C++] * t + i,
  51758. s = A[C++] * t,
  51759. h = A[C++] * t + i,
  51760. u = A[C++] * t,
  51761. g.quadraticCurveTo(h, u, a, s),
  51762. f = m[m.length - 1]) {
  51763. l = f.x,
  51764. c = f.y;
  51765. for (var E = 1; E <= b; E++) {
  51766. v(_ = E / b, l, h, a),
  51767. v(_, c, u, s)
  51768. }
  51769. }
  51770. break;
  51771. case "b":
  51772. if (a = A[C++] * t + i,
  51773. s = A[C++] * t,
  51774. h = A[C++] * t + i,
  51775. u = A[C++] * t,
  51776. d = A[C++] * t + i,
  51777. p = A[C++] * t,
  51778. g.bezierCurveTo(h, u, d, p, a, s),
  51779. f = m[m.length - 1]) {
  51780. l = f.x,
  51781. c = f.y;
  51782. for (E = 1; E <= b; E++) {
  51783. var _;
  51784. y(_ = E / b, l, h, d, a),
  51785. y(_, c, u, p, s)
  51786. }
  51787. }
  51788. }
  51789. }
  51790. return {
  51791. offset: n.ha * t,
  51792. path: g
  51793. }
  51794. }
  51795. }
  51796. void 0 === s && (s = 100),
  51797. void 0 === b && (b = 4);
  51798. for (var w = this.data, t = function(e) {
  51799. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  51800. var a = l(t[o], i, n);
  51801. n += a.offset,
  51802. r.push(a.path)
  51803. }
  51804. return r
  51805. }(e), i = [], n = 0, r = t.length; n < r; n++)
  51806. Array.prototype.push.apply(i, t[n].toShapes());
  51807. return i
  51808. }
  51809. },
  51810. Ci.Path = function(e) {
  51811. Ci.CurvePath.call(this),
  51812. this.actions = [],
  51813. e && this.fromPoints(e)
  51814. }
  51815. ,
  51816. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  51817. Ci.Path.prototype.constructor = Ci.Path,
  51818. Ci.Path.prototype.fromPoints = function(e) {
  51819. this.moveTo(e[0].x, e[0].y);
  51820. for (var t = 1, i = e.length; t < i; t++)
  51821. this.lineTo(e[t].x, e[t].y)
  51822. }
  51823. ,
  51824. Ci.Path.prototype.moveTo = function(e, t) {
  51825. this.actions.push({
  51826. action: "moveTo",
  51827. args: [e, t]
  51828. })
  51829. }
  51830. ,
  51831. Ci.Path.prototype.lineTo = function(e, t) {
  51832. var i = this.actions[this.actions.length - 1].args
  51833. , n = i[i.length - 2]
  51834. , r = i[i.length - 1]
  51835. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  51836. this.curves.push(o),
  51837. this.actions.push({
  51838. action: "lineTo",
  51839. args: [e, t]
  51840. })
  51841. }
  51842. ,
  51843. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  51844. var r = this.actions[this.actions.length - 1].args
  51845. , o = r[r.length - 2]
  51846. , a = r[r.length - 1]
  51847. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  51848. this.curves.push(s),
  51849. this.actions.push({
  51850. action: "quadraticCurveTo",
  51851. args: [e, t, i, n]
  51852. })
  51853. }
  51854. ,
  51855. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  51856. var a = this.actions[this.actions.length - 1].args
  51857. , s = a[a.length - 2]
  51858. , l = a[a.length - 1]
  51859. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  51860. this.curves.push(c),
  51861. this.actions.push({
  51862. action: "bezierCurveTo",
  51863. args: [e, t, i, n, r, o]
  51864. })
  51865. }
  51866. ,
  51867. Ci.Path.prototype.splineThru = function(e) {
  51868. var t = Array.prototype.slice.call(arguments)
  51869. , i = this.actions[this.actions.length - 1].args
  51870. , n = i[i.length - 2]
  51871. , r = i[i.length - 1]
  51872. , o = [new Ci.Vector2(n,r)];
  51873. Array.prototype.push.apply(o, e);
  51874. var a = new Ci.SplineCurve(o);
  51875. this.curves.push(a),
  51876. this.actions.push({
  51877. action: "splineThru",
  51878. args: t
  51879. })
  51880. }
  51881. ,
  51882. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  51883. var a = this.actions[this.actions.length - 1].args
  51884. , s = a[a.length - 2]
  51885. , l = a[a.length - 1];
  51886. this.absarc(e + s, t + l, i, n, r, o)
  51887. }
  51888. ,
  51889. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  51890. this.absellipse(e, t, i, i, n, r, o)
  51891. }
  51892. ,
  51893. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  51894. var l = this.actions[this.actions.length - 1].args
  51895. , c = l[l.length - 2]
  51896. , h = l[l.length - 1];
  51897. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  51898. }
  51899. ,
  51900. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  51901. var l = [e, t, i, n, r, o, a, s || 0]
  51902. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  51903. this.curves.push(c);
  51904. var h = c.getPoint(1);
  51905. l.push(h.x),
  51906. l.push(h.y),
  51907. this.actions.push({
  51908. action: "ellipse",
  51909. args: l
  51910. })
  51911. }
  51912. ,
  51913. Ci.Path.prototype.getSpacedPoints = function(e) {
  51914. e = e || 40;
  51915. for (var t = [], i = 0; i < e; i++)
  51916. t.push(this.getPoint(i / e));
  51917. return this.autoClose && t.push(t[0]),
  51918. t
  51919. }
  51920. ,
  51921. Ci.Path.prototype.getPoints = function(e) {
  51922. e = e || 12;
  51923. 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++) {
  51924. var v = this.actions[g]
  51925. , y = v.action
  51926. , A = v.args;
  51927. switch (y) {
  51928. case "moveTo":
  51929. case "lineTo":
  51930. f.push(new Ci.Vector2(A[0],A[1]));
  51931. break;
  51932. case "quadraticCurveTo":
  51933. t = A[2],
  51934. i = A[3],
  51935. o = A[0],
  51936. a = A[1],
  51937. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  51938. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  51939. c[c.length - 1]);
  51940. for (var C = 1; C <= e; C++) {
  51941. h = d(O = C / e, s, o, t),
  51942. u = d(O, l, a, i),
  51943. f.push(new Ci.Vector2(h,u))
  51944. }
  51945. break;
  51946. case "bezierCurveTo":
  51947. t = A[4],
  51948. i = A[5],
  51949. o = A[0],
  51950. a = A[1],
  51951. n = A[2],
  51952. r = A[3],
  51953. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  51954. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  51955. c[c.length - 1]);
  51956. for (C = 1; C <= e; C++) {
  51957. h = p(O = C / e, s, o, n, t),
  51958. u = p(O, l, a, r, i),
  51959. f.push(new Ci.Vector2(h,u))
  51960. }
  51961. break;
  51962. case "splineThru":
  51963. c = this.actions[g - 1].args;
  51964. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  51965. , E = e * A[0].length;
  51966. I = I.concat(A[0]);
  51967. var _ = new Ci.SplineCurve(I);
  51968. for (C = 1; C <= E; C++)
  51969. f.push(_.getPointAt(C / E));
  51970. break;
  51971. case "arc":
  51972. var b = A[0]
  51973. , w = A[1]
  51974. , T = A[2]
  51975. , x = A[3]
  51976. , S = A[4]
  51977. , M = !!A[5]
  51978. , R = S - x
  51979. , P = 2 * e;
  51980. for (C = 1; C <= P; C++) {
  51981. var O = C / P;
  51982. M || (O = 1 - O),
  51983. L = x + O * R,
  51984. h = b + T * Math.cos(L),
  51985. u = w + T * Math.sin(L),
  51986. f.push(new Ci.Vector2(h,u))
  51987. }
  51988. break;
  51989. case "ellipse":
  51990. b = A[0],
  51991. w = A[1];
  51992. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  51993. S = A[5],
  51994. M = !!A[6],
  51995. A[7]);
  51996. R = S - x,
  51997. P = 2 * e;
  51998. 0 !== V && (D = Math.cos(V),
  51999. N = Math.sin(V));
  52000. for (C = 1; C <= P; C++) {
  52001. O = C / P;
  52002. if (M || (O = 1 - O),
  52003. L = x + O * R,
  52004. h = b + F * Math.cos(L),
  52005. u = w + B * Math.sin(L),
  52006. 0 !== V) {
  52007. var k = h;
  52008. h = (k - b) * D - (u - w) * N + b,
  52009. u = (k - b) * N + (u - w) * D + w
  52010. }
  52011. f.push(new Ci.Vector2(h,u))
  52012. }
  52013. }
  52014. }
  52015. var U = f[f.length - 1];
  52016. 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),
  52017. this.autoClose && f.push(f[0]),
  52018. f
  52019. }
  52020. ,
  52021. Ci.Path.prototype.toShapes = function(e, t) {
  52022. function i(e) {
  52023. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52024. var r = e[i]
  52025. , o = new Ci.Shape;
  52026. o.actions = r.actions,
  52027. o.curves = r.curves,
  52028. t.push(o)
  52029. }
  52030. return t
  52031. }
  52032. function n(e, t) {
  52033. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52034. var a = t[r]
  52035. , s = t[o]
  52036. , l = s.x - a.x
  52037. , c = s.y - a.y;
  52038. if (Math.abs(c) > Number.EPSILON) {
  52039. if (c < 0 && (a = t[o],
  52040. l = -l,
  52041. s = t[r],
  52042. c = -c),
  52043. e.y < a.y || e.y > s.y)
  52044. continue;
  52045. if (e.y === a.y) {
  52046. if (e.x === a.x)
  52047. return !0
  52048. } else {
  52049. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52050. if (0 == h)
  52051. return !0;
  52052. if (h < 0)
  52053. continue;
  52054. n = !n
  52055. }
  52056. } else {
  52057. if (e.y !== a.y)
  52058. continue;
  52059. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52060. return !0
  52061. }
  52062. }
  52063. return n
  52064. }
  52065. var r = Ci.ShapeUtils.isClockWise
  52066. , o = function(e) {
  52067. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  52068. var o = e[n]
  52069. , a = o.args
  52070. , s = o.action;
  52071. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  52072. i = new Ci.Path),
  52073. i[s].apply(i, a)
  52074. }
  52075. return 0 !== i.actions.length && t.push(i),
  52076. t
  52077. }(this.actions);
  52078. if (0 === o.length)
  52079. return [];
  52080. if (!0 === t)
  52081. return i(o);
  52082. var a, s, l, c = [];
  52083. if (1 === o.length)
  52084. return s = o[0],
  52085. (l = new Ci.Shape).actions = s.actions,
  52086. l.curves = s.curves,
  52087. c.push(l),
  52088. c;
  52089. var h = !r(o[0].getPoints());
  52090. h = e ? !h : h;
  52091. var u, d = [], p = [], f = [], g = 0;
  52092. p[g] = void 0,
  52093. f[g] = [];
  52094. for (var m = 0, v = o.length; m < v; m++)
  52095. a = r(u = (s = o[m]).getPoints()),
  52096. (a = e ? !a : a) ? (!h && p[g] && g++,
  52097. p[g] = {
  52098. s: new Ci.Shape,
  52099. p: u
  52100. },
  52101. p[g].s.actions = s.actions,
  52102. p[g].s.curves = s.curves,
  52103. h && g++,
  52104. f[g] = []) : f[g].push({
  52105. h: s,
  52106. p: u[0]
  52107. });
  52108. if (!p[0])
  52109. return i(o);
  52110. if (1 < p.length) {
  52111. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  52112. d[C] = [];
  52113. for (C = 0,
  52114. I = p.length; C < I; C++)
  52115. for (var E = f[C], _ = 0; _ < E.length; _++) {
  52116. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  52117. n(b.p, p[T].p) && (C !== T && A.push({
  52118. froms: C,
  52119. tos: T,
  52120. hole: _
  52121. }),
  52122. w ? (w = !1,
  52123. d[T].push(b)) : y = !0);
  52124. w && d[C].push(b)
  52125. }
  52126. 0 < A.length && (y || (f = d))
  52127. }
  52128. m = 0;
  52129. for (var x, S = p.length; m < S; m++) {
  52130. l = p[m].s,
  52131. c.push(l);
  52132. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  52133. l.holes.push(x[M].h)
  52134. }
  52135. return c
  52136. }
  52137. ,
  52138. Ci.Shape = function() {
  52139. Ci.Path.apply(this, arguments),
  52140. this.holes = []
  52141. }
  52142. ,
  52143. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  52144. Ci.Shape.prototype.constructor = Ci.Shape,
  52145. Ci.Shape.prototype.extrude = function(e) {
  52146. return new Ci.ExtrudeGeometry(this,e)
  52147. }
  52148. ,
  52149. Ci.Shape.prototype.makeGeometry = function(e) {
  52150. return new Ci.ShapeGeometry(this,e)
  52151. }
  52152. ,
  52153. Ci.Shape.prototype.getPointsHoles = function(e) {
  52154. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  52155. t[i] = this.holes[i].getPoints(e);
  52156. return t
  52157. }
  52158. ,
  52159. Ci.Shape.prototype.extractAllPoints = function(e) {
  52160. return {
  52161. shape: this.getPoints(e),
  52162. holes: this.getPointsHoles(e)
  52163. }
  52164. }
  52165. ,
  52166. Ci.Shape.prototype.extractPoints = function(e) {
  52167. return this.extractAllPoints(e)
  52168. }
  52169. ,
  52170. Ci.LineCurve = function(e, t) {
  52171. this.v1 = e,
  52172. this.v2 = t
  52173. }
  52174. ,
  52175. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  52176. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  52177. Ci.LineCurve.prototype.getPoint = function(e) {
  52178. var t = this.v2.clone().sub(this.v1);
  52179. return t.multiplyScalar(e).add(this.v1),
  52180. t
  52181. }
  52182. ,
  52183. Ci.LineCurve.prototype.getPointAt = function(e) {
  52184. return this.getPoint(e)
  52185. }
  52186. ,
  52187. Ci.LineCurve.prototype.getTangent = function(e) {
  52188. return this.v2.clone().sub(this.v1).normalize()
  52189. }
  52190. ,
  52191. Ci.QuadraticBezierCurve = function(e, t, i) {
  52192. this.v0 = e,
  52193. this.v1 = t,
  52194. this.v2 = i
  52195. }
  52196. ,
  52197. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52198. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  52199. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  52200. var t = Ci.ShapeUtils.b2;
  52201. 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))
  52202. }
  52203. ,
  52204. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  52205. var t = Ci.CurveUtils.tangentQuadraticBezier;
  52206. 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()
  52207. }
  52208. ,
  52209. Ci.CubicBezierCurve = function(e, t, i, n) {
  52210. this.v0 = e,
  52211. this.v1 = t,
  52212. this.v2 = i,
  52213. this.v3 = n
  52214. }
  52215. ,
  52216. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52217. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  52218. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  52219. var t = Ci.ShapeUtils.b3;
  52220. 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))
  52221. }
  52222. ,
  52223. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  52224. var t = Ci.CurveUtils.tangentCubicBezier;
  52225. 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()
  52226. }
  52227. ,
  52228. Ci.SplineCurve = function(e) {
  52229. this.points = null == e ? [] : e
  52230. }
  52231. ,
  52232. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  52233. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  52234. Ci.SplineCurve.prototype.getPoint = function(e) {
  52235. var t = this.points
  52236. , i = (t.length - 1) * e
  52237. , n = Math.floor(i)
  52238. , r = i - n
  52239. , o = t[0 === n ? n : n - 1]
  52240. , a = t[n]
  52241. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52242. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52243. , c = Ci.CurveUtils.interpolate;
  52244. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  52245. }
  52246. ,
  52247. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  52248. this.aX = e,
  52249. this.aY = t,
  52250. this.xRadius = i,
  52251. this.yRadius = n,
  52252. this.aStartAngle = r,
  52253. this.aEndAngle = o,
  52254. this.aClockwise = a,
  52255. this.aRotation = s || 0
  52256. }
  52257. ,
  52258. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  52259. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  52260. Ci.EllipseCurve.prototype.getPoint = function(e) {
  52261. var t, i = this.aEndAngle - this.aStartAngle;
  52262. i < 0 && (i += 2 * Math.PI),
  52263. i > 2 * Math.PI && (i -= 2 * Math.PI),
  52264. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  52265. var n = this.aX + this.xRadius * Math.cos(t)
  52266. , r = this.aY + this.yRadius * Math.sin(t);
  52267. if (0 !== this.aRotation) {
  52268. var o = Math.cos(this.aRotation)
  52269. , a = Math.sin(this.aRotation)
  52270. , s = n
  52271. , l = r;
  52272. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  52273. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  52274. }
  52275. return new Ci.Vector2(n,r)
  52276. }
  52277. ,
  52278. Ci.ArcCurve = function(e, t, i, n, r, o) {
  52279. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  52280. }
  52281. ,
  52282. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  52283. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  52284. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  52285. this.v1 = e,
  52286. this.v2 = t
  52287. }, function(e) {
  52288. var t = new Ci.Vector3;
  52289. return t.subVectors(this.v2, this.v1),
  52290. t.multiplyScalar(e),
  52291. t.add(this.v1),
  52292. t
  52293. }),
  52294. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  52295. this.v0 = e,
  52296. this.v1 = t,
  52297. this.v2 = i
  52298. }, function(e) {
  52299. var t = Ci.ShapeUtils.b2;
  52300. 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))
  52301. }),
  52302. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  52303. this.v0 = e,
  52304. this.v1 = t,
  52305. this.v2 = i,
  52306. this.v3 = n
  52307. }, function(e) {
  52308. var t = Ci.ShapeUtils.b3;
  52309. 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))
  52310. }),
  52311. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  52312. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  52313. this.points = null == e ? [] : e
  52314. }, function(e) {
  52315. var t = this.points
  52316. , i = (t.length - 1) * e
  52317. , n = Math.floor(i)
  52318. , r = i - n
  52319. , o = t[0 == n ? n : n - 1]
  52320. , a = t[n]
  52321. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52322. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52323. , c = Ci.CurveUtils.interpolate;
  52324. 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))
  52325. }),
  52326. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  52327. Xt = new xi,
  52328. Zt = new xi,
  52329. Kt = new xi,
  52330. xi.prototype.init = function(e, t, i, n) {
  52331. this.c0 = e,
  52332. this.c1 = i,
  52333. this.c2 = -3 * e + 3 * t - 2 * i - n,
  52334. this.c3 = 2 * e - 2 * t + i + n
  52335. }
  52336. ,
  52337. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  52338. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  52339. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  52340. s *= o,
  52341. l *= o,
  52342. this.init(t, i, s, l)
  52343. }
  52344. ,
  52345. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  52346. this.init(t, i, r * (i - e), r * (n - t))
  52347. }
  52348. ,
  52349. xi.prototype.calc = function(e) {
  52350. var t = e * e
  52351. , i = t * e;
  52352. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  52353. }
  52354. ,
  52355. Ci.Curve.create(function(e) {
  52356. this.points = e || [],
  52357. this.closed = !1
  52358. }, function(e) {
  52359. var t, i, n, r, o, a, s, l, c = this.points;
  52360. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  52361. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  52362. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  52363. n = 1),
  52364. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  52365. qt),
  52366. a = c[i % r],
  52367. s = c[(i + 1) % r],
  52368. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  52369. qt),
  52370. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  52371. var h = "chordal" === this.type ? .5 : .25
  52372. , u = Math.pow(o.distanceToSquared(a), h)
  52373. , d = Math.pow(a.distanceToSquared(s), h)
  52374. , p = Math.pow(s.distanceToSquared(l), h);
  52375. d < 1e-4 && (d = 1),
  52376. u < 1e-4 && (u = d),
  52377. p < 1e-4 && (p = d),
  52378. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  52379. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  52380. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  52381. } else if ("catmullrom" === this.type) {
  52382. var f = void 0 !== this.tension ? this.tension : .5;
  52383. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  52384. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  52385. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  52386. }
  52387. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  52388. })),
  52389. Ci.ClosedSplineCurve3 = function(e) {
  52390. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  52391. Ci.CatmullRomCurve3.call(this, e),
  52392. this.type = "catmullrom",
  52393. this.closed = !0
  52394. }
  52395. ,
  52396. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  52397. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  52398. Ci.Geometry.call(this),
  52399. this.type = "BoxGeometry",
  52400. this.parameters = {
  52401. width: e,
  52402. height: t,
  52403. depth: i,
  52404. widthSegments: n,
  52405. heightSegments: r,
  52406. depthSegments: o
  52407. },
  52408. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  52409. this.mergeVertices()
  52410. }
  52411. ,
  52412. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52413. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  52414. Ci.CubeGeometry = Ci.BoxGeometry,
  52415. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  52416. function a(e, t, i, n, r, o, a, s, l, c, h) {
  52417. 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++)
  52418. for (var E = I * d - f, _ = 0; _ < m; _++) {
  52419. var b = _ * u - p;
  52420. C[e] = b * n,
  52421. C[t] = E * r,
  52422. C[i] = g,
  52423. P[D] = C.x,
  52424. P[D + 1] = C.y,
  52425. P[D + 2] = C.z,
  52426. C[e] = 0,
  52427. C[t] = 0,
  52428. C[i] = 0 < s ? 1 : -1,
  52429. O[D] = C.x,
  52430. O[D + 1] = C.y,
  52431. O[D + 2] = C.z,
  52432. L[N] = _ / l,
  52433. L[N + 1] = 1 - I / c,
  52434. D += 3,
  52435. N += 2,
  52436. y += 1
  52437. }
  52438. for (I = 0; I < c; I++)
  52439. for (_ = 0; _ < l; _++) {
  52440. var w = B + _ + m * I
  52441. , T = B + _ + m * (I + 1)
  52442. , x = B + (_ + 1) + m * (I + 1)
  52443. , S = B + (_ + 1) + m * I;
  52444. R[F] = w,
  52445. R[F + 1] = T,
  52446. R[F + 2] = S,
  52447. R[F + 3] = T,
  52448. R[F + 4] = x,
  52449. R[F + 5] = S,
  52450. F += 6,
  52451. A += 6
  52452. }
  52453. M.addGroup(V, A, h),
  52454. V += A,
  52455. B += y
  52456. }
  52457. Ci.BufferGeometry.call(this),
  52458. this.type = "BoxBufferGeometry",
  52459. this.parameters = {
  52460. width: e,
  52461. height: t,
  52462. depth: i,
  52463. widthSegments: n,
  52464. heightSegments: r,
  52465. depthSegments: o
  52466. };
  52467. var M = this;
  52468. n = Math.floor(n) || 1,
  52469. r = Math.floor(r) || 1,
  52470. o = Math.floor(o) || 1;
  52471. var s, l, c, h, u = (h = 0,
  52472. h += (s = n) * (l = r) * 2,
  52473. h += s * (c = o) * 2,
  52474. 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;
  52475. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  52476. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  52477. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  52478. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  52479. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  52480. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  52481. this.setIndex(new Ci.BufferAttribute(R,1)),
  52482. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  52483. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  52484. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  52485. }
  52486. ,
  52487. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52488. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  52489. Ci.CircleGeometry = function(e, t, i, n) {
  52490. Ci.Geometry.call(this),
  52491. this.type = "CircleGeometry",
  52492. this.parameters = {
  52493. radius: e,
  52494. segments: t,
  52495. thetaStart: i,
  52496. thetaLength: n
  52497. },
  52498. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  52499. }
  52500. ,
  52501. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52502. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  52503. Ci.CircleBufferGeometry = function(e, t, i, n) {
  52504. Ci.BufferGeometry.call(this),
  52505. this.type = "CircleBufferGeometry",
  52506. this.parameters = {
  52507. radius: e,
  52508. segments: t,
  52509. thetaStart: i,
  52510. thetaLength: n
  52511. },
  52512. e = e || 50,
  52513. t = void 0 !== t ? Math.max(3, t) : 8,
  52514. i = void 0 !== i ? i : 0,
  52515. n = void 0 !== n ? n : 2 * Math.PI;
  52516. var r = t + 2
  52517. , o = new Float32Array(3 * r)
  52518. , a = new Float32Array(3 * r)
  52519. , s = new Float32Array(2 * r);
  52520. a[2] = 1,
  52521. s[0] = .5,
  52522. s[1] = .5;
  52523. for (var l = 0, c = 3, h = 2; l <= t; l++,
  52524. c += 3,
  52525. h += 2) {
  52526. var u = i + l / t * n;
  52527. o[c] = e * Math.cos(u),
  52528. o[c + 1] = e * Math.sin(u),
  52529. a[c + 2] = 1,
  52530. s[h] = (o[c] / e + 1) / 2,
  52531. s[h + 1] = (o[c + 1] / e + 1) / 2
  52532. }
  52533. var d = [];
  52534. for (c = 1; c <= t; c++)
  52535. d.push(c, c + 1, 0);
  52536. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  52537. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  52538. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  52539. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  52540. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  52541. }
  52542. ,
  52543. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52544. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  52545. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  52546. function t(e) {
  52547. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  52548. for (i = b,
  52549. t = 1; t <= m; t++)
  52550. I.setXYZ(b, 0, x * s, 0),
  52551. E.setXYZ(b, 0, s, 0),
  52552. !0 === e ? (r.x = t / m,
  52553. r.y = 0) : (r.x = (t - 1) / m,
  52554. r.y = 1),
  52555. _.setXY(b, r.x, r.y),
  52556. b++;
  52557. for (n = b,
  52558. t = 0; t <= m; t++) {
  52559. var l = t / m;
  52560. o.x = a * Math.sin(l * A + y),
  52561. o.y = x * s,
  52562. o.z = a * Math.cos(l * A + y),
  52563. I.setXYZ(b, o.x, o.y, o.z),
  52564. E.setXYZ(b, 0, s, 0),
  52565. _.setXY(b, l, !0 === e ? 1 : 0),
  52566. b++
  52567. }
  52568. for (t = 0; t < m; t++) {
  52569. var c = i + t
  52570. , h = n + t;
  52571. !0 === e ? (C.setX(w, h),
  52572. w++,
  52573. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  52574. w++,
  52575. C.setX(w, h)),
  52576. w++,
  52577. C.setX(w, c),
  52578. w++
  52579. }
  52580. }
  52581. Ci.BufferGeometry.call(this),
  52582. this.type = "CylinderBufferGeometry",
  52583. this.parameters = {
  52584. radiusTop: p,
  52585. radiusBottom: f,
  52586. height: g,
  52587. radialSegments: m,
  52588. heightSegments: v,
  52589. openEnded: e,
  52590. thetaStart: y,
  52591. thetaLength: A
  52592. },
  52593. p = void 0 !== p ? p : 20,
  52594. f = void 0 !== f ? f : 20,
  52595. g = void 0 !== g ? g : 100,
  52596. m = Math.floor(m) || 8,
  52597. v = Math.floor(v) || 1,
  52598. e = void 0 !== e && e,
  52599. y = void 0 !== y ? y : 0,
  52600. A = void 0 !== A ? A : 2 * Math.PI;
  52601. var i, n, r = (n = (m + 1) * (v + 1),
  52602. !1 === e && (n += 2 * (m + 1) + 2 * m),
  52603. n), o = (i = m * v * 2 * 3,
  52604. !1 === e && (i += 2 * m * 3),
  52605. 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;
  52606. (function() {
  52607. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  52608. for (t = 0; t <= v; t++) {
  52609. var o = []
  52610. , a = t / v
  52611. , s = a * (f - p) + p;
  52612. for (e = 0; e <= m; e++) {
  52613. var l = e / m;
  52614. n.x = s * Math.sin(l * A + y),
  52615. n.y = -a * g + x,
  52616. n.z = s * Math.cos(l * A + y),
  52617. I.setXYZ(b, n.x, n.y, n.z),
  52618. i.copy(n),
  52619. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  52620. i.z = Math.cos(l * A + y)),
  52621. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  52622. E.setXYZ(b, i.x, i.y, i.z),
  52623. _.setXY(b, l, 1 - a),
  52624. o.push(b),
  52625. b++
  52626. }
  52627. T.push(o)
  52628. }
  52629. for (e = 0; e < m; e++)
  52630. for (t = 0; t < v; t++) {
  52631. var c = T[t][e]
  52632. , h = T[t + 1][e]
  52633. , u = T[t + 1][e + 1]
  52634. , d = T[t][e + 1];
  52635. C.setX(w, c),
  52636. w++,
  52637. C.setX(w, h),
  52638. w++,
  52639. C.setX(w, d),
  52640. w++,
  52641. C.setX(w, h),
  52642. w++,
  52643. C.setX(w, u),
  52644. w++,
  52645. C.setX(w, d),
  52646. w++
  52647. }
  52648. }
  52649. )(),
  52650. !1 === e && (0 < p && t(!0),
  52651. 0 < f && t(!1)),
  52652. this.setIndex(C),
  52653. this.addAttribute("position", I),
  52654. this.addAttribute("normal", E),
  52655. this.addAttribute("uv", _)
  52656. }
  52657. ,
  52658. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52659. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  52660. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  52661. Ci.Geometry.call(this),
  52662. this.type = "CylinderGeometry",
  52663. this.parameters = {
  52664. radiusTop: e,
  52665. radiusBottom: t,
  52666. height: i,
  52667. radialSegments: n,
  52668. heightSegments: r,
  52669. openEnded: o,
  52670. thetaStart: a,
  52671. thetaLength: s
  52672. },
  52673. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  52674. this.mergeVertices()
  52675. }
  52676. ,
  52677. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52678. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  52679. Ci.EdgesGeometry = function(e, t) {
  52680. function i(e, t) {
  52681. return e - t
  52682. }
  52683. Ci.BufferGeometry.call(this),
  52684. t = void 0 !== t ? t : 1;
  52685. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  52686. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  52687. n.mergeVertices(),
  52688. n.computeFaceNormals();
  52689. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  52690. for (var d = c[h], p = 0; p < 3; p++) {
  52691. o[0] = d[s[p]],
  52692. o[1] = d[s[(p + 1) % 3]],
  52693. o.sort(i),
  52694. void 0 === a[g = o.toString()] ? a[g] = {
  52695. vert1: o[0],
  52696. vert2: o[1],
  52697. face1: h,
  52698. face2: void 0
  52699. } : a[g].face2 = h
  52700. }
  52701. var f = [];
  52702. for (var g in a) {
  52703. var m = a[g];
  52704. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  52705. var v = l[m.vert1];
  52706. f.push(v.x),
  52707. f.push(v.y),
  52708. f.push(v.z),
  52709. v = l[m.vert2],
  52710. f.push(v.x),
  52711. f.push(v.y),
  52712. f.push(v.z)
  52713. }
  52714. }
  52715. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  52716. }
  52717. ,
  52718. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52719. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  52720. Ci.ExtrudeGeometry = function(e, t) {
  52721. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  52722. this.type = "ExtrudeGeometry",
  52723. e = Array.isArray(e) ? e : [e],
  52724. this.addShapeList(e, t),
  52725. void this.computeFaceNormals())
  52726. }
  52727. ;
  52728. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52729. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  52730. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  52731. for (var i = e.length, n = 0; n < i; n++) {
  52732. var r = e[n];
  52733. this.addShape(r, t)
  52734. }
  52735. }
  52736. ,
  52737. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  52738. function i(e, t, i) {
  52739. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  52740. t.clone().multiplyScalar(i).add(e)
  52741. }
  52742. function n(e, t, i) {
  52743. 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;
  52744. if (Math.abs(u) > Number.EPSILON) {
  52745. var d = Math.sqrt(h)
  52746. , p = Math.sqrt(l * l + c * c)
  52747. , f = t.x - s / d
  52748. , g = t.y + a / d
  52749. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  52750. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  52751. if (v <= 2)
  52752. return new Ci.Vector2(n,r);
  52753. o = Math.sqrt(v / 2)
  52754. } else {
  52755. var y = !1;
  52756. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  52757. o = y ? (n = -s,
  52758. r = a,
  52759. Math.sqrt(h)) : (n = a,
  52760. r = s,
  52761. Math.sqrt(h / 2))
  52762. }
  52763. return new Ci.Vector2(n / o,r / o)
  52764. }
  52765. function r(e, t) {
  52766. var i, n;
  52767. for (G = e.length; 0 <= --G; ) {
  52768. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  52769. var r = 0
  52770. , o = A + 2 * m;
  52771. for (r = 0; r < o; r++) {
  52772. var a = U * r
  52773. , s = U * (r + 1);
  52774. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  52775. }
  52776. }
  52777. }
  52778. function o(e, t, i) {
  52779. T.vertices.push(new Ci.Vector3(e,t,i))
  52780. }
  52781. function a(e, t, i) {
  52782. e += x,
  52783. t += x,
  52784. i += x,
  52785. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  52786. var n = E.generateTopUV(T, e, t, i);
  52787. T.faceVertexUvs[0].push(n)
  52788. }
  52789. function l(e, t, i, n) {
  52790. e += x,
  52791. t += x,
  52792. i += x,
  52793. n += x,
  52794. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  52795. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  52796. var r = E.generateSideWallUV(T, e, t, i, n);
  52797. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  52798. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  52799. }
  52800. 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;
  52801. C && (s = C.getSpacedPoints(A),
  52802. v = !(I = !0),
  52803. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  52804. h = new Ci.Vector3,
  52805. u = new Ci.Vector3,
  52806. d = new Ci.Vector3),
  52807. v || (g = f = m = 0);
  52808. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  52809. if (P) {
  52810. for (M = M.reverse(),
  52811. b = 0,
  52812. w = R.length; b < w; b++)
  52813. _ = R[b],
  52814. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  52815. P = !1
  52816. }
  52817. var O = Ci.ShapeUtils.triangulateShape(M, R)
  52818. , L = M;
  52819. for (b = 0,
  52820. w = R.length; b < w; b++)
  52821. _ = R[b],
  52822. M = M.concat(_);
  52823. 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++,
  52824. j++,
  52825. Y++)
  52826. j === W && (j = 0),
  52827. Y === W && (Y = 0),
  52828. z[G] = n(L[G], L[j], L[Y]);
  52829. var q, X, Z = [], K = z.concat();
  52830. for (b = 0,
  52831. w = R.length; b < w; b++) {
  52832. for (_ = R[b],
  52833. q = [],
  52834. G = 0,
  52835. j = (W = _.length) - 1,
  52836. Y = G + 1; G < W; G++,
  52837. j++,
  52838. Y++)
  52839. j === W && (j = 0),
  52840. Y === W && (Y = 0),
  52841. q[G] = n(_[G], _[j], _[Y]);
  52842. Z.push(q),
  52843. K = K.concat(q)
  52844. }
  52845. for (D = 0; D < m; D++) {
  52846. for (B = f * (1 - (F = D / m)),
  52847. N = g * Math.sin(F * Math.PI / 2),
  52848. G = 0,
  52849. W = L.length; G < W; G++)
  52850. o((V = i(L[G], z[G], N)).x, V.y, -B);
  52851. for (b = 0,
  52852. w = R.length; b < w; b++)
  52853. for (_ = R[b],
  52854. q = Z[b],
  52855. G = 0,
  52856. W = _.length; G < W; G++)
  52857. o((V = i(_[G], q[G], N)).x, V.y, -B)
  52858. }
  52859. for (N = g,
  52860. G = 0; G < U; G++)
  52861. V = v ? i(M[G], K[G], N) : M[G],
  52862. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  52863. h.copy(c.binormals[0]).multiplyScalar(V.y),
  52864. d.copy(s[0]).add(u).add(h),
  52865. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  52866. for (X = 1; X <= A; X++)
  52867. for (G = 0; G < U; G++)
  52868. V = v ? i(M[G], K[G], N) : M[G],
  52869. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  52870. h.copy(c.binormals[X]).multiplyScalar(V.y),
  52871. d.copy(s[X]).add(u).add(h),
  52872. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  52873. for (D = m - 1; 0 <= D; D--) {
  52874. for (B = f * (1 - (F = D / m)),
  52875. N = g * Math.sin(F * Math.PI / 2),
  52876. G = 0,
  52877. W = L.length; G < W; G++)
  52878. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  52879. for (b = 0,
  52880. w = R.length; b < w; b++)
  52881. for (_ = R[b],
  52882. q = Z[b],
  52883. G = 0,
  52884. W = _.length; G < W; G++)
  52885. V = i(_[G], q[G], N),
  52886. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  52887. }
  52888. (function() {
  52889. if (v) {
  52890. var e = 0
  52891. , t = U * e;
  52892. for (G = 0; G < H; G++)
  52893. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  52894. for (t = U * (e = A + 2 * m),
  52895. G = 0; G < H; G++)
  52896. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  52897. } else {
  52898. for (G = 0; G < H; G++)
  52899. a((k = O[G])[2], k[1], k[0]);
  52900. for (G = 0; G < H; G++)
  52901. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  52902. }
  52903. }
  52904. )(),
  52905. function() {
  52906. var e = 0;
  52907. for (r(L, e),
  52908. e += L.length,
  52909. b = 0,
  52910. w = R.length; b < w; b++)
  52911. r(_ = R[b], e),
  52912. e += _.length
  52913. }()
  52914. }
  52915. ,
  52916. Ci.ExtrudeGeometry.WorldUVGenerator = {
  52917. generateTopUV: function(e, t, i, n) {
  52918. var r = e.vertices
  52919. , o = r[t]
  52920. , a = r[i]
  52921. , s = r[n];
  52922. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  52923. },
  52924. generateSideWallUV: function(e, t, i, n, r) {
  52925. var o = e.vertices
  52926. , a = o[t]
  52927. , s = o[i]
  52928. , l = o[n]
  52929. , c = o[r];
  52930. 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)]
  52931. }
  52932. },
  52933. Ci.ShapeGeometry = function(e, t) {
  52934. Ci.Geometry.call(this),
  52935. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  52936. this.addShapeList(e, t),
  52937. this.computeFaceNormals()
  52938. }
  52939. ,
  52940. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52941. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  52942. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  52943. for (var i = 0, n = e.length; i < n; i++)
  52944. this.addShape(e[i], t);
  52945. return this
  52946. }
  52947. ,
  52948. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  52949. void 0 === t && (t = {});
  52950. 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);
  52951. if (d) {
  52952. for (h = h.reverse(),
  52953. i = 0,
  52954. n = u.length; i < n; i++)
  52955. r = u[i],
  52956. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  52957. d = !1
  52958. }
  52959. var p = Ci.ShapeUtils.triangulateShape(h, u);
  52960. for (i = 0,
  52961. n = u.length; i < n; i++)
  52962. r = u[i],
  52963. h = h.concat(r);
  52964. var f, g, m = h.length, v = p.length;
  52965. for (i = 0; i < m; i++)
  52966. f = h[i],
  52967. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  52968. for (i = 0; i < v; i++) {
  52969. var y = (g = p[i])[0] + l
  52970. , A = g[1] + l
  52971. , C = g[2] + l;
  52972. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  52973. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  52974. }
  52975. }
  52976. ,
  52977. Ci.LatheBufferGeometry = function(e, t, i, n) {
  52978. Ci.BufferGeometry.call(this),
  52979. this.type = "LatheBufferGeometry",
  52980. this.parameters = {
  52981. points: e,
  52982. segments: t,
  52983. phiStart: i,
  52984. phiLength: n
  52985. },
  52986. t = Math.floor(t) || 12,
  52987. i = i || 0,
  52988. n = n || 2 * Math.PI,
  52989. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  52990. 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,
  52991. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  52992. for (o = 0; o <= t; o++) {
  52993. var v = i + o * f * n
  52994. , y = Math.sin(v)
  52995. , A = Math.cos(v);
  52996. for (a = 0; a <= e.length - 1; a++)
  52997. g.x = e[a].x * y,
  52998. g.y = e[a].y,
  52999. g.z = e[a].x * A,
  53000. h.setXYZ(d, g.x, g.y, g.z),
  53001. m.x = o / t,
  53002. m.y = a / (e.length - 1),
  53003. u.setXY(d, m.x, m.y),
  53004. d++
  53005. }
  53006. for (o = 0; o < t; o++)
  53007. for (a = 0; a < e.length - 1; a++) {
  53008. var C = r = a + o * e.length
  53009. , I = r + e.length
  53010. , E = r + e.length + 1
  53011. , _ = r + 1;
  53012. c.setX(p, C),
  53013. p++,
  53014. c.setX(p, I),
  53015. p++,
  53016. c.setX(p, _),
  53017. p++,
  53018. c.setX(p, I),
  53019. p++,
  53020. c.setX(p, E),
  53021. p++,
  53022. c.setX(p, _),
  53023. p++
  53024. }
  53025. if (this.setIndex(c),
  53026. this.addAttribute("position", h),
  53027. this.addAttribute("uv", u),
  53028. this.computeVertexNormals(),
  53029. n === 2 * Math.PI) {
  53030. var b = this.attributes.normal.array
  53031. , w = new Ci.Vector3
  53032. , T = new Ci.Vector3
  53033. , x = new Ci.Vector3;
  53034. for (r = t * e.length * 3,
  53035. a = o = 0; o < e.length; o++,
  53036. a += 3)
  53037. w.x = b[a + 0],
  53038. w.y = b[a + 1],
  53039. w.z = b[a + 2],
  53040. T.x = b[r + a + 0],
  53041. T.y = b[r + a + 1],
  53042. T.z = b[r + a + 2],
  53043. x.addVectors(w, T).normalize(),
  53044. b[a + 0] = b[r + a + 0] = x.x,
  53045. b[a + 1] = b[r + a + 1] = x.y,
  53046. b[a + 2] = b[r + a + 2] = x.z
  53047. }
  53048. }
  53049. ,
  53050. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53051. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  53052. Ci.LatheGeometry = function(e, t, i, n) {
  53053. Ci.Geometry.call(this),
  53054. this.type = "LatheGeometry",
  53055. this.parameters = {
  53056. points: e,
  53057. segments: t,
  53058. phiStart: i,
  53059. phiLength: n
  53060. },
  53061. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  53062. this.mergeVertices()
  53063. }
  53064. ,
  53065. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53066. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  53067. Ci.PlaneGeometry = function(e, t, i, n) {
  53068. Ci.Geometry.call(this),
  53069. this.type = "PlaneGeometry",
  53070. this.parameters = {
  53071. width: e,
  53072. height: t,
  53073. widthSegments: i,
  53074. heightSegments: n
  53075. },
  53076. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  53077. }
  53078. ,
  53079. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53080. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  53081. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  53082. Ci.BufferGeometry.call(this),
  53083. this.type = "PlaneBufferGeometry",
  53084. this.parameters = {
  53085. width: e,
  53086. height: t,
  53087. widthSegments: i,
  53088. heightSegments: n
  53089. };
  53090. 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++)
  53091. for (var y = v * u - o, A = 0; A < l; A++) {
  53092. var C = A * h - r;
  53093. d[g] = C,
  53094. d[g + 1] = -y,
  53095. p[g + 2] = 1,
  53096. f[m] = A / a,
  53097. f[m + 1] = 1 - v / s,
  53098. g += 3,
  53099. m += 2
  53100. }
  53101. g = 0;
  53102. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  53103. for (v = 0; v < s; v++)
  53104. for (A = 0; A < a; A++) {
  53105. var E = A + l * v
  53106. , _ = A + l * (v + 1)
  53107. , b = A + 1 + l * (v + 1)
  53108. , w = A + 1 + l * v;
  53109. I[g] = E,
  53110. I[g + 1] = _,
  53111. I[g + 2] = w,
  53112. I[g + 3] = _,
  53113. I[g + 4] = b,
  53114. I[g + 5] = w,
  53115. g += 6
  53116. }
  53117. this.setIndex(new Ci.BufferAttribute(I,1)),
  53118. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  53119. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  53120. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  53121. }
  53122. ,
  53123. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53124. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  53125. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  53126. Ci.BufferGeometry.call(this),
  53127. this.type = "RingBufferGeometry",
  53128. this.parameters = {
  53129. innerRadius: e,
  53130. outerRadius: t,
  53131. thetaSegments: i,
  53132. phiSegments: n,
  53133. thetaStart: r,
  53134. thetaLength: o
  53135. },
  53136. e = e || 20,
  53137. t = t || 50,
  53138. r = void 0 !== r ? r : 0,
  53139. o = void 0 !== o ? o : 2 * Math.PI;
  53140. 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;
  53141. for (s = 0; s <= n; s++) {
  53142. for (l = 0; l <= i; l++)
  53143. a = r + l / i * o,
  53144. A.x = v * Math.cos(a),
  53145. A.y = v * Math.sin(a),
  53146. d.setXYZ(g, A.x, A.y, A.z),
  53147. p.setXYZ(g, 0, 0, 1),
  53148. C.x = (A.x / t + 1) / 2,
  53149. C.y = (A.y / t + 1) / 2,
  53150. f.setXY(g, C.x, C.y),
  53151. g++;
  53152. v += y
  53153. }
  53154. for (s = 0; s < n; s++) {
  53155. var I = s * (i + 1);
  53156. for (l = 0; l < i; l++) {
  53157. var E = a = l + I
  53158. , _ = a + i + 1
  53159. , b = a + i + 2
  53160. , w = a + 1;
  53161. u.setX(m, E),
  53162. m++,
  53163. u.setX(m, _),
  53164. m++,
  53165. u.setX(m, b),
  53166. m++,
  53167. u.setX(m, E),
  53168. m++,
  53169. u.setX(m, b),
  53170. m++,
  53171. u.setX(m, w),
  53172. m++
  53173. }
  53174. }
  53175. this.setIndex(u),
  53176. this.addAttribute("position", d),
  53177. this.addAttribute("normal", p),
  53178. this.addAttribute("uv", f)
  53179. }
  53180. ,
  53181. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53182. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  53183. Ci.RingGeometry = function(e, t, i, n, r, o) {
  53184. Ci.Geometry.call(this),
  53185. this.type = "RingGeometry",
  53186. this.parameters = {
  53187. innerRadius: e,
  53188. outerRadius: t,
  53189. thetaSegments: i,
  53190. phiSegments: n,
  53191. thetaStart: r,
  53192. thetaLength: o
  53193. },
  53194. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  53195. }
  53196. ,
  53197. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53198. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  53199. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  53200. Ci.Geometry.call(this),
  53201. this.type = "SphereGeometry",
  53202. this.parameters = {
  53203. radius: e,
  53204. widthSegments: t,
  53205. heightSegments: i,
  53206. phiStart: n,
  53207. phiLength: r,
  53208. thetaStart: o,
  53209. thetaLength: a
  53210. },
  53211. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  53212. }
  53213. ,
  53214. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53215. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  53216. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  53217. Ci.BufferGeometry.call(this),
  53218. this.type = "SphereBufferGeometry",
  53219. this.parameters = {
  53220. radius: e,
  53221. widthSegments: t,
  53222. heightSegments: i,
  53223. phiStart: n,
  53224. phiLength: r,
  53225. thetaStart: o,
  53226. thetaLength: a
  53227. },
  53228. e = e || 50,
  53229. t = Math.max(3, Math.floor(t) || 8),
  53230. i = Math.max(2, Math.floor(i) || 6),
  53231. n = void 0 !== n ? n : 0,
  53232. r = void 0 !== r ? r : 2 * Math.PI;
  53233. 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++) {
  53234. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  53235. var A = y / t
  53236. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  53237. , I = e * Math.cos(o + v * a)
  53238. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  53239. f.set(C, I, E).normalize(),
  53240. c.setXYZ(d, C, I, E),
  53241. h.setXYZ(d, f.x, f.y, f.z),
  53242. u.setXY(d, A, 1 - v),
  53243. m.push(d),
  53244. d++
  53245. }
  53246. p.push(m)
  53247. }
  53248. var _ = [];
  53249. for (g = 0; g < i; g++)
  53250. for (y = 0; y < t; y++) {
  53251. var b = p[g][y + 1]
  53252. , w = p[g][y]
  53253. , T = p[g + 1][y]
  53254. , x = p[g + 1][y + 1];
  53255. (0 !== g || 0 < o) && _.push(b, w, x),
  53256. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  53257. }
  53258. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  53259. this.addAttribute("position", c),
  53260. this.addAttribute("normal", h),
  53261. this.addAttribute("uv", u),
  53262. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53263. }
  53264. ,
  53265. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53266. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  53267. Ci.TextGeometry = function(e, t) {
  53268. var i = (t = t || {}).font;
  53269. if (i instanceof Ci.Font == 0)
  53270. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  53271. new Ci.Geometry;
  53272. var n = i.generateShapes(e, t.size, t.curveSegments);
  53273. t.amount = void 0 !== t.height ? t.height : 50,
  53274. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  53275. void 0 === t.bevelSize && (t.bevelSize = 8),
  53276. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  53277. Ci.ExtrudeGeometry.call(this, n, t),
  53278. this.type = "TextGeometry"
  53279. }
  53280. ,
  53281. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  53282. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  53283. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  53284. Ci.BufferGeometry.call(this),
  53285. this.type = "TorusBufferGeometry",
  53286. this.parameters = {
  53287. radius: e,
  53288. tube: t,
  53289. radialSegments: i,
  53290. tubularSegments: n,
  53291. arc: r
  53292. },
  53293. e = e || 100,
  53294. t = t || 40,
  53295. i = Math.floor(i) || 8,
  53296. n = Math.floor(n) || 6,
  53297. r = r || 2 * Math.PI;
  53298. 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;
  53299. for (o = 0; o <= i; o++)
  53300. for (a = 0; a <= n; a++) {
  53301. var A = a / n * r
  53302. , C = o / i * Math.PI * 2;
  53303. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  53304. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  53305. v.z = t * Math.sin(C),
  53306. h[p] = v.x,
  53307. h[p + 1] = v.y,
  53308. h[p + 2] = v.z,
  53309. m.x = e * Math.cos(A),
  53310. m.y = e * Math.sin(A),
  53311. y.subVectors(v, m).normalize(),
  53312. u[p] = y.x,
  53313. u[p + 1] = y.y,
  53314. u[p + 2] = y.z,
  53315. d[f] = a / n,
  53316. d[f + 1] = o / i,
  53317. p += 3,
  53318. f += 2
  53319. }
  53320. for (o = 1; o <= i; o++)
  53321. for (a = 1; a <= n; a++) {
  53322. var I = (n + 1) * o + a - 1
  53323. , E = (n + 1) * (o - 1) + a - 1
  53324. , _ = (n + 1) * (o - 1) + a
  53325. , b = (n + 1) * o + a;
  53326. c[g] = I,
  53327. c[g + 1] = E,
  53328. c[g + 2] = b,
  53329. c[g + 3] = E,
  53330. c[g + 4] = _,
  53331. c[g + 5] = b,
  53332. g += 6
  53333. }
  53334. this.setIndex(new Ci.BufferAttribute(c,1)),
  53335. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  53336. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  53337. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  53338. }
  53339. ,
  53340. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53341. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  53342. Ci.TorusGeometry = function(e, t, i, n, r) {
  53343. Ci.Geometry.call(this),
  53344. this.type = "TorusGeometry",
  53345. this.parameters = {
  53346. radius: e,
  53347. tube: t,
  53348. radialSegments: i,
  53349. tubularSegments: n,
  53350. arc: r
  53351. },
  53352. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  53353. }
  53354. ,
  53355. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53356. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  53357. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  53358. function a(e, t, i, n, r) {
  53359. var o = Math.cos(e)
  53360. , a = Math.sin(e)
  53361. , s = i / t * e
  53362. , l = Math.cos(s);
  53363. r.x = n * (2 + l) * .5 * o,
  53364. r.y = n * (2 + l) * a * .5,
  53365. r.z = n * Math.sin(s) * .5
  53366. }
  53367. Ci.BufferGeometry.call(this),
  53368. this.type = "TorusKnotBufferGeometry",
  53369. this.parameters = {
  53370. radius: e,
  53371. tube: t,
  53372. tubularSegments: i,
  53373. radialSegments: n,
  53374. p: r,
  53375. q: o
  53376. },
  53377. e = e || 100,
  53378. t = t || 40,
  53379. i = Math.floor(i) || 64,
  53380. r = r || 2,
  53381. o = o || 3;
  53382. 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;
  53383. for (s = 0; s <= i; ++s) {
  53384. var w = s / i * r * Math.PI * 2;
  53385. for (a(w, r, o, e, C),
  53386. a(.01 + w, r, o, e, I),
  53387. _.subVectors(I, C),
  53388. b.addVectors(I, C),
  53389. E.crossVectors(_, b),
  53390. b.crossVectors(E, _),
  53391. E.normalize(),
  53392. b.normalize(),
  53393. l = 0; l <= n; ++l) {
  53394. var T = l / n * Math.PI * 2
  53395. , x = -t * Math.cos(T)
  53396. , S = t * Math.sin(T);
  53397. v.x = C.x + (x * b.x + S * E.x),
  53398. v.y = C.y + (x * b.y + S * E.y),
  53399. v.z = C.z + (x * b.z + S * E.z),
  53400. d.setXYZ(g, v.x, v.y, v.z),
  53401. y.subVectors(v, C).normalize(),
  53402. p.setXYZ(g, y.x, y.y, y.z),
  53403. A.x = s / i,
  53404. A.y = l / n,
  53405. f.setXY(g, A.x, A.y),
  53406. g++
  53407. }
  53408. }
  53409. for (l = 1; l <= i; l++)
  53410. for (s = 1; s <= n; s++) {
  53411. var M = (n + 1) * (l - 1) + (s - 1)
  53412. , R = (n + 1) * l + (s - 1)
  53413. , P = (n + 1) * l + s
  53414. , O = (n + 1) * (l - 1) + s;
  53415. u.setX(m, M),
  53416. m++,
  53417. u.setX(m, R),
  53418. m++,
  53419. u.setX(m, O),
  53420. m++,
  53421. u.setX(m, R),
  53422. m++,
  53423. u.setX(m, P),
  53424. m++,
  53425. u.setX(m, O),
  53426. m++
  53427. }
  53428. this.setIndex(u),
  53429. this.addAttribute("position", d),
  53430. this.addAttribute("normal", p),
  53431. this.addAttribute("uv", f)
  53432. }
  53433. ,
  53434. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53435. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  53436. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  53437. Ci.Geometry.call(this),
  53438. this.type = "TorusKnotGeometry",
  53439. this.parameters = {
  53440. radius: e,
  53441. tube: t,
  53442. tubularSegments: i,
  53443. radialSegments: n,
  53444. p: r,
  53445. q: o
  53446. },
  53447. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  53448. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  53449. this.mergeVertices()
  53450. }
  53451. ,
  53452. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53453. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  53454. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  53455. Ci.Geometry.call(this),
  53456. this.type = "TubeGeometry",
  53457. this.parameters = {
  53458. path: e,
  53459. segments: t,
  53460. radius: i,
  53461. radialSegments: n,
  53462. closed: r,
  53463. taper: o
  53464. },
  53465. t = t || 64,
  53466. i = i || 1,
  53467. n = n || 8,
  53468. r = r || !1,
  53469. o = o || Ci.TubeGeometry.NoTaper;
  53470. 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;
  53471. for (this.tangents = D,
  53472. this.normals = N,
  53473. this.binormals = F,
  53474. f = 0; f < P; f++)
  53475. for (M[f] = [],
  53476. l = f / (P - 1),
  53477. p = e.getPointAt(l),
  53478. D[f],
  53479. a = N[f],
  53480. s = F[f],
  53481. h = i * o(l),
  53482. g = 0; g < n; g++)
  53483. c = g / n * 2 * Math.PI,
  53484. u = -h * Math.cos(c),
  53485. d = h * Math.sin(c),
  53486. O.copy(p),
  53487. O.x += u * a.x + d * s.x,
  53488. O.y += u * a.y + d * s.y,
  53489. O.z += u * a.z + d * s.z,
  53490. M[f][g] = (T = O.x,
  53491. x = O.y,
  53492. S = O.z,
  53493. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  53494. for (f = 0; f < t; f++)
  53495. for (g = 0; g < n; g++)
  53496. m = r ? (f + 1) % t : f + 1,
  53497. v = (g + 1) % n,
  53498. y = M[f][g],
  53499. A = M[m][g],
  53500. C = M[m][v],
  53501. I = M[f][v],
  53502. E = new Ci.Vector2(f / t,g / n),
  53503. _ = new Ci.Vector2((f + 1) / t,g / n),
  53504. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  53505. w = new Ci.Vector2(f / t,(g + 1) / n),
  53506. this.faces.push(new Ci.Face3(y,A,I)),
  53507. this.faceVertexUvs[0].push([E, _, w]),
  53508. this.faces.push(new Ci.Face3(A,C,I)),
  53509. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  53510. this.computeFaceNormals(),
  53511. this.computeVertexNormals()
  53512. }
  53513. ,
  53514. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53515. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  53516. Ci.TubeGeometry.NoTaper = function(e) {
  53517. return 1
  53518. }
  53519. ,
  53520. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  53521. return Math.sin(Math.PI * e)
  53522. }
  53523. ,
  53524. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  53525. 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;
  53526. for (this.tangents = u,
  53527. this.normals = d,
  53528. this.binormals = p,
  53529. l = 0; l < m; l++)
  53530. c = l / (m - 1),
  53531. u[l] = e.getTangentAt(c),
  53532. u[l].normalize();
  53533. for (d[0] = new Ci.Vector3,
  53534. p[0] = new Ci.Vector3,
  53535. r = Number.MAX_VALUE,
  53536. o = Math.abs(u[0].x),
  53537. a = Math.abs(u[0].y),
  53538. s = Math.abs(u[0].z),
  53539. o <= r && (r = o,
  53540. h.set(1, 0, 0)),
  53541. a <= r && (r = a,
  53542. h.set(0, 1, 0)),
  53543. s <= r && h.set(0, 0, 1),
  53544. f.crossVectors(u[0], h).normalize(),
  53545. d[0].crossVectors(u[0], f),
  53546. p[0].crossVectors(u[0], d[0]),
  53547. l = 1; l < m; l++)
  53548. d[l] = d[l - 1].clone(),
  53549. p[l] = p[l - 1].clone(),
  53550. f.crossVectors(u[l - 1], u[l]),
  53551. f.length() > Number.EPSILON && (f.normalize(),
  53552. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  53553. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  53554. p[l].crossVectors(u[l], d[l]);
  53555. if (i)
  53556. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  53557. n /= m - 1,
  53558. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  53559. l = 1; l < m; l++)
  53560. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  53561. p[l].crossVectors(u[l], d[l])
  53562. }
  53563. ,
  53564. Ci.PolyhedronGeometry = function(e, t, i, n) {
  53565. function f(e) {
  53566. var t = e.normalize().clone();
  53567. t.index = m.vertices.push(t) - 1;
  53568. var i = a(e) / 2 / Math.PI + .5
  53569. , n = function(e) {
  53570. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  53571. }(e) / Math.PI + .5;
  53572. return t.uv = new Ci.Vector2(i,1 - n),
  53573. t
  53574. }
  53575. function g(e, t, i, n) {
  53576. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  53577. m.faces.push(r),
  53578. y.copy(e).add(t).add(i).divideScalar(3);
  53579. var o = a(y);
  53580. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  53581. }
  53582. function r(e, t) {
  53583. 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++) {
  53584. a[l] = [];
  53585. 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++)
  53586. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  53587. }
  53588. for (l = 0; l < i; l++)
  53589. for (d = 0; d < 2 * (i - l) - 1; d++) {
  53590. var p = Math.floor(d / 2);
  53591. 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)
  53592. }
  53593. }
  53594. function a(e) {
  53595. return Math.atan2(e.z, -e.x)
  53596. }
  53597. function s(e, t, i) {
  53598. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  53599. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  53600. e.clone()
  53601. }
  53602. Ci.Geometry.call(this),
  53603. this.type = "PolyhedronGeometry",
  53604. this.parameters = {
  53605. vertices: e,
  53606. indices: t,
  53607. radius: i,
  53608. detail: n
  53609. },
  53610. i = i || 1,
  53611. n = n || 0;
  53612. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  53613. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  53614. var c = this.vertices
  53615. , h = []
  53616. , u = (o = 0,
  53617. 0);
  53618. for (l = t.length; o < l; o += 3,
  53619. u++) {
  53620. var d = c[t[o]]
  53621. , p = c[t[o + 1]]
  53622. , v = c[t[o + 2]];
  53623. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  53624. }
  53625. var y = new Ci.Vector3;
  53626. for (o = 0,
  53627. l = h.length; o < l; o++)
  53628. r(h[o], n);
  53629. for (o = 0,
  53630. l = this.faceVertexUvs[0].length; o < l; o++) {
  53631. var A = this.faceVertexUvs[0][o]
  53632. , C = A[0].x
  53633. , I = A[1].x
  53634. , E = A[2].x
  53635. , _ = Math.max(C, I, E)
  53636. , b = Math.min(C, I, E);
  53637. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  53638. I < .2 && (A[1].x += 1),
  53639. E < .2 && (A[2].x += 1))
  53640. }
  53641. for (o = 0,
  53642. l = this.vertices.length; o < l; o++)
  53643. this.vertices[o].multiplyScalar(i);
  53644. this.mergeVertices(),
  53645. this.computeFaceNormals(),
  53646. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  53647. }
  53648. ,
  53649. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53650. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  53651. Ci.DodecahedronGeometry = function(e, t) {
  53652. var i = (1 + Math.sqrt(5)) / 2
  53653. , n = 1 / i
  53654. , 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];
  53655. 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),
  53656. this.type = "DodecahedronGeometry",
  53657. this.parameters = {
  53658. radius: e,
  53659. detail: t
  53660. }
  53661. }
  53662. ,
  53663. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53664. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  53665. Ci.IcosahedronGeometry = function(e, t) {
  53666. var i = (1 + Math.sqrt(5)) / 2
  53667. , 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];
  53668. 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),
  53669. this.type = "IcosahedronGeometry",
  53670. this.parameters = {
  53671. radius: e,
  53672. detail: t
  53673. }
  53674. }
  53675. ,
  53676. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53677. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  53678. Ci.OctahedronGeometry = function(e, t) {
  53679. 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),
  53680. this.type = "OctahedronGeometry",
  53681. this.parameters = {
  53682. radius: e,
  53683. detail: t
  53684. }
  53685. }
  53686. ,
  53687. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53688. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  53689. Ci.TetrahedronGeometry = function(e, t) {
  53690. 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),
  53691. this.type = "TetrahedronGeometry",
  53692. this.parameters = {
  53693. radius: e,
  53694. detail: t
  53695. }
  53696. }
  53697. ,
  53698. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53699. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  53700. Ci.ParametricGeometry = function(e, t, i) {
  53701. Ci.Geometry.call(this),
  53702. this.type = "ParametricGeometry",
  53703. this.parameters = {
  53704. func: e,
  53705. slices: t,
  53706. stacks: i
  53707. };
  53708. 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;
  53709. for (n = 0; n <= i; n++)
  53710. for (a = n / i,
  53711. r = 0; r <= t; r++)
  53712. o = e(r / t, a),
  53713. g.push(o);
  53714. for (n = 0; n < i; n++)
  53715. for (r = 0; r < t; r++)
  53716. l = (s = n * y + r) + 1,
  53717. c = (n + 1) * y + r + 1,
  53718. h = (n + 1) * y + r,
  53719. u = new Ci.Vector2(r / t,n / i),
  53720. d = new Ci.Vector2((r + 1) / t,n / i),
  53721. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  53722. f = new Ci.Vector2(r / t,(n + 1) / i),
  53723. m.push(new Ci.Face3(s,l,h)),
  53724. v.push([u, d, f]),
  53725. m.push(new Ci.Face3(l,c,h)),
  53726. v.push([d.clone(), p, f.clone()]);
  53727. this.computeFaceNormals(),
  53728. this.computeVertexNormals()
  53729. }
  53730. ,
  53731. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53732. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  53733. Ci.WireframeGeometry = function(e) {
  53734. function t(e, t) {
  53735. return e - t
  53736. }
  53737. Ci.BufferGeometry.call(this);
  53738. var i = [0, 0]
  53739. , n = {}
  53740. , r = ["a", "b", "c"];
  53741. if (e instanceof Ci.Geometry) {
  53742. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  53743. for (var u = a[c], d = 0; d < 3; d++) {
  53744. i[0] = u[r[d]],
  53745. i[1] = u[r[(d + 1) % 3]],
  53746. i.sort(t),
  53747. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  53748. l[2 * s + 1] = i[1],
  53749. n[E] = !0,
  53750. s++)
  53751. }
  53752. var p = new Float32Array(2 * s * 3);
  53753. for (c = 0,
  53754. h = s; c < h; c++)
  53755. for (d = 0; d < 2; d++) {
  53756. var f = o[l[2 * c + d]];
  53757. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  53758. p[_ + 1] = f.y,
  53759. p[_ + 2] = f.z
  53760. }
  53761. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  53762. } else if (e instanceof Ci.BufferGeometry)
  53763. if (null !== e.index) {
  53764. var g = e.index.array
  53765. , m = (o = e.attributes.position,
  53766. e.groups);
  53767. s = 0;
  53768. 0 === m.length && e.addGroup(0, g.length);
  53769. l = new Uint32Array(2 * g.length);
  53770. for (var v = 0, y = m.length; v < y; ++v)
  53771. for (var A = m[v], C = A.start, I = (c = C,
  53772. C + A.count); c < I; c += 3)
  53773. for (d = 0; d < 3; d++) {
  53774. var E;
  53775. i[0] = g[c + d],
  53776. i[1] = g[c + (d + 1) % 3],
  53777. i.sort(t),
  53778. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  53779. l[2 * s + 1] = i[1],
  53780. n[E] = !0,
  53781. s++)
  53782. }
  53783. for (p = new Float32Array(2 * s * 3),
  53784. c = 0,
  53785. h = s; c < h; c++)
  53786. for (d = 0; d < 2; d++) {
  53787. var _ = 6 * c + 3 * d
  53788. , b = l[2 * c + d];
  53789. p[_ + 0] = o.getX(b),
  53790. p[_ + 1] = o.getY(b),
  53791. p[_ + 2] = o.getZ(b)
  53792. }
  53793. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  53794. } else {
  53795. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  53796. for (p = new Float32Array(2 * s * 3),
  53797. c = 0,
  53798. h = w; c < h; c++)
  53799. for (d = 0; d < 3; d++) {
  53800. var T = 9 * c + 3 * d;
  53801. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  53802. p[_ + 1] = o[1 + T],
  53803. p[_ + 2] = o[2 + T];
  53804. b = 9 * c + (d + 1) % 3 * 3;
  53805. p[_ + 3] = o[b],
  53806. p[_ + 4] = o[b + 1],
  53807. p[_ + 5] = o[b + 2]
  53808. }
  53809. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  53810. }
  53811. }
  53812. ,
  53813. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53814. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  53815. Ci.AxisHelper = function(e) {
  53816. e = e || 1;
  53817. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  53818. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  53819. , n = new Ci.BufferGeometry;
  53820. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  53821. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  53822. var r = new Ci.LineBasicMaterial({
  53823. vertexColors: Ci.VertexColors
  53824. });
  53825. Ci.LineSegments.call(this, n, r)
  53826. }
  53827. ,
  53828. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  53829. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  53830. Ci.ArrowHelper = function() {
  53831. var a = new Ci.Geometry;
  53832. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  53833. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  53834. return s.translate(0, -.5, 0),
  53835. function(e, t, i, n, r, o) {
  53836. Ci.Object3D.call(this),
  53837. void 0 === n && (n = 16776960),
  53838. void 0 === i && (i = 1),
  53839. void 0 === r && (r = .2 * i),
  53840. void 0 === o && (o = .2 * r),
  53841. this.position.copy(t),
  53842. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  53843. color: n
  53844. })),
  53845. this.line.matrixAutoUpdate = !1,
  53846. this.add(this.line),
  53847. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  53848. color: n
  53849. })),
  53850. this.cone.matrixAutoUpdate = !1,
  53851. this.add(this.cone),
  53852. this.setDirection(e),
  53853. this.setLength(i, r, o)
  53854. }
  53855. }(),
  53856. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  53857. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  53858. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  53859. function(e) {
  53860. .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(),
  53861. yi = Math.acos(e.y),
  53862. this.quaternion.setFromAxisAngle(Ai, yi))
  53863. }
  53864. ),
  53865. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  53866. void 0 === t && (t = .2 * e),
  53867. void 0 === i && (i = .2 * t),
  53868. this.line.scale.set(1, Math.max(0, e - t), 1),
  53869. this.line.updateMatrix(),
  53870. this.cone.scale.set(i, t, i),
  53871. this.cone.position.y = e,
  53872. this.cone.updateMatrix()
  53873. }
  53874. ,
  53875. Ci.ArrowHelper.prototype.setColor = function(e) {
  53876. this.line.material.color.set(e),
  53877. this.cone.material.color.set(e)
  53878. }
  53879. ,
  53880. Ci.BoxHelper = function(e) {
  53881. 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])
  53882. , i = new Float32Array(24)
  53883. , n = new Ci.BufferGeometry;
  53884. n.setIndex(new Ci.BufferAttribute(t,1)),
  53885. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  53886. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  53887. color: 16776960
  53888. })),
  53889. void 0 !== e && this.update(e)
  53890. }
  53891. ,
  53892. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  53893. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  53894. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  53895. function(e) {
  53896. if (vi.setFromObject(e),
  53897. !vi.isEmpty()) {
  53898. var t = vi.min
  53899. , i = vi.max
  53900. , n = this.geometry.attributes.position
  53901. , r = n.array;
  53902. r[0] = i.x,
  53903. r[1] = i.y,
  53904. r[2] = i.z,
  53905. r[3] = t.x,
  53906. r[4] = i.y,
  53907. r[5] = i.z,
  53908. r[6] = t.x,
  53909. r[7] = t.y,
  53910. r[8] = i.z,
  53911. r[9] = i.x,
  53912. r[10] = t.y,
  53913. r[11] = i.z,
  53914. r[12] = i.x,
  53915. r[13] = i.y,
  53916. r[14] = t.z,
  53917. r[15] = t.x,
  53918. r[16] = i.y,
  53919. r[17] = t.z,
  53920. r[18] = t.x,
  53921. r[19] = t.y,
  53922. r[20] = t.z,
  53923. r[21] = i.x,
  53924. r[22] = t.y,
  53925. r[23] = t.z,
  53926. n.needsUpdate = !0,
  53927. this.geometry.computeBoundingSphere()
  53928. }
  53929. }
  53930. ),
  53931. Ci.BoundingBoxHelper = function(e, t) {
  53932. var i = void 0 !== t ? t : 8947848;
  53933. this.object = e,
  53934. this.box = new Ci.Box3,
  53935. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  53936. color: i,
  53937. wireframe: !0
  53938. }))
  53939. }
  53940. ,
  53941. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  53942. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  53943. Ci.BoundingBoxHelper.prototype.update = function() {
  53944. this.box.setFromObject(this.object),
  53945. this.box.size(this.scale),
  53946. this.box.center(this.position)
  53947. }
  53948. ,
  53949. Ci.CameraHelper = function(e) {
  53950. function t(e, t, i) {
  53951. n(e, i),
  53952. n(t, i)
  53953. }
  53954. function n(e, t) {
  53955. i.vertices.push(new Ci.Vector3),
  53956. i.colors.push(new Ci.Color(t)),
  53957. void 0 === o[e] && (o[e] = []),
  53958. o[e].push(i.vertices.length - 1)
  53959. }
  53960. var i = new Ci.Geometry
  53961. , r = new Ci.LineBasicMaterial({
  53962. color: 16777215,
  53963. vertexColors: Ci.FaceColors
  53964. })
  53965. , o = {}
  53966. , a = 16755200
  53967. , s = 16711680
  53968. , l = 3355443;
  53969. t("n1", "n2", a),
  53970. t("n2", "n4", a),
  53971. t("n4", "n3", a),
  53972. t("n3", "n1", a),
  53973. t("f1", "f2", a),
  53974. t("f2", "f4", a),
  53975. t("f4", "f3", a),
  53976. t("f3", "f1", a),
  53977. t("n1", "f1", a),
  53978. t("n2", "f2", a),
  53979. t("n3", "f3", a),
  53980. t("n4", "f4", a),
  53981. t("p", "n1", s),
  53982. t("p", "n2", s),
  53983. t("p", "n3", s),
  53984. t("p", "n4", s),
  53985. t("u1", "u2", 43775),
  53986. t("u2", "u3", 43775),
  53987. t("u3", "u1", 43775),
  53988. t("c", "t", 16777215),
  53989. t("p", "c", l),
  53990. t("cn1", "cn2", l),
  53991. t("cn3", "cn4", l),
  53992. t("cf1", "cf2", l),
  53993. t("cf3", "cf4", l),
  53994. Ci.LineSegments.call(this, i, r),
  53995. this.camera = e,
  53996. this.camera.updateProjectionMatrix(),
  53997. this.matrix = e.matrixWorld,
  53998. this.matrixAutoUpdate = !1,
  53999. this.pointMap = o,
  54000. this.update()
  54001. }
  54002. ,
  54003. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54004. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54005. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54006. mi = new Ci.Camera,
  54007. function() {
  54008. pi = this.geometry,
  54009. fi = this.pointMap,
  54010. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54011. Ni("c", 0, 0, -1),
  54012. Ni("t", 0, 0, 1),
  54013. Ni("n1", -1, -1, -1),
  54014. Ni("n2", 1, -1, -1),
  54015. Ni("n3", -1, 1, -1),
  54016. Ni("n4", 1, 1, -1),
  54017. Ni("f1", -1, -1, 1),
  54018. Ni("f2", 1, -1, 1),
  54019. Ni("f3", -1, 1, 1),
  54020. Ni("f4", 1, 1, 1),
  54021. Ni("u1", .7, 1.1, -1),
  54022. Ni("u2", -.7, 1.1, -1),
  54023. Ni("u3", 0, 2, -1),
  54024. Ni("cf1", -1, 0, 1),
  54025. Ni("cf2", 1, 0, 1),
  54026. Ni("cf3", 0, -1, 1),
  54027. Ni("cf4", 0, 1, 1),
  54028. Ni("cn1", -1, 0, -1),
  54029. Ni("cn2", 1, 0, -1),
  54030. Ni("cn3", 0, -1, -1),
  54031. Ni("cn4", 0, 1, -1),
  54032. pi.verticesNeedUpdate = !0
  54033. }
  54034. ),
  54035. Ci.DirectionalLightHelper = function(e, t) {
  54036. Ci.Object3D.call(this),
  54037. this.light = e,
  54038. this.light.updateMatrixWorld(),
  54039. this.matrix = e.matrixWorld,
  54040. this.matrixAutoUpdate = !1,
  54041. t = t || 1;
  54042. var i = new Ci.Geometry;
  54043. 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));
  54044. var n = new Ci.LineBasicMaterial({
  54045. fog: !1
  54046. });
  54047. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54048. this.lightPlane = new Ci.Line(i,n),
  54049. this.add(this.lightPlane),
  54050. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  54051. (n = new Ci.LineBasicMaterial({
  54052. fog: !1
  54053. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54054. this.targetLine = new Ci.Line(i,n),
  54055. this.add(this.targetLine),
  54056. this.update()
  54057. }
  54058. ,
  54059. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54060. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  54061. Ci.DirectionalLightHelper.prototype.dispose = function() {
  54062. this.lightPlane.geometry.dispose(),
  54063. this.lightPlane.material.dispose(),
  54064. this.targetLine.geometry.dispose(),
  54065. this.targetLine.material.dispose()
  54066. }
  54067. ,
  54068. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  54069. ui = new Ci.Vector3,
  54070. di = new Ci.Vector3,
  54071. function() {
  54072. hi.setFromMatrixPosition(this.light.matrixWorld),
  54073. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  54074. di.subVectors(ui, hi),
  54075. this.lightPlane.lookAt(di),
  54076. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54077. this.targetLine.geometry.vertices[1].copy(di),
  54078. this.targetLine.geometry.verticesNeedUpdate = !0,
  54079. this.targetLine.material.color.copy(this.lightPlane.material.color)
  54080. }
  54081. ),
  54082. Ci.EdgesHelper = function(e, t, i) {
  54083. var n = void 0 !== t ? t : 16777215;
  54084. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  54085. color: n
  54086. })),
  54087. this.matrix = e.matrixWorld,
  54088. this.matrixAutoUpdate = !1
  54089. }
  54090. ,
  54091. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54092. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  54093. Ci.FaceNormalsHelper = function(e, t, i, n) {
  54094. this.object = e,
  54095. this.size = void 0 !== t ? t : 1;
  54096. var r = void 0 !== i ? i : 16776960
  54097. , o = void 0 !== n ? n : 1
  54098. , a = 0
  54099. , s = this.object.geometry;
  54100. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  54101. var l = new Ci.BufferGeometry
  54102. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54103. l.addAttribute("position", c),
  54104. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54105. color: r,
  54106. linewidth: o
  54107. })),
  54108. this.matrixAutoUpdate = !1,
  54109. this.update()
  54110. }
  54111. ,
  54112. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54113. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  54114. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  54115. li = new Ci.Vector3,
  54116. ci = new Ci.Matrix3,
  54117. function() {
  54118. this.object.updateMatrixWorld(!0),
  54119. ci.getNormalMatrix(this.object.matrixWorld);
  54120. 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++) {
  54121. var l = r[a]
  54122. , c = l.normal;
  54123. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  54124. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  54125. t.setXYZ(o, si.x, si.y, si.z),
  54126. o += 1,
  54127. t.setXYZ(o, li.x, li.y, li.z),
  54128. o += 1
  54129. }
  54130. return t.needsUpdate = !0,
  54131. this
  54132. }
  54133. ),
  54134. Ci.GridHelper = function(e, t) {
  54135. var i = new Ci.Geometry
  54136. , n = new Ci.LineBasicMaterial({
  54137. vertexColors: Ci.VertexColors
  54138. });
  54139. this.color1 = new Ci.Color(4473924),
  54140. this.color2 = new Ci.Color(8947848);
  54141. for (var r = -e; r <= e; r += t) {
  54142. 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));
  54143. var o = 0 === r ? this.color1 : this.color2;
  54144. i.colors.push(o, o, o, o)
  54145. }
  54146. Ci.LineSegments.call(this, i, n)
  54147. }
  54148. ,
  54149. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54150. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  54151. Ci.GridHelper.prototype.setColors = function(e, t) {
  54152. this.color1.set(e),
  54153. this.color2.set(t),
  54154. this.geometry.colorsNeedUpdate = !0
  54155. }
  54156. ,
  54157. Ci.HemisphereLightHelper = function(e, t) {
  54158. Ci.Object3D.call(this),
  54159. this.light = e,
  54160. this.light.updateMatrixWorld(),
  54161. this.matrix = e.matrixWorld,
  54162. this.matrixAutoUpdate = !1,
  54163. this.colors = [new Ci.Color, new Ci.Color];
  54164. var i = new Ci.SphereGeometry(t,4,2);
  54165. i.rotateX(-Math.PI / 2);
  54166. for (var n = 0; n < 8; n++)
  54167. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  54168. var r = new Ci.MeshBasicMaterial({
  54169. vertexColors: Ci.FaceColors,
  54170. wireframe: !0
  54171. });
  54172. this.lightSphere = new Ci.Mesh(i,r),
  54173. this.add(this.lightSphere),
  54174. this.update()
  54175. }
  54176. ,
  54177. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54178. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  54179. Ci.HemisphereLightHelper.prototype.dispose = function() {
  54180. this.lightSphere.geometry.dispose(),
  54181. this.lightSphere.material.dispose()
  54182. }
  54183. ,
  54184. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  54185. function() {
  54186. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  54187. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  54188. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  54189. this.lightSphere.geometry.colorsNeedUpdate = !0
  54190. }
  54191. ),
  54192. Ci.PointLightHelper = function(e, t) {
  54193. this.light = e,
  54194. this.light.updateMatrixWorld();
  54195. var i = new Ci.SphereGeometry(t,4,2)
  54196. , n = new Ci.MeshBasicMaterial({
  54197. wireframe: !0,
  54198. fog: !1
  54199. });
  54200. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54201. Ci.Mesh.call(this, i, n),
  54202. this.matrix = this.light.matrixWorld,
  54203. this.matrixAutoUpdate = !1
  54204. }
  54205. ,
  54206. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  54207. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  54208. Ci.PointLightHelper.prototype.dispose = function() {
  54209. this.geometry.dispose(),
  54210. this.material.dispose()
  54211. }
  54212. ,
  54213. Ci.PointLightHelper.prototype.update = function() {
  54214. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54215. }
  54216. ,
  54217. Ci.SkeletonHelper = function(e) {
  54218. this.bones = this.getBoneList(e);
  54219. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  54220. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  54221. t.vertices.push(new Ci.Vector3),
  54222. t.colors.push(new Ci.Color(0,0,1)),
  54223. t.colors.push(new Ci.Color(0,1,0)))
  54224. }
  54225. t.dynamic = !0;
  54226. var n = new Ci.LineBasicMaterial({
  54227. vertexColors: Ci.VertexColors,
  54228. depthTest: !1,
  54229. depthWrite: !1,
  54230. transparent: !0
  54231. });
  54232. Ci.LineSegments.call(this, t, n),
  54233. this.root = e,
  54234. this.matrix = e.matrixWorld,
  54235. this.matrixAutoUpdate = !1,
  54236. this.update()
  54237. }
  54238. ,
  54239. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54240. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  54241. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  54242. var t = [];
  54243. e instanceof Ci.Bone && t.push(e);
  54244. for (var i = 0; i < e.children.length; i++)
  54245. t.push.apply(t, this.getBoneList(e.children[i]));
  54246. return t
  54247. }
  54248. ,
  54249. Ci.SkeletonHelper.prototype.update = function() {
  54250. 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++) {
  54251. var o = this.bones[r];
  54252. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  54253. e.vertices[n].setFromMatrixPosition(i),
  54254. i.multiplyMatrices(t, o.parent.matrixWorld),
  54255. e.vertices[n + 1].setFromMatrixPosition(i),
  54256. n += 2)
  54257. }
  54258. e.verticesNeedUpdate = !0,
  54259. e.computeBoundingSphere()
  54260. }
  54261. ,
  54262. Ci.SpotLightHelper = function(e) {
  54263. Ci.Object3D.call(this),
  54264. this.light = e,
  54265. this.light.updateMatrixWorld(),
  54266. this.matrix = e.matrixWorld,
  54267. this.matrixAutoUpdate = !1;
  54268. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  54269. t.translate(0, -.5, 0),
  54270. t.rotateX(-Math.PI / 2);
  54271. var i = new Ci.MeshBasicMaterial({
  54272. wireframe: !0,
  54273. fog: !1
  54274. });
  54275. this.cone = new Ci.Mesh(t,i),
  54276. this.add(this.cone),
  54277. this.update()
  54278. }
  54279. ,
  54280. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54281. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  54282. Ci.SpotLightHelper.prototype.dispose = function() {
  54283. this.cone.geometry.dispose(),
  54284. this.cone.material.dispose()
  54285. }
  54286. ,
  54287. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  54288. oi = new Ci.Vector3,
  54289. function() {
  54290. var e = this.light.distance ? this.light.distance : 1e4
  54291. , t = e * Math.tan(this.light.angle);
  54292. this.cone.scale.set(t, t, e),
  54293. ri.setFromMatrixPosition(this.light.matrixWorld),
  54294. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  54295. this.cone.lookAt(oi.sub(ri)),
  54296. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54297. }
  54298. ),
  54299. Ci.VertexNormalsHelper = function(e, t, i, n) {
  54300. this.object = e,
  54301. this.size = void 0 !== t ? t : 1;
  54302. var r = void 0 !== i ? i : 16711680
  54303. , o = void 0 !== n ? n : 1
  54304. , a = 0
  54305. , s = this.object.geometry;
  54306. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  54307. var l = new Ci.BufferGeometry
  54308. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54309. l.addAttribute("position", c),
  54310. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54311. color: r,
  54312. linewidth: o
  54313. })),
  54314. this.matrixAutoUpdate = !1,
  54315. this.update()
  54316. }
  54317. ,
  54318. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54319. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  54320. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  54321. ii = new Ci.Vector3,
  54322. ni = new Ci.Matrix3,
  54323. function() {
  54324. var e = ["a", "b", "c"];
  54325. this.object.updateMatrixWorld(!0),
  54326. ni.getNormalMatrix(this.object.matrixWorld);
  54327. var t = this.object.matrixWorld
  54328. , i = this.geometry.attributes.position
  54329. , n = this.object.geometry;
  54330. if (n instanceof Ci.Geometry)
  54331. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  54332. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  54333. var d = r[c[e[h]]]
  54334. , p = c.vertexNormals[h];
  54335. ti.copy(d).applyMatrix4(t),
  54336. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54337. i.setXYZ(a, ti.x, ti.y, ti.z),
  54338. a += 1,
  54339. i.setXYZ(a, ii.x, ii.y, ii.z),
  54340. a += 1
  54341. }
  54342. else if (n instanceof Ci.BufferGeometry) {
  54343. var f = n.attributes.position
  54344. , g = n.attributes.normal;
  54345. for (h = a = 0,
  54346. u = f.count; h < u; h++)
  54347. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  54348. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  54349. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54350. i.setXYZ(a, ti.x, ti.y, ti.z),
  54351. a += 1,
  54352. i.setXYZ(a, ii.x, ii.y, ii.z),
  54353. a += 1
  54354. }
  54355. return i.needsUpdate = !0,
  54356. this
  54357. }
  54358. ),
  54359. Ci.WireframeHelper = function(e, t) {
  54360. var i = void 0 !== t ? t : 16777215;
  54361. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  54362. color: i
  54363. })),
  54364. this.matrix = e.matrixWorld,
  54365. this.matrixAutoUpdate = !1
  54366. }
  54367. ,
  54368. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54369. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  54370. Ci.ImmediateRenderObject = function(e) {
  54371. Ci.Object3D.call(this),
  54372. this.material = e,
  54373. this.render = function(e) {}
  54374. }
  54375. ,
  54376. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  54377. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  54378. Ci.MorphBlendMesh = function(e, t) {
  54379. Ci.Mesh.call(this, e, t),
  54380. this.animationsMap = {},
  54381. this.animationsList = [];
  54382. var i = this.geometry.morphTargets.length
  54383. , n = i - 1
  54384. , r = i / 1;
  54385. this.createAnimation("__default", 0, n, r),
  54386. this.setAnimationWeight("__default", 1)
  54387. }
  54388. ,
  54389. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  54390. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  54391. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  54392. var r = {
  54393. start: t,
  54394. end: i,
  54395. length: i - t + 1,
  54396. fps: n,
  54397. duration: (i - t) / n,
  54398. lastFrame: 0,
  54399. currentFrame: 0,
  54400. active: !1,
  54401. time: 0,
  54402. direction: 1,
  54403. weight: 1,
  54404. directionBackwards: !1,
  54405. mirroredLoop: !1
  54406. };
  54407. this.animationsMap[e] = r,
  54408. this.animationsList.push(r)
  54409. }
  54410. ,
  54411. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  54412. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  54413. var s = r.morphTargets[o].name.match(i);
  54414. if (s && 1 < s.length)
  54415. n[l = s[1]] || (n[l] = {
  54416. start: 1 / 0,
  54417. end: -1 / 0
  54418. }),
  54419. o < (c = n[l]).start && (c.start = o),
  54420. o > c.end && (c.end = o),
  54421. t = t || l
  54422. }
  54423. for (var l in n) {
  54424. var c = n[l];
  54425. this.createAnimation(l, c.start, c.end, e)
  54426. }
  54427. this.firstAnimation = t
  54428. }
  54429. ,
  54430. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  54431. var t = this.animationsMap[e];
  54432. t && (t.direction = 1,
  54433. t.directionBackwards = !1)
  54434. }
  54435. ,
  54436. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  54437. var t = this.animationsMap[e];
  54438. t && (t.direction = -1,
  54439. t.directionBackwards = !0)
  54440. }
  54441. ,
  54442. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  54443. var i = this.animationsMap[e];
  54444. i && (i.fps = t,
  54445. i.duration = (i.end - i.start) / i.fps)
  54446. }
  54447. ,
  54448. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  54449. var i = this.animationsMap[e];
  54450. i && (i.duration = t,
  54451. i.fps = (i.end - i.start) / i.duration)
  54452. }
  54453. ,
  54454. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  54455. var i = this.animationsMap[e];
  54456. i && (i.weight = t)
  54457. }
  54458. ,
  54459. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  54460. var i = this.animationsMap[e];
  54461. i && (i.time = t)
  54462. }
  54463. ,
  54464. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  54465. var t = 0
  54466. , i = this.animationsMap[e];
  54467. return i && (t = i.time),
  54468. t
  54469. }
  54470. ,
  54471. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  54472. var t = -1
  54473. , i = this.animationsMap[e];
  54474. return i && (t = i.duration),
  54475. t
  54476. }
  54477. ,
  54478. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  54479. var t = this.animationsMap[e];
  54480. t ? (t.time = 0,
  54481. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  54482. }
  54483. ,
  54484. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  54485. var t = this.animationsMap[e];
  54486. t && (t.active = !1)
  54487. }
  54488. ,
  54489. Ci.MorphBlendMesh.prototype.update = function(e) {
  54490. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  54491. var n = this.animationsList[t];
  54492. if (n.active) {
  54493. var r = n.duration / n.length;
  54494. n.time += n.direction * e,
  54495. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  54496. n.time > n.duration && (n.time = n.duration,
  54497. n.directionBackwards = !0),
  54498. n.time < 0 && (n.time = 0,
  54499. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  54500. n.time < 0 && (n.time += n.duration));
  54501. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  54502. , a = n.weight;
  54503. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  54504. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  54505. this.morphTargetInfluences[o] = 0,
  54506. n.lastFrame = n.currentFrame,
  54507. n.currentFrame = o);
  54508. var s = n.time % r / r;
  54509. n.directionBackwards && (s = 1 - s),
  54510. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  54511. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  54512. }
  54513. }
  54514. }
  54515. ,
  54516. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  54517. i.THREE = Ci) : this.THREE = Ci
  54518. }
  54519. , {}]
  54520. }, {}, [116]);